Java Code Examples for org.jboss.as.controller.ProcessType#isServer()

The following examples show how to use org.jboss.as.controller.ProcessType#isServer() . 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: AbstractControllerTestBase.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected AbstractControllerTestBase(String hostName, ProcessType processType, boolean useDelegateRootResourceDefinition) {
    this.hostName = hostName;
    this.processType = processType;
    this.useDelegateRootResourceDefinition = useDelegateRootResourceDefinition;
    hostControllerEnvironment = createHostControllerEnvironment(hostName);
    hostControllerInfo = new LocalHostControllerInfoImpl(new ControlledProcessState(false), hostControllerEnvironment);
    domainController = new MockDomainController();
    rootResourceDefinition = useDelegateRootResourceDefinition ?  new TestDelegatingResourceDefiniton() : null;
    capabilityRegistry = new CapabilityRegistry(processType.isServer());
}
 
Example 2
Source File: RemotingSubsystemRootResource.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
private Attributes(ProcessType processType, boolean forDomain) {
    this.forDomain = forDomain;
    this.options = OPTIONS;
    if (processType.isServer()) {
        this.worker = WORKER;
        this.legacy = new AttributeDefinition[LEGACY_ATTRIBUTES.length];
        for (int i = 0; i < LEGACY_ATTRIBUTES.length; i++) {
            // Reject any defined value, but that means there can't be a default (as that gets validated)
            // Also, a default is incorrect on a server, as there really is no value
            this.legacy[i] = SimpleAttributeDefinitionBuilder.create(LEGACY_ATTRIBUTES[i])
                    .setValidator(WorkerThreadValidator.INSTANCE)
                    .setDefaultValue(null)
                    .build();
        }
    } else if (forDomain) {
        this.worker = SimpleAttributeDefinitionBuilder.create(WORKER).setCapabilityReference((CapabilityReferenceRecorder) null).build();
        this.legacy = LEGACY_ATTRIBUTES;
    } else {
        this.worker = WORKER;
        this.legacy = null;
    }
    int count = options.length + 1 + (legacy == null ? 0 : legacy.length);
    all = new AttributeDefinition[count];
    int idx = 0;
    if (legacy != null) {
        System.arraycopy(legacy, 0, all, 0, legacy.length);
        idx += legacy.length;
    }
    all[idx] = worker;
    System.arraycopy(options, 0, all, idx + 1, options.length);
}
 
Example 3
Source File: CapabilityScope.java    From wildfly-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Create a {@code CapabilityScope} appropriate for the given process type and address
 *
 * @param processType the type of process in which the {@code CapabilityScope} exists
 * @param address the address with which the {@code CapabilityScope} is associated
 */
public static CapabilityScope create(ProcessType processType, PathAddress address) {
    CapabilityScope context = CapabilityScope.GLOBAL;
    PathElement pe = processType.isServer() || address.size() == 0 ? null : address.getElement(0);
    if (pe != null) {
        String type = pe.getKey();
        switch (type) {
            case PROFILE: {
                context = address.size() == 1 ? ProfilesCapabilityScope.INSTANCE : new ProfileChildCapabilityScope(pe.getValue());
                break;
            }
            case SOCKET_BINDING_GROUP: {
                context = address.size() == 1 ? SocketBindingGroupsCapabilityScope.INSTANCE : new SocketBindingGroupChildScope(pe.getValue());
                break;
            }
            case HOST: {
                if (address.size() >= 2) {
                    PathElement hostElement = address.getElement(1);
                    final String hostType = hostElement.getKey();
                    switch (hostType) {
                        case SUBSYSTEM:
                        case SOCKET_BINDING_GROUP:
                            context = HostCapabilityScope.INSTANCE;
                            break;
                        case SERVER_CONFIG:
                            context = ServerConfigCapabilityScope.INSTANCE;
                    }
                }
                break;
            }
            case SERVER_GROUP :  {
                context = ServerGroupsCapabilityScope.INSTANCE;
                break;
            }
        }
    }
    return context;

}
 
Example 4
Source File: ReadFeatureDescriptionHandler.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
private boolean isProfileScope(ProcessType processType, PathAddress address) {
    return !processType.isServer() && address.size() >= 2 && PROFILE.equals(address.getElement(0).getKey());
}
 
Example 5
Source File: TestModelControllerService.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
protected TestModelControllerService(final ProcessType processType, final ConfigurationPersister configurationPersister, final ControlledProcessState processState,
                                     final ResourceDefinition rootResourceDefinition) {
    this(processType, configurationPersister, processState, rootResourceDefinition, new CapabilityRegistry(processType.isServer()));
}
 
Example 6
Source File: AbstractKernelServicesImpl.java    From wildfly-core with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public ModelTestModelControllerService create(ProcessType processType, RunningModeControl runningModeControl,
        StringConfigurationPersister persister, ModelTestOperationValidatorFilter validateOpsFilter, TestModelType type, ModelInitializer modelInitializer, ExtensionRegistry extensionRegistry) {
    CapabilityRegistry cr = new CapabilityRegistry(processType.isServer());
    return TestModelControllerService.create(processType, runningModeControl, persister, validateOpsFilter, type, modelInitializer, extensionRegistry, cr);
}