Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void performRuntime(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws org.jboss.as.controller.OperationFailedException
        protected internal virtual void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        {
            string      suffix = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).LastElement.Value;
            ServiceName name   = ServiceNames.forManagedProcessEngine(suffix);

            context.removeService(name);
        }
Example #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void performRuntime(final org.jboss.as.controller.OperationContext context, final org.jboss.dmr.ModelNode operation, final org.jboss.dmr.ModelNode model) throws org.jboss.as.controller.OperationFailedException
//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
        protected internal override void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        {
            string      jobExecutorThreadPoolName        = SubsystemAttributeDefinitons.THREAD_POOL_NAME.resolveModelAttribute(context, model).asString();
            ServiceName jobExecutorThreadPoolServiceName = ServiceNames.forManagedThreadPool(jobExecutorThreadPoolName);

            performRuntimeThreadPool(context, model, jobExecutorThreadPoolName, jobExecutorThreadPoolServiceName);

            MscExecutorService service = new MscExecutorService();
            ServiceController <MscExecutorService> serviceController = context.ServiceTarget.addService(ServiceNames.forMscExecutorService(), service).addDependency(jobExecutorThreadPoolServiceName, typeof(ManagedQueueExecutorService), service.ManagedQueueInjector).setInitialMode(ServiceController.Mode.ACTIVE).install();
        }
Example #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void performRuntime(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws org.jboss.as.controller.OperationFailedException
        protected internal virtual void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        {
            ServiceName name = ServiceNames.forMscExecutorService();

            context.removeService(name);

            string      jobExecutorThreadPoolName        = SubsystemAttributeDefinitons.THREAD_POOL_NAME.resolveModelAttribute(context, model).asString();
            ServiceName jobExecutorThreadPoolServiceName = ServiceNames.forManagedThreadPool(jobExecutorThreadPoolName);

            context.removeService(jobExecutorThreadPoolServiceName);
        }
Example #4
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();
        }
Example #5
0
        protected internal virtual void createProcessEngineJndiBinding(StartContext context)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.camunda.bpm.container.impl.jboss.util.ProcessEngineManagedReferenceFactory managedReferenceFactory = new org.camunda.bpm.container.impl.jboss.util.ProcessEngineManagedReferenceFactory(processEngine);
            ProcessEngineManagedReferenceFactory managedReferenceFactory = new ProcessEngineManagedReferenceFactory(processEngine);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.msc.service.ServiceName processEngineServiceBindingServiceName = org.jboss.as.naming.deployment.ContextNames.GLOBAL_CONTEXT_SERVICE_NAME.append(org.camunda.bpm.BpmPlatform.APP_JNDI_NAME).append(org.camunda.bpm.BpmPlatform.MODULE_JNDI_NAME).append(processEngine.getName());
            ServiceName processEngineServiceBindingServiceName = ContextNames.GLOBAL_CONTEXT_SERVICE_NAME.append(BpmPlatform.APP_JNDI_NAME).append(BpmPlatform.MODULE_JNDI_NAME).append(processEngine.Name);

//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final String jndiName = org.camunda.bpm.BpmPlatform.JNDI_NAME_PREFIX + "/" + org.camunda.bpm.BpmPlatform.APP_JNDI_NAME + "/" + org.camunda.bpm.BpmPlatform.MODULE_JNDI_NAME + "/" +processEngine.getName();
            string jndiName = BpmPlatform.JNDI_NAME_PREFIX + "/" + BpmPlatform.APP_JNDI_NAME + "/" + BpmPlatform.MODULE_JNDI_NAME + "/" + processEngine.Name;

            // bind process engine service
            bindingService = BindingUtil.createJndiBindings(context.ChildTarget, processEngineServiceBindingServiceName, jndiName, managedReferenceFactory);

            // log info message
            LOGG.info("jndi binding for process engine " + processEngine.Name + " is " + jndiName);
        }
Example #6
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());
        }
Example #7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void deploy(org.jboss.as.server.deployment.DeploymentPhaseContext phaseContext) throws org.jboss.as.server.deployment.DeploymentUnitProcessingException
        public virtual void deploy(DeploymentPhaseContext phaseContext)
        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.as.server.deployment.DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
            DeploymentUnit deploymentUnit = phaseContext.DeploymentUnit;

            if (deploymentUnit.Parent == null)
            {
                //The deployment unit has no parent so it is a simple war or an ear.
                ModuleLoader moduleLoader = Module.BootModuleLoader;
                //If it is a simpleWar and marked with process application we have to add the dependency
                bool isProcessApplicationWarOrEar = ProcessApplicationAttachments.isProcessApplication(deploymentUnit);

                AttachmentList <DeploymentUnit> subdeployments = deploymentUnit.getAttachment(Attachments.SUB_DEPLOYMENTS);
                //Is the list of sub deployments empty the deployment unit is a war file.
                //In cases of war files we have nothing todo.
                if (subdeployments != null)
                {
                    //The deployment unit contains sub deployments which means the deployment unit is an ear.
                    //We have to check whether sub deployments are process applications or not.
                    bool subDeploymentIsProcessApplication = false;
                    foreach (DeploymentUnit subDeploymentUnit in subdeployments)
                    {
                        if (ProcessApplicationAttachments.isProcessApplication(subDeploymentUnit))
                        {
                            subDeploymentIsProcessApplication = true;
                            break;
                        }
                    }
                    //If one sub deployment is a process application then we add to all the dependency
                    //Also we have to add the dependency to the current deployment unit which is an ear
                    if (subDeploymentIsProcessApplication)
                    {
                        foreach (DeploymentUnit subDeploymentUnit in subdeployments)
                        {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.as.server.deployment.module.ModuleSpecification moduleSpecification = subDeploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE_SPECIFICATION);
                            ModuleSpecification moduleSpecification = subDeploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
                            addSystemDependencies(moduleLoader, moduleSpecification);
                        }
                        //An ear is not marked as process application but also needs the dependency
                        isProcessApplicationWarOrEar = true;
                    }
                }

                if (isProcessApplicationWarOrEar)
                {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.jboss.as.server.deployment.module.ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.MODULE_SPECIFICATION);
                    ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
                    addSystemDependencies(moduleLoader, moduleSpecification);
                }
            }

            // install the pa-module service
            ModuleIdentifier identifyer = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER);
            string           moduleName = identifyer.ToString();

            ProcessApplicationModuleService processApplicationModuleService = new ProcessApplicationModuleService();
            ServiceName serviceName = ServiceNames.forProcessApplicationModuleService(moduleName);

            phaseContext.ServiceTarget.addService(serviceName, processApplicationModuleService).addDependency(phaseContext.PhaseServiceName).setInitialMode(Mode.ACTIVE).install();
        }
Example #8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: protected void performRuntime(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws org.jboss.as.controller.OperationFailedException
        protected internal virtual void performRuntime(OperationContext context, ModelNode operation, ModelNode model)
        {
            ServiceName name = ServiceNames.forMscExecutorService();

            context.removeService(name);
        }