コード例 #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();
        }
コード例 #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemWithEnginesAndPropertiesXml() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemWithEnginesAndPropertiesXml()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES_AND_PROPERTIES);

            KernelServices   services  = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();
            ServiceContainer container = services.Container;


            assertNotNull("platform service should be installed", container.getService(PLATFORM_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getService(processEngineServiceBindingServiceName));

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> defaultEngineService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__default"));
            ServiceController <object> defaultEngineService = container.getService(ServiceNames.forManagedProcessEngine("__default"));

            assertNotNull("process engine controller for engine __default is installed ", defaultEngineService);

            ManagedProcessEngineMetadata metadata = ((MscManagedProcessEngineController)defaultEngineService.Service).ProcessEngineMetadata;
            IDictionary <string, string> configurationProperties = metadata.ConfigurationProperties;

            assertEquals("default", configurationProperties["job-name"]);
            assertEquals("default", configurationProperties["job-acquisition"]);
            assertEquals("default", configurationProperties["job-acquisition-name"]);

            IDictionary <string, string> foxLegacyProperties = metadata.FoxLegacyProperties;

            assertTrue(foxLegacyProperties.Count == 0);

            assertNotNull("process engine controller for engine __test is installed ", container.getService(ServiceNames.forManagedProcessEngine("__test")));
            assertNotNull("process engine controller for engine __emptyPropertiesTag is installed ", container.getService(ServiceNames.forManagedProcessEngine("__emptyPropertiesTag")));
            assertNotNull("process engine controller for engine __noPropertiesTag is installed ", container.getService(ServiceNames.forManagedProcessEngine("__noPropertiesTag")));
        }
コード例 #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void performRuntime(final OperationContext context, final org.jboss.dmr.ModelNode operation, final org.jboss.dmr.ModelNode model) throws 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 engineName = PathAddress.pathAddress(operation.get(ADDRESS)).LastElement.Value;

            ManagedProcessEngineMetadata processEngineConfiguration = transformConfiguration(context, engineName, model);

            ServiceController <ProcessEngine> controller = installService(context, processEngineConfiguration);
        }
コード例 #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: @Override protected void performRuntime(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model, org.jboss.as.controller.ServiceVerificationHandler verificationHandler, java.util.List<org.jboss.msc.service.ServiceController<?>> newControllers) throws org.jboss.as.controller.OperationFailedException
        protected internal override void performRuntime <T1>(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, IList <T1> newControllers)
        {
            string engineName = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.ADDRESS)).LastElement.Value;

            ManagedProcessEngineMetadata processEngineConfiguration = transformConfiguration(context, engineName, model);

            ServiceController <ProcessEngine> controller = installService(context, verificationHandler, processEngineConfiguration);

            newControllers.Add(controller);
        }
コード例 #5
0
        public static void initializeServiceBuilder(ManagedProcessEngineMetadata processEngineConfiguration, MscManagedProcessEngineController service, ServiceBuilder <ProcessEngine> serviceBuilder, string jobExecutorName)
        {
            ContextNames.BindInfo datasourceBindInfo = ContextNames.bindInfoFor(processEngineConfiguration.DatasourceJndiName);
            serviceBuilder.addDependency(ServiceName.JBOSS.append("txn").append("TransactionManager"), typeof(TransactionManager), service.TransactionManagerInjector).addDependency(datasourceBindInfo.BinderServiceName, typeof(DataSourceReferenceFactoryService), service.DatasourceBinderServiceInjector).addDependency(ServiceNames.forMscRuntimeContainerDelegate(), typeof(MscRuntimeContainerDelegate), service.RuntimeContainerDelegateInjector).addDependency(ServiceNames.forMscRuntimeContainerJobExecutorService(jobExecutorName), typeof(MscRuntimeContainerJobExecutor), service.MscRuntimeContainerJobExecutorInjector).addDependency(ServiceNames.forMscExecutorService()).InitialMode = Mode.ACTIVE;

            if (processEngineConfiguration.Default)
            {
                serviceBuilder.addAliases(ServiceNames.forDefaultProcessEngine());
            }

            JBossCompatibilityExtension.addServerExecutorDependency(serviceBuilder, service.ExecutorInjector, false);
        }
コード例 #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemXmlWithEnginePropertiesPluginsAndJobExecutorWithExpressions() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemXmlWithEnginePropertiesPluginsAndJobExecutorWithExpressions()
        {
            System.Properties.putAll(EXPRESSION_PROPERTIES);
            try
            {
                string           subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES_PROPERTIES_PLUGINS_AND_JOB_EXECUTOR_WITH_EXPRESSIONS);
                KernelServices   services     = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();
                ServiceContainer container    = services.Container;

                assertNotNull("platform service should be installed", container.getRequiredService(PLATFORM_SERVICE_NAME));
                assertNotNull("process engine service should be bound in JNDI", container.getRequiredService(processEngineServiceBindingServiceName));

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> defaultEngineService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__test"));
                ServiceController <object> defaultEngineService = container.getService(ServiceNames.forManagedProcessEngine("__test"));

                assertNotNull("process engine controller for engine __test is installed ", defaultEngineService);

                ManagedProcessEngineMetadata metadata = ((MscManagedProcessEngineController)defaultEngineService.Service).ProcessEngineMetadata;
                IDictionary <string, string> configurationProperties = metadata.ConfigurationProperties;
                assertEquals("default", configurationProperties["job-acquisition-name"]);

                IDictionary <string, string> foxLegacyProperties = metadata.FoxLegacyProperties;
                assertTrue(foxLegacyProperties.Count == 0);

                assertNotNull("process engine controller for engine __test is installed ", container.getRequiredService(ServiceNames.forManagedProcessEngine("__test")));

                // check we have parsed the plugin configurations
                IList <ProcessEnginePluginXml> pluginConfigurations = metadata.PluginConfigurations;

                assertEquals(1, pluginConfigurations.Count);

                ProcessEnginePluginXml processEnginePluginXml = pluginConfigurations[0];
                assertEquals("org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin", processEnginePluginXml.PluginClass);
                IDictionary <string, string> processEnginePluginXmlProperties = processEnginePluginXml.Properties;
                assertEquals("abc", processEnginePluginXmlProperties["test"]);
                assertEquals("123", processEnginePluginXmlProperties["number"]);
                assertEquals("true", processEnginePluginXmlProperties["bool"]);

                string persistedSubsystemXml = services.PersistedSubsystemXml;
                compareXml(null, subsystemXml, persistedSubsystemXml);
            }
            finally
            {
                foreach (string key in EXPRESSION_PROPERTIES.Keys)
                {
                    System.clearProperty(key);
                }
            }
        }
