Package org.glassfish.internal.api

Examples of org.glassfish.internal.api.Target


                                                   ParameterMap parameters,
                                                   Habitat habitat,
                                                   File intermediateDownloadDir) {

        ActionReport.ExitCode result = ActionReport.ExitCode.SUCCESS;
        Target targetService = habitat.getComponent(Target.class);
        for(String t : targetNames) {
            if(CommandTarget.DAS.isValid(habitat, t) ||
                    CommandTarget.DOMAIN.isValid(habitat, t))
                continue;
            //If the target is a cluster and dynamic reconfig enabled is false, no replication
            if(targetService.isCluster(t)) {
                String dynRecfg = targetService.getClusterConfig(t).getDynamicReconfigurationEnabled();
                if(Boolean.FALSE.equals(Boolean.valueOf(dynRecfg))) {
                    ActionReport aReport = context.getActionReport().addSubActionsReport();
                    aReport.setActionExitCode(ActionReport.ExitCode.WARNING);
                    aReport.setMessage(strings.getLocalString("glassfish.clusterexecutor.dynrecfgdisabled",
                            "WARNING : The command was not replicated to all cluster instances because the" +
                                    " dynamic-reconfig-enabled flag is set to false for cluster {0}", t));
                    InstanceStateService instanceState = habitat.getComponent(InstanceStateService.class);
                    for(Server s : targetService.getInstances(t)) {
                        instanceState.setState(s.getName(), InstanceState.StateType.RESTART_REQUIRED, false);
                        instanceState.addFailedCommandToInstance(s.getName(), commandName, parameters);
                    }
                    result = ActionReport.ExitCode.WARNING;
                    continue;
                }
            }
            parameters.set("target", t);
            ActionReport.ExitCode returnValue = ClusterOperationUtil.replicateCommand(commandName,
                    failPolicy, offlinePolicy, targetService.getInstances(t), context, parameters, habitat,
                    intermediateDownloadDir);
            if(!returnValue.equals(ActionReport.ExitCode.SUCCESS)) {
                result = returnValue;
            }
        }
View Full Code Here


                }
                // create new ResourceRef as a child of Cluster
                cluster.createResourceRef(enabled.toString(), refName);

                // create new ResourceRef for all instances of Cluster
                Target tgt = habitat.getComponent(Target.class);
                List<Server> instances = tgt.getInstances(target);
                for (Server svr : instances) {
                    svr.createResourceRef(enabled.toString(), refName);
                }
            }
        } catch (TransactionFailure tfe) {
View Full Code Here

                    setResourceRefDoNotExistMessage(report);
                    return;
                }

                // delete ResourceRef for all instances of Cluster
                Target tgt = habitat.getComponent(Target.class);
                List<Server> instances = tgt.getInstances(target);
                for (Server svr : instances) {
                    svr.deleteResourceRef(refName);
                }
            }
        } catch(Exception e) {
View Full Code Here

                if (!cluster.isResourceRefExists(jndiName)) {
                    // create new ResourceRef as a child of Cluster
                    cluster.createResourceRef(enabled, jndiName);

                    // create new ResourceRef for all instances of Cluster
                    Target tgt = habitat.getComponent(Target.class);
                    List<Server> instances = tgt.getInstances(target);
                    for (Server svr : instances) {
                        if (!svr.isResourceRefExists(jndiName)) {
                            svr.createResourceRef(enabled, jndiName);
                        }
                    }
View Full Code Here

                if (cluster.isResourceRefExists(jndiName)) {
                    // delete ResourceRef of Cluster
                    cluster.deleteResourceRef(jndiName);

                    // delete ResourceRef for all instances of Cluster
                    Target tgt = habitat.getComponent(Target.class);
                    List<Server> instances = tgt.getInstances(target);
                    for (Server svr : instances) {
                        if (svr.isResourceRefExists(jndiName)) {
                            svr.deleteResourceRef(jndiName);
                        }
                    }
View Full Code Here

    ServiceLocator services;
    private ActionReport report;

    @Override
    public void execute(AdminCommandContext context) {
        Target targetUtil = services.getService(Target.class);
        Config newConfig = targetUtil.getConfig(target);
        if (newConfig!=null) {
            config = newConfig;
        }
        report = context.getActionReport();
        try {
View Full Code Here

    // ----------------------------------------------- Methods from AdminCommand


    @Override
    public void execute(AdminCommandContext context) {
        Target targetUtil = services.getService(Target.class);
        Config newConfig = targetUtil.getConfig(target);
        if (newConfig != null) {
            config = newConfig;
        }
        Protocol protocolToBeRemoved = null;
        ActionReport report = context.getActionReport();
View Full Code Here

     * the values the parameter values
     *
     * @param context information
     */
    public void execute(AdminCommandContext context) {
        Target targetUtil = services.getService(Target.class);
        Config newConfig = targetUtil.getConfig(target);
        if (newConfig!=null) {
            config = newConfig;
        }
        final ActionReport report = context.getActionReport();
        // check for duplicates
View Full Code Here

     * the values the parameter values
     *
     * @param context information
     */
    public void execute(AdminCommandContext context) {
        Target targetUtil = services.getService(Target.class);
        Config newConfig = targetUtil.getConfig(target);
        if (newConfig!=null) {
            config = newConfig;
        }
        final ActionReport report = context.getActionReport();
        List<VirtualServer> list = config.getHttpService().getVirtualServer();
View Full Code Here

    Domain domain;
    @Inject
    ServiceLocator services;

    public void execute(AdminCommandContext context) {
        Target targetUtil = services.getService(Target.class);
        Config newConfig = targetUtil.getConfig(target);
        if (newConfig!=null) {
            config = newConfig;
        }
        final ActionReport report = context.getActionReport();
        Protocol protocol = config.getNetworkConfig().getProtocols().findProtocol(protocolName);
View Full Code Here

TOP

Related Classes of org.glassfish.internal.api.Target

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.