Java Code Examples for org.jboss.as.controller.ProcessType#HOST_CONTROLLER

The following examples show how to use org.jboss.as.controller.ProcessType#HOST_CONTROLLER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SubsystemTestDelegate.java    From wildfly-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * Output the model to xml
 *
 * @param model the model to marshall
 * @return the xml
 */
String outputModel(ModelNode model) throws Exception {

    StringConfigurationPersister persister = new StringConfigurationPersister(Collections.emptyList(), testParser, true);

    // Use ProcessType.HOST_CONTROLLER for this ExtensionRegistry so we don't need to provide
    // a PathManager via the ExtensionContext. All we need the Extension to do here is register the xml writers
    ExtensionRegistry outputExtensionRegistry = new ExtensionRegistry(ProcessType.HOST_CONTROLLER, new RunningModeControl(RunningMode.NORMAL), null, null, null, RuntimeHostControllerInfoAccessor.SERVER);
    outputExtensionRegistry.setWriterRegistry(persister);


    Extension extension = mainExtension.getClass().newInstance();
    extension.initialize(outputExtensionRegistry.getExtensionContext("Test", MOCK_RESOURCE_REG, ExtensionRegistryType.SLAVE));

    ConfigurationPersister.PersistenceResource resource = persister.store(model, Collections.emptySet());
    resource.commit();
    return persister.getMarshalled();
}
 
Example 2
Source File: HostControllerEnvironment.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/** Only for test cases */
public HostControllerEnvironment(Map<String, String> hostSystemProperties, boolean isRestart, String modulePath,
                                 InetAddress processControllerAddress, Integer processControllerPort, InetAddress hostControllerAddress,
                                 Integer hostControllerPort, String defaultJVM, String domainConfig, String initialDomainConfig, String hostConfig,
                                 String initialHostConfig, RunningMode initialRunningMode, boolean backupDomainFiles, boolean useCachedDc, ProductConfig productConfig) {
    this(hostSystemProperties, isRestart, modulePath, processControllerAddress, processControllerPort, hostControllerAddress, hostControllerPort, defaultJVM,
            domainConfig, initialDomainConfig, hostConfig, initialHostConfig, initialRunningMode, backupDomainFiles, useCachedDc, productConfig, false,
            System.currentTimeMillis(), ProcessType.HOST_CONTROLLER, ConfigurationFile.InteractionPolicy.STANDARD, ConfigurationFile.InteractionPolicy.STANDARD);
}
 
Example 3
Source File: SyncModelServerStateTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public SyncModelServerStateTestCase() {
    super("slave", ProcessType.HOST_CONTROLLER, true);
    ignoredDomainResourceRegistry = new IgnoredDomainResourceRegistry(hostControllerInfo);
    serverProxies = new HashMap<>();
    serverProxies.put("server-one", new MockServerProxy("server-one"));
    serverProxies.put("server-two", new MockServerProxy("server-two"));
    serverProxies.put("server-three", new MockServerProxy("server-three"));
}
 
Example 4
Source File: ChildFirstClassLoaderKernelServicesFactory.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static KernelServices create(List<ModelNode> bootOperations, ModelTestOperationValidatorFilter validateOpsFilter, ModelVersion legacyModelVersion,
        List<LegacyModelInitializerEntry> modelInitializerEntries) throws Exception {

    TestModelType type = TestModelType.DOMAIN;
    XMLMapper xmlMapper = XMLMapper.Factory.create();
    TestParser testParser = TestParser.create(null, xmlMapper, type);
    ModelInitializer modelInitializer = null;
    if (modelInitializerEntries != null && modelInitializerEntries.size() > 0) {
        modelInitializer = new LegacyModelInitializer(modelInitializerEntries);
    }

    RunningModeControl runningModeControl = new HostRunningModeControl(RunningMode.ADMIN_ONLY, RestartMode.HC_ONLY);
    ExtensionRegistry extensionRegistry = new ExtensionRegistry(ProcessType.HOST_CONTROLLER, runningModeControl);
    return AbstractKernelServicesImpl.create(ProcessType.HOST_CONTROLLER, runningModeControl, validateOpsFilter, bootOperations, testParser, legacyModelVersion, type, modelInitializer, extensionRegistry, null);
}
 
Example 5
Source File: CoreModelTestDelegate.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public KernelServicesBuilderImpl(TestModelType type) {
    this.type = type;
    this.processType = type == TestModelType.HOST || type == TestModelType.DOMAIN ? ProcessType.HOST_CONTROLLER : ProcessType.STANDALONE_SERVER;
    runningModeControl = type == TestModelType.HOST ? new HostRunningModeControl(RunningMode.ADMIN_ONLY, RestartMode.HC_ONLY) : new RunningModeControl(RunningMode.ADMIN_ONLY);
    extensionRegistry = new ExtensionRegistry(processType, runningModeControl, null, null, null, RuntimeHostControllerInfoAccessor.SERVER);
    testParser = TestParser.create(extensionRegistry, xmlMapper, type);
}
 
Example 6
Source File: ThreadsSubsystem11TestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
protected AdditionalInitialization createAdditionalInitialization() {
    return new AdditionalInitialization() {

        @Override
        protected ProcessType getProcessType() {
            return ProcessType.HOST_CONTROLLER;
        }

        @Override
        protected RunningMode getRunningMode() {
            return RunningMode.ADMIN_ONLY;
        }
    };
}
 
Example 7
Source File: ThreadsSubsystemTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
protected AdditionalInitialization createAdditionalInitialization() {
    return new AdditionalInitialization() {

        @Override
        protected ProcessType getProcessType() {
            return ProcessType.HOST_CONTROLLER;
        }

        @Override
        protected RunningMode getRunningMode() {
            return RunningMode.ADMIN_ONLY;
        }
    };
}
 
Example 8
Source File: ThreadsSubsystemParsingTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected AdditionalInitialization createAdditionalInitialization() {
    return new AdditionalInitialization() {

        @Override
        protected ProcessType getProcessType() {
            return ProcessType.HOST_CONTROLLER;
        }

        @Override
        protected RunningMode getRunningMode() {
            return RunningMode.ADMIN_ONLY;
        }
    };
}
 
Example 9
Source File: CoreManagementSubsystemTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
protected AdditionalInitialization createAdditionalInitialization() {
    return new AdditionalInitialization() {

        @Override
        protected ProcessType getProcessType() {
            return ProcessType.HOST_CONTROLLER;
        }

        @Override
        protected RunningMode getRunningMode() {
            return RunningMode.ADMIN_ONLY;
        }
    };
}
 
Example 10
Source File: AbstractOperationTestCase.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public ProcessType getProcessType() {
    return ProcessType.HOST_CONTROLLER;
}
 
Example 11
Source File: RemotingSubsystemTestUtil.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
protected ProcessType getProcessType() {
    return ProcessType.HOST_CONTROLLER;
}
 
Example 12
Source File: AdditionalInitialization.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
protected ProcessType getProcessType() {
    return ProcessType.HOST_CONTROLLER;
}
 
Example 13
Source File: AdditionalInitialization.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
protected ProcessType getProcessType() {
    return ProcessType.HOST_CONTROLLER;
}