Package com.sun.enterprise.config.serverbeans

Examples of com.sun.enterprise.config.serverbeans.Server$CreateDecorator


        for (Iterator it = instanceWeights.entrySet().iterator(); it.hasNext();) {
            Map.Entry entry = (Map.Entry) it.next();
            String instance = (String)entry.getKey();

            try {
                Server s = domain.getServerNamed(instance);
                if (s == null) {
                    String msg = localStrings.getLocalString("NoSuchInstance", "No such instance {0}", instance);
                    logger.warning(msg);
                    report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                    report.setMessage(msg);
                    return;
                }

                Cluster c = domain.getClusterForInstance(s.getName());

                if (c == null) {
                   String msg = localStrings.getLocalString("InstanceDoesNotBelongToCluster",
                            "Instance {0} does not belong to cluster {1}.", instance,cluster);
                    logger.warning(msg);
View Full Code Here


                return;
            }
        }
       
        Cluster c = null;
        Server s = null;
        if (isCluster) {
            c = domain.getClusterNamed(target);
            if (c == null ) {
                String msg = localStrings.getLocalString("ClusterNotDefined",
                        "Cluster {0} cannot be used as target", target);
View Full Code Here

            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setMessage(msg);
            return;
        }

        Server server = domain.getServerNamed(serverName);
        boolean isStandAlone = server.getCluster() == null && server.isInstance();
        if (!isStandAlone) {
            String msg = localStrings.getLocalString("NotStandAloneInstance",
                    "[{0}] is not a stand alone instance. Only stand alone instance can be added to a load balancer.",
                    serverName);
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
View Full Code Here

            return;
        }

        try {
            // verify the server instance is valid
            Server server = null;
            if (servers != null)
                server = servers.getServer(sr.instance);
            if (server == null) {
                report.setActionExitCode(ExitCode.FAILURE);
                report.setMessage(
                        strings.getLocalString("sync.unknown.instance",
                            "Unknown server instance: {0}", sr.instance));
                return;
            }

            sync.synchronize(server, sr, context.getOutboundPayload(), report,
                                logger);
            stateService.setState(server.getName(), InstanceState.StateType.NO_RESPONSE, true);
            stateService.removeFailedCommandsForInstance(server.getName());
        } catch (Exception ex) {
            logger.fine("SynchronizeFiles: Exception processing request");
            logger.fine(ex.toString());
            report.setActionExitCode(ExitCode.FAILURE);
            report.setMessage(
View Full Code Here

                    String msg = LbLogUtil.getStringManager().getString("MixofServerAndClusterNotSupported");
                    throw new LbReaderException(msg);
                }
            }
            if (isServer) {
                Server server = _domain.getServerNamed(name);
                //An instance within cluster is not allowed
                if(server.getCluster() != null){
                    String msg = LbLogUtil.getStringManager().getString("ServerPartofClusterNotSupported", name);
                    throw new LbReaderException(msg);
                }
                cls[i++] = new StandAloneClusterReaderImpl(_domain, _appRegistry, server);
            } else {
View Full Code Here

         */
        public <T extends ConfigBeanProxy> NotProcessed changed(TYPE type, Class<T> changedType, T changedInstance) {
            switch (type) {
                case ADD:
                    if (changedInstance instanceof Server) {
                        Server server = (Server) changedInstance;
                        String serverName = server.getName();

                        DomainRoot domainRootProxy = ProxyFactory.getInstance(mMBeanServer).getDomainRootProxy(false);

                        MetadataImpl meta = new MetadataImpl();
                        meta.setCorrespondingConfig(domainRootProxy.getDomain().as(Domain.class).getServers().getServer().get(serverName).objectName());
                        final DASJ2EEServerImpl impl = new DASJ2EEServerImpl(getJ2EEDomain(), meta);
                        ObjectName serverObjectName = new ObjectNameBuilder(mMBeanServer, getJ2EEDomain()).buildChildObjectName(J2EETypes.J2EE_SERVER, serverName);
                        try {
                            mMBeanServer.registerMBean(impl, serverObjectName).getObjectName();
                        }
                        catch (JMException e) {
                            throw new Error(e);
                        }
                    }
                    break;

                case REMOVE:
                    if (changedInstance instanceof Server) {
                        Server server = (Server) changedInstance;
                        String serverName = server.getName();

                        ObjectName serverObjectName = new ObjectNameBuilder(mMBeanServer, getJ2EEDomain()).buildChildObjectName(J2EETypes.J2EE_SERVER, serverName);

                        try {
                            Set serverSet = mMBeanServer.queryNames(new ObjectName(serverObjectName.toString() + ",*"), null);
View Full Code Here

         */
        public <T extends ConfigBeanProxy> NotProcessed changed(TYPE type, Class<T> changedType, T changedInstance) {
            switch (type) {
                case ADD:
                    if (changedInstance instanceof Server) {
                        Server server = (Server) changedInstance;
                        String serverName = server.getName();

                        MetadataImpl meta = new MetadataImpl();
                        meta.setCorrespondingConfig(ConfigBeanRegistry.getInstance().getObjectNameForProxy(server));
                        final DASJ2EEServerImpl impl = new DASJ2EEServerImpl(getJ2EEDomain(), meta);
                        ObjectName serverObjectName = new ObjectNameBuilder(mMBeanServer, getJ2EEDomain()).buildChildObjectName(J2EETypes.J2EE_SERVER, serverName);
                        try {
                            mMBeanServer.registerMBean(impl, serverObjectName).getObjectName();
                        }
                        catch (JMException e) {
                            throw new Error(e);
                        }
                    }
                    break;

                case REMOVE:
                    if (changedInstance instanceof Server) {
                        Server server = (Server) changedInstance;
                        String serverName = server.getName();

                        ObjectName serverObjectName = new ObjectNameBuilder(mMBeanServer, getJ2EEDomain()).buildChildObjectName(J2EETypes.J2EE_SERVER, serverName);

                        try {
                            Set serverSet = mMBeanServer.queryNames(new ObjectName(serverObjectName.toString() + ",*"), null);
View Full Code Here

    @Override
    public void execute(AdminCommandContext context) {
        ActionReport report = context.getActionReport();

        if(instance != null) {
            Server svr = domain.getServerNamed(instance);
            if(svr == null) {
                report.setMessage("No server target found for "
                        + instance);
                report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                return;
            }
            String host = svr.getAdminHost();
            int port = svr.getAdminPort();

            try {
                ServerRemoteAdminCommand remote =
                        new ServerRemoteAdminCommand(
                                locator,
View Full Code Here

         */
        public <T extends ConfigBeanProxy> NotProcessed changed(TYPE type, Class<T> changedType, T changedInstance) {
            switch (type) {
                case ADD:
                    if (changedInstance instanceof Server) {
                        Server server = (Server) changedInstance;
                        String serverName = server.getName();

                        MetadataImpl meta = new MetadataImpl();
                        meta.setCorrespondingConfig(ConfigBeanRegistry.getInstance().getObjectNameForProxy(server));
                        final DASJ2EEServerImpl impl = new DASJ2EEServerImpl(getJ2EEDomain(), meta);
                        ObjectName serverObjectName = new ObjectNameBuilder(mMBeanServer, getJ2EEDomain()).buildChildObjectName(J2EETypes.J2EE_SERVER, serverName);
                        try {
                            mMBeanServer.registerMBean(impl, serverObjectName).getObjectName();
                        }
                        catch (JMException e) {
                            throw new Error(e);
                        }
                    }
                    break;

                case REMOVE:
                    if (changedInstance instanceof Server) {
                        Server server = (Server) changedInstance;
                        String serverName = server.getName();

                        ObjectName serverObjectName = new ObjectNameBuilder(mMBeanServer, getJ2EEDomain()).buildChildObjectName(J2EETypes.J2EE_SERVER, serverName);

                        try {
                            Set serverSet = mMBeanServer.queryNames(new ObjectName(serverObjectName.toString() + ",*"), null);
View Full Code Here

        Returns properties based on the DAS/Cluster/Instance
      */

    public Map<String, String> getLoggingProperties() throws IOException {

        Server targetServer = domain.getServerNamed(env.getInstanceName());

        Map<String, String> props = null;

        if (targetServer != null) {
            if (targetServer.isDas()) {
                props = loggingConfig.getLoggingProperties();
            } else if (targetServer.getCluster() != null) {
                props = loggingConfig.getLoggingProperties(targetServer.getCluster().getConfigRef());
            } else if (targetServer.isInstance()) {
                props = loggingConfig.getLoggingProperties(targetServer.getConfigRef());
            } else {
                props = loggingConfig.getLoggingProperties();
            }
        } else {
            props = loggingConfig.getLoggingProperties();
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.serverbeans.Server$CreateDecorator

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.