Beispiel #1
0
        protected internal virtual void startProcessEngine(ProcessEngineXml processEngineXml, DeploymentPhaseContext phaseContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.msc.service.ServiceTarget serviceTarget = phaseContext.getServiceTarget();
            ServiceTarget serviceTarget = phaseContext.ServiceTarget;

            // transform configuration
            ManagedProcessEngineMetadata configuration = transformConfiguration(processEngineXml);

            // validate the configuration
            configuration.validate();

            // create service instance
            MscManagedProcessEngineController service = new MscManagedProcessEngineController(configuration);

            // get the service name for the process engine
            ServiceName serviceName = ServiceNames.forManagedProcessEngine(processEngineXml.Name);

            // get service builder
            ServiceBuilder <ProcessEngine> serviceBuilder = serviceTarget.addService(serviceName, service);

            // make this service depend on the current phase -> makes sure it is removed with the phase service at undeployment
            serviceBuilder.addDependency(phaseContext.PhaseServiceName);

            // add Service dependencies
            MscManagedProcessEngineController.initializeServiceBuilder(configuration, service, serviceBuilder, processEngineXml.JobAcquisitionName);

            // install the service
            serviceBuilder.install();
        }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void performRuntimeThreadPool(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode model, String name, org.jboss.msc.service.ServiceName jobExecutorThreadPoolServiceName, org.jboss.as.controller.ServiceVerificationHandler verificationHandler, java.util.List<org.jboss.msc.service.ServiceController<?>> newControllers) throws org.jboss.as.controller.OperationFailedException
        protected internal virtual void performRuntimeThreadPool <T1>(OperationContext context, ModelNode model, string name, ServiceName jobExecutorThreadPoolServiceName, ServiceVerificationHandler verificationHandler, IList <T1> newControllers)
        {
            ServiceTarget serviceTarget = context.ServiceTarget;

            ThreadFactoryService threadFactory = new ThreadFactoryService();

            threadFactory.ThreadGroupName = THREAD_POOL_GRP_NAME + name;

            ServiceName threadFactoryServiceName = ServiceNames.forThreadFactoryService(name);

            ServiceBuilder <ThreadFactory> factoryBuilder = serviceTarget.addService(threadFactoryServiceName, threadFactory);

            if (verificationHandler != null)
            {
                factoryBuilder.addListener(verificationHandler);
            }
            if (newControllers != null)
            {
                newControllers.Add(factoryBuilder.install());
            }
            else
            {
                factoryBuilder.install();
            }

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.as.threads.BoundedQueueThreadPoolService threadPoolService = new org.jboss.as.threads.BoundedQueueThreadPoolService(org.camunda.bpm.container.impl.jboss.extension.SubsystemAttributeDefinitons.CORE_THREADS.resolveModelAttribute(context, model).asInt(), org.camunda.bpm.container.impl.jboss.extension.SubsystemAttributeDefinitons.MAX_THREADS.resolveModelAttribute(context, model).asInt(), org.camunda.bpm.container.impl.jboss.extension.SubsystemAttributeDefinitons.QUEUE_LENGTH.resolveModelAttribute(context, model).asInt(), false, new org.jboss.as.threads.TimeSpec(java.util.concurrent.TimeUnit.SECONDS, org.camunda.bpm.container.impl.jboss.extension.SubsystemAttributeDefinitons.KEEPALIVE_TIME.resolveModelAttribute(context,model).asInt()), org.camunda.bpm.container.impl.jboss.extension.SubsystemAttributeDefinitons.ALLOW_CORE_TIMEOUT.resolveModelAttribute(context, model).asBoolean());
            BoundedQueueThreadPoolService threadPoolService = new BoundedQueueThreadPoolService(SubsystemAttributeDefinitons.CORE_THREADS.resolveModelAttribute(context, model).asInt(), SubsystemAttributeDefinitons.MAX_THREADS.resolveModelAttribute(context, model).asInt(), SubsystemAttributeDefinitons.QUEUE_LENGTH.resolveModelAttribute(context, model).asInt(), false, new TimeSpec(TimeUnit.SECONDS, SubsystemAttributeDefinitons.KEEPALIVE_TIME.resolveModelAttribute(context, model).asInt()), SubsystemAttributeDefinitons.ALLOW_CORE_TIMEOUT.resolveModelAttribute(context, model).asBoolean());

            ServiceBuilder <ManagedQueueExecutorService> builder = serviceTarget.addService(jobExecutorThreadPoolServiceName, threadPoolService).addDependency(threadFactoryServiceName, typeof(ThreadFactory), threadPoolService.ThreadFactoryInjector).setInitialMode(ServiceController.Mode.ACTIVE);

            if (verificationHandler != null)
            {
                builder.addListener(verificationHandler);
            }
            if (newControllers != null)
            {
                newControllers.Add(builder.install());
            }
            else
            {
                builder.install();
            }
        }
Beispiel #3
0
        // 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();
            }
        }