// RuntimeContainerDelegate implementation ///////////////////////////// public virtual void registerProcessEngine(ProcessEngine processEngine) { if (processEngine == null) { throw new ProcessEngineException("Cannot register process engine with Msc Runtime Container: process engine is 'null'"); } ServiceName serviceName = ServiceNames.forManagedProcessEngine(processEngine.Name); if (serviceContainer.getService(serviceName) == null) { MscManagedProcessEngine processEngineRegistration = new MscManagedProcessEngine(processEngine); // install the service asynchronously. childTarget.addService(serviceName, processEngineRegistration).setInitialMode(ServiceController.Mode.ACTIVE).addDependency(ServiceNames.forMscRuntimeContainerDelegate(), typeof(MscRuntimeContainerDelegate), processEngineRegistration.RuntimeContainerDelegateInjector).install(); } }
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes: //ORIGINAL LINE: @SuppressWarnings("unchecked") public void unregisterProcessEngine(org.camunda.bpm.engine.ProcessEngine processEngine) public virtual void unregisterProcessEngine(ProcessEngine processEngine) { if (processEngine == null) { throw new ProcessEngineException("Cannot unregister process engine with Msc Runtime Container: process engine is 'null'"); } ServiceName serviceName = ServiceNames.forManagedProcessEngine(processEngine.Name); // remove the service asynchronously ServiceController <ProcessEngine> service = (ServiceController <ProcessEngine>)serviceContainer.getService(serviceName); if (service != null && service.Service is MscManagedProcessEngine) { service.Mode = ServiceController.Mode.REMOVE; } }
public virtual ProcessEngine getProcessEngine(string name) { return(getProcessEngineService(ServiceNames.forManagedProcessEngine(name))); }