protected Context(Configuration configuration, AbstractFunctionType<?> functionType, Map<String, String> properties) { super(); this.properties = properties; this.fileManagerDirectory = FileHelper.createTempFolder(); grid = new Grid(fileManagerDirectory, 0); client = new GridClientImpl(grid); FunctionTypeRegistry functionTypeRegistry = new FunctionTypeRegistryImpl(new FileResolver(new AttachmentManager(configuration)), client); functionTypeRegistry.registerFunctionType(functionType); try { functionExecutionService = new FunctionExecutionServiceImpl(client, functionTypeRegistry, new DynamicBeanResolver(new DynamicValueResolver(new ExpressionHandler()))); } catch (FunctionExecutionServiceException e) { throw new RuntimeException("Error while creating function execution service", e); } }
protected Context(Configuration configuration, AbstractFunctionType<?> functionType, Map<String, String> properties) { super(); token = new AgentTokenWrapper(); if(properties!=null) { token.setProperties(properties); } Grid grid = new Grid(0); GridClientImpl client = new GridClientImpl(grid, grid); FunctionTypeRegistry functionTypeRegistry = new FunctionTypeRegistryImpl(new FileResolver(new AttachmentManager(configuration)), grid); functionTypeRegistry.registerFunctionType(functionType); functionExecutionService = new FunctionExecutionServiceImpl(client, functionAccessor, functionTypeRegistry, new DynamicBeanResolver(new DynamicValueResolver(new ExpressionHandler()))); }
private void initContext() { context = new GlobalContext(); context.setPluginManager(pluginManager); Configuration configuration = Configuration.getInstance(); mongoClientSession = new MongoClientSession(configuration); context.setConfiguration(configuration); context.setMongoClientSession(mongoClientSession); context.put(CollectionRegistry.class, new CollectionRegistry()); context.setExecutionAccessor(new ExecutionAccessorImpl(mongoClientSession)); context.setArtefactAccessor(new ArtefactAccessorImpl(mongoClientSession)); context.setReportAccessor(new ReportNodeAccessorImpl(mongoClientSession)); context.setScheduleAccessor(new ExecutionTaskAccessorImpl(mongoClientSession)); context.setUserAccessor(new UserAccessorImpl(mongoClientSession)); context.setArtefactManager(new ArtefactManager(context.getArtefactAccessor())); context.setRepositoryObjectManager(new RepositoryObjectManager(context.getArtefactAccessor())); context.setExpressionHandler(new ExpressionHandler(configuration.getProperty("tec.expressions.scriptbaseclass"))); context.setDynamicBeanResolver(new DynamicBeanResolver(new DynamicValueResolver(context.getExpressionHandler()))); context.setEventManager(new EventManager()); context.setAttachmentManager(new AttachmentManager(configuration)); createOrUpdateIndexes(); }
context.setExecutionCallbacks(pluginManager.getProxy()); context.setExpressionHandler(new ExpressionHandler()); context.setDynamicBeanResolver(new DynamicBeanResolver(new DynamicValueResolver(context.getExpressionHandler())));