コード例 #7
0
        protected internal virtual ServiceController <ProcessEngine> installService(OperationContext context, ManagedProcessEngineMetadata processEngineConfiguration)
        {
            MscManagedProcessEngineController service = new MscManagedProcessEngineController(processEngineConfiguration);
            ServiceName name = ServiceNames.forManagedProcessEngine(processEngineConfiguration.EngineName);

            ServiceBuilder <ProcessEngine> serviceBuilder = context.ServiceTarget.addService(name, service);

            MscManagedProcessEngineController.initializeServiceBuilder(processEngineConfiguration, service, serviceBuilder, processEngineConfiguration.JobExecutorAcquisitionName);

            return(serviceBuilder.install());
        }
コード例 #8
0
 /// <summary>
 /// Instantiate  the process engine controller for a process engine configuration.
 ///
 /// </summary>
 public MscManagedProcessEngineController(ManagedProcessEngineMetadata processEngineConfiguration)
 {
     this.processEngineMetadata = processEngineConfiguration;
 }
コード例 #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testInstallSubsystemWithEnginesPropertiesPlugins() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testInstallSubsystemWithEnginesPropertiesPlugins()
        {
            string subsystemXml = FileUtils.readFile(SUBSYSTEM_WITH_ENGINES_PROPERTIES_PLUGINS);

            KernelServices services = createKernelServicesBuilder(null).setSubsystemXml(subsystemXml).build();

            ServiceContainer container = services.Container;

            assertNotNull("platform service should be installed", container.getRequiredService(PLATFORM_SERVICE_NAME));
            assertNotNull("process engine service should be bound in JNDI", container.getRequiredService(processEngineServiceBindingServiceName));

//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> defaultEngineService = container.getService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__default"));
            ServiceController <object> defaultEngineService = container.getService(ServiceNames.forManagedProcessEngine("__default"));

            assertNotNull("process engine controller for engine __default is installed ", defaultEngineService);

            ManagedProcessEngineMetadata metadata = ((MscManagedProcessEngineController)defaultEngineService.Service).ProcessEngineMetadata;
            IDictionary <string, string> configurationProperties = metadata.ConfigurationProperties;

            assertEquals("default", configurationProperties["job-name"]);
            assertEquals("default", configurationProperties["job-acquisition"]);
            assertEquals("default", configurationProperties["job-acquisition-name"]);

            IDictionary <string, string> foxLegacyProperties = metadata.FoxLegacyProperties;

            assertTrue(foxLegacyProperties.Count == 0);

            assertNotNull("process engine controller for engine __default is installed ", container.getRequiredService(ServiceNames.forManagedProcessEngine("__default")));
            assertNotNull("process engine controller for engine __test is installed ", container.getRequiredService(ServiceNames.forManagedProcessEngine("__test")));

            // check we have parsed the plugin configurations
            metadata = ((MscManagedProcessEngineController)container.getRequiredService(ServiceNames.forManagedProcessEngine("__test")).Service).ProcessEngineMetadata;
            IList <ProcessEnginePluginXml> pluginConfigurations = metadata.PluginConfigurations;

            ProcessEnginePluginXml processEnginePluginXml = pluginConfigurations[0];

            assertEquals("org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin", processEnginePluginXml.PluginClass);
            IDictionary <string, string> processEnginePluginXmlProperties = processEnginePluginXml.Properties;

            assertEquals("abc", processEnginePluginXmlProperties["test"]);
            assertEquals("123", processEnginePluginXmlProperties["number"]);
            assertEquals("true", processEnginePluginXmlProperties["bool"]);

            processEnginePluginXml = pluginConfigurations[1];
            assertEquals("org.camunda.bpm.identity.impl.ldap.plugin.LdapIdentityProviderPlugin", processEnginePluginXml.PluginClass);
            processEnginePluginXmlProperties = processEnginePluginXml.Properties;
            assertEquals("cba", processEnginePluginXmlProperties["test"]);
            assertEquals("321", processEnginePluginXmlProperties["number"]);
            assertEquals("false", processEnginePluginXmlProperties["bool"]);

            // test correct subsystem removal
            assertRemoveSubsystemResources(services);
            try
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> service = container.getRequiredService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__default"));
                ServiceController <object> service = container.getRequiredService(ServiceNames.forManagedProcessEngine("__default"));
                fail("Service '" + service.Name + "' should have been removed.");
            }
            catch (Exception)
            {
                // nop
            }
            try
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: org.jboss.msc.service.ServiceController<?> service = container.getRequiredService(org.camunda.bpm.container.impl.jboss.service.ServiceNames.forManagedProcessEngine("__test"));
                ServiceController <object> service = container.getRequiredService(ServiceNames.forManagedProcessEngine("__test"));
                fail("Service '" + service.Name + "' should have been removed.");
            }
            catch (Exception)
            {
                // nop
            }
        }