示例#1
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();
            }
        }