public void activateVariable(String name) { VariableMetaData variable = moduleIncidentals.getVariables().get(name); if (variable == null) { throw new IllegalArgumentException("Failed to find variable information for '" + name + "'"); } String contextDeploymentId = null; if (variable.getOptionalContextName() != null) { contextDeploymentId = ContextDeployTimeResolver.resolveContextDeploymentId(variable.getOptionalContextModule(), variable.getOptionalContextVisibility(), variable.getOptionalContextName(), deploymentId, servicesContext.getContextPathRegistry()); } servicesContext.getVariableManagementService().addVariable(deploymentId, variable, contextDeploymentId); // for non-context variables we allocate the state if (contextDeploymentId == null) { servicesContext.getVariableManagementService().allocateVariableState(deploymentId, name, DEFAULT_AGENT_INSTANCE_ID, recovery, null, servicesContext.getEventBeanTypedEventFactory()); } }
public EPCompilerPathable getRuntimePath() { EPServicesContext services = runtimeEnvironment.getServices(); VariableRepositoryPreconfigured variables = new VariableRepositoryPreconfigured(); for (Map.Entry<String, VariableDeployment> entry : services.getVariableManagementService().getDeploymentsWithVariables().entrySet()) { for (Map.Entry<String, Variable> variableEntry : entry.getValue().getVariables().entrySet()) { if (variableEntry.getValue().getMetaData().isPreconfigured()) { variables.addVariable(variableEntry.getKey(), variableEntry.getValue().getMetaData()); } } } EventTypeRepositoryImpl eventTypes = new EventTypeRepositoryImpl(true); for (Map.Entry<String, EventType> entry : services.getEventTypeRepositoryBus().getNameToTypeMap().entrySet()) { if (entry.getValue().getMetadata().getAccessModifier() == NameAccessModifier.PRECONFIGURED) { eventTypes.addType(entry.getValue()); } } return new EPCompilerPathableImpl( services.getVariablePathRegistry().copy(), services.getEventTypePathRegistry().copy(), services.getExprDeclaredPathRegistry().copy(), services.getNamedWindowPathRegistry().copy(), services.getTablePathRegistry().copy(), services.getContextPathRegistry().copy(), services.getScriptPathRegistry().copy(), eventTypes, variables); }
static void deleteFromPathRegistries(EPServicesContext services, String deploymentId) { services.getEventTypePathRegistry().deleteDeployment(deploymentId); services.getNamedWindowPathRegistry().deleteDeployment(deploymentId); services.getTablePathRegistry().deleteDeployment(deploymentId); services.getContextPathRegistry().deleteDeployment(deploymentId); services.getVariablePathRegistry().deleteDeployment(deploymentId); services.getExprDeclaredPathRegistry().deleteDeployment(deploymentId); services.getScriptPathRegistry().deleteDeployment(deploymentId); }
if (entry.getValue().getContextVisibility().isNonPrivateNonTransient()) { try { services.getContextPathRegistry().add(entry.getKey(), moduleName, entry.getValue(), deploymentId); } catch (PathExceptionAlreadyRegistered ex) { throw new EPDeployPreconditionException(ex.getMessage(), ex);
String depIdContext = services.getContextPathRegistry().getDeploymentId(pathContext.getName(), pathContext.getModuleName()); if (depIdContext == null) { throw makePreconditionExceptionPath(PathRegistryObjectType.CONTEXT, pathContext);
checkDependency(services.getContextPathRegistry(), context, moduleName);
String optionalContextName = informationals.getOptionalContextName(); if (optionalContextName != null) { String contextDeploymentId = ContextDeployTimeResolver.resolveContextDeploymentId(informationals.getOptionalContextModuleName(), informationals.getOptionalContextVisibility(), optionalContextName, deploymentId, services.getContextPathRegistry()); ContextManager contextManager = services.getContextManagementService().getContextManager(contextDeploymentId, optionalContextName); contextRuntimeDescriptor = contextManager.getContextRuntimeDescriptor();
services.getContextPathRegistry().removeDependency(context.getName(), context.getModuleName(), deploymentId);
services.getContextPathRegistry().addDependency(context.getName(), context.getModuleName(), deploymentId);