Пример #1
0
        public static ServiceController <ManagedReferenceFactory> createJndiBindings(ServiceTarget target, ServiceName serviceName, string binderServiceName, ManagedReferenceFactory managedReferenceFactory)
        {
            BinderService binderService = new BinderService(binderServiceName);
            ServiceBuilder <ManagedReferenceFactory> serviceBuilder = target.addService(serviceName, binderService).addDependency(ContextNames.GLOBAL_CONTEXT_SERVICE_NAME, typeof(ServiceBasedNamingStore), binderService.NamingStoreInjector);

            binderService.ManagedObjectInjector.inject(managedReferenceFactory);

            return(serviceBuilder.install());
        }
Пример #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) throws org.jboss.as.controller.OperationFailedException
        protected internal virtual void performRuntimeThreadPool(OperationContext context, ModelNode model, string name, ServiceName jobExecutorThreadPoolServiceName)
        {
            ServiceTarget serviceTarget = context.ServiceTarget;

            ThreadFactoryService threadFactory = new ThreadFactoryService();

            threadFactory.ThreadGroupName = THREAD_POOL_GRP_NAME + name;

            ServiceName threadFactoryServiceName = ServiceNames.forThreadFactoryService(name);

            serviceTarget.addService(threadFactoryServiceName, threadFactory).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());

            serviceTarget.addService(jobExecutorThreadPoolServiceName, threadPoolService).addDependency(threadFactoryServiceName, typeof(ThreadFactory), threadPoolService.ThreadFactoryInjector).setInitialMode(ServiceController.Mode.ACTIVE).install();
        }