@@ -0,0 +1,2774 @@
+/*%0A * JBoss, Home of Professional Open Source%0A * Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors%0A * as indicated by the @author tags. All rights reserved.%0A * See the copyright.txt in the distribution for a%0A * full listing of individual contributors.%0A *%0A * This copyrighted material is made available to anyone wishing to use,%0A * modify, copy, or redistribute it subject to the terms and conditions%0A * of the GNU Lesser General Public License, v. 2.1.%0A * This program is distributed in the hope that it will be useful, but WITHOUT A%0A * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A%0A * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.%0A * You should have received a copy of the GNU Lesser General Public License,%0A * v.2.1 along with this distribution; if not, write to the Free Software%0A * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,%0A * MA  02110-1301, USA.%0A */%0A%0Apackage org.jboss.as.console.client.core;%0A%0Aimport com.google.gwt.user.client.rpc.AsyncCallback;%0Aimport org.jboss.as.console.client.shared.dispatch.AsyncCommand;%0Aimport org.jboss.as.console.client.shared.dispatch.DispatchAsync;%0Aimport org.jboss.as.console.client.shared.dispatch.impl.DMRAction;%0Aimport org.jboss.as.console.client.shared.dispatch.impl.DMRResponse;%0Aimport org.jboss.dmr.client.ModelNode;%0A%0Aimport static org.jboss.dmr.client.ModelDescriptionConstants.*;%0A%0A/**%0A * @author Heiko Braun%0A * @date 5/19/11%0A */%0Apublic class BootstrapCmd implements AsyncCommand%3CBoolean%3E%7B%0A%0A%0A    private BootstrapContext bootstrap;%0A    private DispatchAsync dispatcher;%0A%0A    public BootstrapCmd(BootstrapContext bootstrap, DispatchAsync dispatcher) %7B%0A        this.bootstrap = bootstrap;%0A        this.dispatcher = dispatcher;%0A    %7D%0A%0A    @Override%0A    public void execute(final AsyncCallback%3CBoolean%3E callback) %7B%0A%0A        final ModelNode operation = new ModelNode();%0A        operation.get(OP).set(READ_CHILDREN_NAMES_OPERATION);%0A        operation.get(CHILD_TYPE).set(%22subsystem%22);%0A        operation.get(ADDRESS).setEmptyList();%0A%0A        dispatcher.execute(new DMRAction(operation), new AsyncCallback%3CDMRResponse%3E() %7B%0A            @Override%0A            public void onFailure(Throwable caught) %7B%0A                bootstrap.setProperty(BootstrapContext.STANDALONE, %22false%22);%0A            %7D%0A%0A            @Override%0A            public void onSuccess(DMRResponse result) %7B%0A%0A                ModelNode response = ModelNode.fromBase64(result.getResponseText());%0A                boolean outcome = response.get(%22outcome%22).asString().equals(%22success%22);%0A                bootstrap.setProperty(BootstrapContext.STANDALONE, Boolean.valueOf(outcome).toString());%0A%0A                callback.onSuccess(outcome);%0A%0A            %7D%0A        %7D);%0A%0A    %7D%0A%7D%0A

Move bootstrap op to custom command