Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
  * JBoss, Home of Professional Open Source.
  * Copyright 2011, Red Hat Middleware LLC, 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.domain.controller.operations.deployment;
 
 

Author(s):
Kabir Khan
 
 
     .setDefaultValue(new ModelNode(true)).build();
 
     .setDefaultValue(new ModelNode(true)).build();
 
     .setDefaultValue(new ModelNode(true)).build();
 
 
 
 
     public static OperationDefinition getDefinition(final LocalHostControllerInfo hostControllerInfo) {
         return new DeferredParametersOperationDefinitionBuilder(hostControllerInfo, HostModelUtil.getResourceDescriptionResolver())
             .setParameters(hostControllerInfo.isMasterDomainController() ?  : )
             .setRuntimeOnly()
             .build();
     }
 
     public HostProcessReloadHandler(final ServiceName rootServicefinal HostRunningModeControl runningModeControlfinal ControlledProcessState processState) {
         super(rootServicerunningModeControlprocessState);
     }
 
     @Override
         final boolean adminOnly = .resolveModelAttribute(contextoperation).asBoolean(false);
         final boolean restartServers = .resolveModelAttribute(contextoperation).asBoolean(true);
         final boolean useCurrentHostConfig = .resolveModelAttribute(contextoperation).asBoolean(true);
         final boolean useCurrentDomainConfig = .resolveModelAttribute(contextoperation).asBoolean(true);
 
         return new ReloadContext<HostRunningModeControl>() {
 
             @Override
             public void reloadInitiated(HostRunningModeControl runningModeControl) {
                 runningModeControl.setRestartMode(restartServers ? . : .);
             }
 
             @Override
             public void doReload(HostRunningModeControl runningModeControl) {
                 runningModeControl.setRunningMode(adminOnly ? . : .);
                 runningModeControl.setReloaded();
                 runningModeControl.setUseCurrentConfig(useCurrentHostConfig);
                runningModeControl.setUseCurrentDomainConfig(useCurrentDomainConfig);
            }
        };
    }

    
The host controller info does not know if it is master or not until later in the bootup process
        private final LocalHostControllerInfo hostControllerInfo;
        public DeferredParametersOperationDefinitionBuilder(LocalHostControllerInfo hostControllerInfoString nameResourceDescriptionResolver resolver) {
            super(nameresolver);
            this. = hostControllerInfo;
        }
        @Override
        public SimpleOperationDefinition internalBuild(final ResourceDescriptionResolver resolverfinal ResourceDescriptionResolver attributeResolver) {
            return new SimpleOperationDefinition(resolverattributeResolverfalse) {
                @Override
                public DescriptionProvider getDescriptionProvider() {
                    return new DescriptionProvider() {
                        @Override
                        public ModelNode getModelDescription(Locale locale) {
                            AttributeDefinition[] params = .isMasterDomainController() ?  : ;
                            return new DefaultOperationDescriptionProvider(getName(), resolverattributeResolverparams).getModelDescription(locale);
                        }
                    };
                }
            };
        }
    }
New to GrepCode? Check out our FAQ X