Package com.sun.enterprise.config.serverbeans

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


            allServers = domain.getServers().getServer();

            // why all this nonsense?  ConcurrentModificationException!!!
            for (Iterator<Server> it = allServers.iterator(); it.hasNext();) {
                Server curr = it.next();
                if (serverName.equals(curr.getName())) {
                    it.remove();
                }
            }
            serversOnHost = new ArrayList<ServerPorts>();
        }
View Full Code Here


        if (CommandTarget.CONFIG.isValid(serviceLocator, targetName)) {
            return domain.getConfigNamed(targetName);
        }
        if (CommandTarget.DAS.isValid(serviceLocator, targetName) ||
                CommandTarget.STANDALONE_INSTANCE.isValid(serviceLocator, targetName)) {
            Server s = domain.getServerNamed(targetName);
            return s == null ? null : domain.getConfigNamed(s.getConfigRef());
        }

        if (CommandTarget.CLUSTER.isValid(serviceLocator, targetName)) {
            Cluster cl = domain.getClusterNamed(targetName);
            return cl == null ? null : domain.getConfigNamed(cl.getConfigRef());
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

    public File getLoggingFile() throws IOException {

        File file = null;

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

        if (targetServer != null) {
            if (targetServer.isDas()) {
                file = new File(env.getConfigDirPath(), ServerEnvironmentImpl.kLoggingPropertiesFileName);
            } else if (targetServer.getCluster() != null) {
                String pathForLogging = env.getConfigDirPath() + File.separator + targetServer.getCluster().getConfigRef();
                File dirForLogging = new File(pathForLogging);

                file = new File(dirForLogging, ServerEnvironmentImpl.kLoggingPropertiesFileName);

                if (!file.exists()) {
                    loggingConfig.copyLoggingPropertiesFile(dirForLogging);
                    file = new File(dirForLogging, ServerEnvironmentImpl.kLoggingPropertiesFileName);
                }
            } else if (targetServer.isInstance()) {
                String pathForLogging = env.getConfigDirPath() + File.separator + targetServer.getConfigRef();
                File dirForLogging = new File(pathForLogging);

                file = new File(dirForLogging, ServerEnvironmentImpl.kLoggingPropertiesFileName);

                if (!file.exists()) {
View Full Code Here

                Config config = domain.getConfigNamed(target);
                if (config != null) {
                    targetConfigName = target;
                    isConfig = true;

                    Server targetServer = domain.getServerNamed(SystemPropertyConstants.DEFAULT_SERVER_INSTANCE_NAME);
                    if (targetServer != null && targetServer.getConfigRef().equals(target)) {
                        isDas = true;
                    }
                    targetServer = null;
                } else {
                    Server targetServer = domain.getServerNamed(target);

                    if (targetServer != null && targetServer.isDas()) {
                        isDas = true;
                    } else {
                        com.sun.enterprise.config.serverbeans.Cluster cluster = domain.getClusterNamed(target);
                        if (cluster != null) {
                            isCluster = true;
                            targetConfigName = cluster.getConfigRef();
                        } else if (targetServer != null) {
                            isInstance = true;
                            targetConfigName = targetServer.getConfigRef();
                        }
                    }

                    if (isInstance) {
                        Cluster clusterForInstance = targetServer.getCluster();
                        if (clusterForInstance != null) {
                            targetConfigName = clusterForInstance.getConfigRef();
                        }
                    }
                }
View Full Code Here

        return Globals.getDefaultHabitat();
    }

    private String getServerName() {
        if (serverName == null) {
            Server server = getHabitat().getService(Server.class, ServerEnvironment.DEFAULT_INSTANCE_NAME);
            if (server != null) {
                serverName = server.getName();
            }
        }
        return serverName;
    }
View Full Code Here

     * @param context information
     */
    public void execute(AdminCommandContext context) {
        final ActionReport report = context.getActionReport();

         Server targetServer = domain.getServerNamed(target);
         //String configRef = targetServer.getConfigRef();
        if (targetServer!=null) {
            config = domain.getConfigNamed(targetServer.getConfigRef());
        }
        com.sun.enterprise.config.serverbeans.Cluster cluster =domain.getClusterNamed(target);
        if (cluster!=null) {
            config = domain.getConfigNamed(cluster.getConfigRef());
        }
View Full Code Here

   void createJMSResource(JmsHost defaultJmsHost, ActionReport subReport, String tmpJMSResource, final Subject subject)
   {
        String port = null;
        String host = null;
        Server targetServer = domain.getServerNamed(target);
            if (targetServer != null && ! targetServer.isDas()) {
                port = JmsRaUtil.getJMSPropertyValue(targetServer);
                host = domain.getNodeNamed(targetServer.getNodeRef()).getNodeHost();
            } else{
                Cluster cluster = domain.getClusterNamed(target);
                if (cluster != null && cluster.getInstances().size() != 0) {
                    targetServer = cluster.getInstances().get(0);
                    port = JmsRaUtil.getJMSPropertyValue(targetServer);
                    host = domain.getNodeNamed(targetServer.getNodeRef()).getNodeHost();
                }
            }

        String userName = defaultJmsHost.getAdminUserName();
        String password = defaultJmsHost.getAdminPassword();
View Full Code Here

            return new AttributeList();
        }
    }

    public Vector getInstanceLogFileNames(String instanceName) {
        Server targetServer = domain.getServerNamed(instanceName);
        Vector allInstanceFileNames = new Vector();

        if (targetServer.isDas()) {
            String logFileDetailsForServer = "";

            try {
                // getting log file attribute value from logging.properties file
                logFileDetailsForServer = loggingConfig.getLoggingFileDetails();
View Full Code Here

    /*
    * This method is used by LogViewerResource which is used to display raw log data like 'tail -f server.log'.
    */
    public String getLogFileForGivenTarget(String targetServerName) throws IOException {
        Server targetServer = domain.getServerNamed(targetServerName);
        String serverNode = targetServer.getNodeRef();

        if (targetServer.isDas()) {
            // getting log file for DAS from logging.properties and returning the same
            String logFileDetailsForServer = loggingConfig.getLoggingFileDetails();
            logFileDetailsForServer = TranslatedConfigView.getTranslatedValue(logFileDetailsForServer).toString();
            return logFileDetailsForServer;
        } else {
View Full Code Here

TOP

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

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.