Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source.
   * Copyright 2012, Red Hat, Inc., and individual contributors
   * as indicated by the @author tags. See the copyright.txt file in the
   * distribution for a full listing of individual contributors.
   *
   * This is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Lesser General Public License as
   * published by the Free Software Foundation; either version 2.1 of
  * the License, or (at your option) any later version.
  *
  * This software is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this software; if not, write to the Free
  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  */
 
 package org.jboss.as.host.controller.model.host;
 
 import static org.jboss.as.controller.descriptions.ModelDescriptionConstants.HOST;
 

Author(s):
Tomaz Cerar (c) 2012 Red Hat Inc.
            .setAllowNull(true)
            .setMinSize(1)
            .build();
            .setAllowNull(true)
            .setMinSize(1)
            .build();
            .setAllowNull(true)
            .setMinSize(1)
            .build();
            .setAllowNull(true)
            .setMinSize(1)
            .build();
            .setAllowNull(true)
            .setMinSize(1)
            .build();
            .setMinSize(1)
            .build();
            .setMinSize(1)
            .build();
            .setMinSize(1)
            .build();
    //This is just there for bw compatibility, it had no read handler before this change
            .setAllowNull(true)
            .setMinSize(1)
            .setStorageRuntime()
            .build();
            .setMinSize(1)
            .setStorageRuntime()
            .build();
    public static final SimpleAttributeDefinition DIRECTORY_GROUPING = SimpleAttributeDefinitionBuilder.create(..true).
            setDefaultValue(DirectoryGrouping.defaultValue().toModelNode()).
            setValidator(EnumValidator.create(DirectoryGrouping.classtruetrue)).
            setAllowExpression(true).
            build();
    public static final SimpleAttributeDefinition MASTER = SimpleAttributeDefinitionBuilder.create(..true)
            .setDefaultValue(new ModelNode(false))
            .setStorageRuntime()
            .setResourceOnly()
            .build();
            .build();
                .,
                .,
                .,
                .,
                .,
                .,
            .build();
            .setAllowNull(false)
            .build();
    private final HostControllerEnvironment environment;
    private final HostFileRepository localFileRepository;
    private final ServerInventory serverInventory;
    private final ContentRepository contentRepository;
    private final DomainController domainController;
    private final ExtensionRegistry extensionRegistry;
    private final AbstractVaultReader vaultReader;
    private final ControlledProcessState processState;
    private final PathManagerService pathManager;
    private final ManagedAuditLogger auditLogger;
    public HostResourceDefinition(final String hostName,
                                  final HostControllerConfigurationPersister configurationPersister,
                                  final HostControllerEnvironment environment,
                                  final HostRunningModeControl runningModeControl,
                                  final HostFileRepository localFileRepository,
                                  final LocalHostControllerInfoImpl hostControllerInfo,
                                  final ServerInventory serverInventory,
                                  final HostFileRepository remoteFileRepository,
                                  final ContentRepository contentRepository,
                                  final DomainController domainController,
                                  final ExtensionRegistry extensionRegistry,
                                  final AbstractVaultReader vaultReader,
                                  final IgnoredDomainResourceRegistry ignoredRegistry,
                                  final ControlledProcessState processState,
                                  final PathManagerService pathManager,
                                  final DelegatingConfigurableAuthorizer authorizer,
                                  final ManagedAuditLogger auditLogger) {
        super(PathElement.pathElement(hostName), HostModelUtil.getResourceDescriptionResolver());
        this. = configurationPersister;
        this. = environment;
        this. = runningModeControl;
        this. = localFileRepository;
        this. = hostControllerInfo;
        this. = serverInventory;
        this. = remoteFileRepository;
        this. = contentRepository;
        this. = domainController;
        this. = extensionRegistry;
        this. = vaultReader;
        this. = ignoredRegistry;
        this. = processState;
        this. = pathManager;
        this. = authorizer;
        this. = auditLogger;
    }
    @Override
    public void registerAttributes(ManagementResourceRegistration hostRegistration) {
        super.registerAttributes(hostRegistration);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(.);
        hostRegistration.registerReadOnlyAttribute(null);
        hostRegistration.registerReadOnlyAttribute(.null);
    }
    @Override
    public void registerOperations(ManagementResourceRegistration hostRegistration) {
        super.registerOperations(hostRegistration);
        hostRegistration.registerOperationHandler(.xmh);
        hostRegistration.registerOperationHandler(.ssh);
        hostRegistration.registerOperationHandler(.hsh);
        hostRegistration.registerOperationHandler(HostProcessReloadHandler.getDefinition(), reloadHandler);
        DomainServerLifecycleHandlers.initializeServerInventory();
        hostRegistration.registerOperationHandler(.validateOperationHandler);
        hostRegistration.registerOperationHandler(.snapshotDelete);
        hostRegistration.registerOperationHandler(.snapshotList);
        hostRegistration.registerOperationHandler(.snapshotTake);
        .registerResources(hostRegistration);
        // Platform MBeans
        PlatformMBeanResourceRegistrar.registerPlatformMBeanResources(hostRegistration);
    }
    @Override
    public void registerChildren(ManagementResourceRegistration hostRegistration) {
        super.registerChildren(hostRegistration);
        // System Properties
        hostRegistration.registerSubModel(SystemPropertyResourceDefinition.createForDomainOrHost(..));
        /////////////////////////////////////////
        // Core Services
        //vault
        hostRegistration.registerSubModel(new VaultResourceDefinition());
        // Central Management
        // audit log environment reader
        final EnvironmentNameReader environmentNameReader = new EnvironmentNameReader() {
            public boolean isServer() {
                return false;
            }
            public String getServerName() {
                return null;
            }
            public String getHostName() {
                return .getHostControllerName();
            }
            public String getProductName() {
                if (.getProductConfig() != null && .getProductConfig().getProductName() != null) {
                    return .getProductConfig().getProductName();
                }
                return null;
            }
        };
        hostRegistration.registerSubModel(CoreManagementResourceDefinition.forHost(environmentNameReadernativeManagementhttpManagement));
        // Other core services
        // TODO get a DumpServicesHandler that works on the domain
        //        ManagementResourceRegistration serviceContainer = hostRegistration.registerSubModel(PathElement.pathElement(CORE_SERVICE, SERVICE_CONTAINER), CommonProviders.SERVICE_CONTAINER_PROVIDER);
        //        serviceContainer.registerOperationHandler(DumpServicesHandler.OPERATION_NAME, DumpServicesHandler.INSTANCE, DumpServicesHandler.INSTANCE, false);
        //host-environment
        hostRegistration.registerSubModel(HostEnvironmentResourceDefinition.of());
        hostRegistration.registerSubModel(new ModuleLoadingResourceDefinition());
        // discovery options
        // Jvms
        final ManagementResourceRegistration jvms = hostRegistration.registerSubModel(.);
        //Paths
        hostRegistration.registerSubModel(PathResourceDefinition.createSpecified());
        //interface
        ManagementResourceRegistration interfaces = hostRegistration.registerSubModel(new InterfaceDefinition(
                new HostSpecifiedInterfaceAddHandler(),
                new HostSpecifiedInterfaceRemoveHandler(),
                true
        ));
        //server configurations
        hostRegistration.registerSubModel(new StoppedServerResource());
    }
New to GrepCode? Check out our FAQ X