Package com.sun.enterprise.config.serverbeans

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


        final Target target = TargetBuilder.INSTANCE.createTarget(
            validTypes, targetName, configContext);           
       
        if (target.getType() == TargetType.SERVER ||
            target.getType() == TargetType.DAS) {
            final Server server = ServerHelper.getServerByName(configContext, target.getName());
            deleteResourceReferenceFromServer(server, referenceName);
        } else if (target.getType().equals(TargetType.CLUSTER)) {
            final Cluster cluster = ClusterHelper.getClusterByName(configContext, target.getName());
            deleteResourceReferenceFromCluster(cluster, referenceName);
            final Server[] servers = ServerHelper.getServersInCluster(configContext, target.getName());
View Full Code Here


         */
        Domain domain=ConfigAPIHelper.getDomainConfigBean(configCtxt);
        setDomainName(domain);
        // get the server's config by name, need it as soon as possible for logging
        String serverName=System.getProperty(SystemPropertyConstants.SERVER_NAME);
        Server server=ServerHelper.getServerByName(configCtxt, serverName);
        String configRef=server.getConfigRef();
       
        // create the command to execute
        Command command=new Command();
       
        // set jvmargs for thread dump to go to child process log, workaround for bug #4957071
        //command.addJvmOption("-XX:+UnlockDiagnosticVMOptions");
        //command.addJvmOption("-XX:+LogVMOutput");
        //command.addJvmOption("-XX:LogFile=" + logFile);
        //command.addJvmOption("-XX:LogFile=/tmp/threadDump.txt");
       
        // get server's config
        Config config=ServerHelper.getConfigForServer(configCtxt, serverName);
       
        // configure log service and print redirect message
        String logFile=configureLogService(config);
        if (bDebug) System.out.println("LOGFILE = " + logFile);
       
        // make sure log is writable, if not a message will be logged to the screen if in verbose mode
        createFileStructure(logFile);
        command.setLogFile(logFile);
       
        // should NOT need to addLogFileToLogger(logFile), logManager should already do this for us
        // may need to enable if log is movable ???
       
        // TODO Logging Weirdnesses
        addLogFileToLogger(logFile);
       
        // add log to properties so PEMAIN will redirect is applicable
        command.addSystemVariable(LOGFILE_SYSTEM_PROPERTY, logFile);
       
        getLogger().log(FINE_LEVEL,"Retrieved domain.xml from " + domainXMLLocation);
        getLogger().log(FINE_LEVEL,"Start building the command the to execute.");
       
        //Set system properties that correspond directly to asenv.conf/bat. This
        //keeps us from having to pass them all from -D on the command line.
        //ASenvPropertyReader reader = new ASenvPropertyReader(System.getProperty(SystemPropertyConstants.CONFIG_ROOT_PROPERTY));
        //reader.setSystemProperties();
       
        // verbose set, flag used in ServerLogManager to send logs to stderr
        if (isVerboseEnabled())
        {
            command.addSystemVariable(VERBOSE_SYSTEM_PROPERTY, "true");
            // add to System.properties for config conditional adds (could be set about if not native launcher)
            System.setProperty(VERBOSE_SYSTEM_PROPERTY, "true");
        }
       
        // read in ASLauncherConfig
        String launcherConfigFile=System.getProperty(SystemPropertyConstants.INSTALL_ROOT_PROPERTY)
        + File.separator + "lib" + File.separator + "processLauncher.xml";
       
        String processName=System.getProperty(LaunchConstants.PROCESS_NAME_PROP, INTERNAL_SERVER_PROFILE);
        getLogger().log(FINE_LEVEL,"Loading ASLauncher config from: " + launcherConfigFile
                + " - for the process named: " + processName);
       
        ASLauncherConfig plConfig=new ASLauncherConfig(launcherConfigFile, processName);
       
        // take plConfig properties as the base for the system jvm args for the new process
        Properties systemProperties=plConfig.getSystemProperties();
       
        // add domain.xml property elements to the jvm args in reverse order of precedence.
        // First add the domain properties
        addSystemProperties(domain.getSystemProperty(), systemProperties);
       
       
       
        // set config name (which is retrieved from domain.xml) into System properties to be used for path resolution
        System.setProperty(SystemPropertyConstants.CONFIG_NAME_PROPERTY, configRef);
        systemProperties.put(SystemPropertyConstants.CONFIG_NAME_PROPERTY, configRef);
       
        // get javaconfig for server that is being started
        JavaConfig javaConfig=config.getJavaConfig();
       
        // derive and add java command to Command
        String jvmCmd=javaConfig.getJavaHome() + File.separator + "bin"
                + File.separator + "java";
       
        command.setJavaCommand(jvmCmd);
       
       
        // fix for bug# 6323645
        // Do not add options which are not applicable for stop action.
        // For ex. debug options and profiler options.
        // In other words add the following options ony when the action
        // is other than stop.
       
        Profiler profiler=javaConfig.getProfiler();
        String profilerClasspath=null;
       
        if (!action.equals(LAUNCHER_STOP_ACTION))
        {
           
            // The debug options including the debug port would be added
            // to the command  when the action is start.
            // If the action is stop adding the same port to the java command
            // would stack up the ports and block until the port assigned for
            // start action is released. To avoid this we check for stop action.
           
            // If the stop action needs to be debugged then one work around is to
            // copy the java command from server.log, change the debug settings and
            // run the command.
           
            // debug options
            if ((javaConfig.isDebugEnabled() || isDebugEnabled()))
            {
                // add debug statements
                addDebugOptions(command, javaConfig.getDebugOptions());
            }
           
            // add profiler properties & jvm args
            if (profiler != null && profiler.isEnabled())
            {
                // add config properties
                addElementProperties(profiler.getElementProperty(), systemProperties);
                String [] jvmOptions=profiler.getJvmOptions();
                addJvmOptions(command, jvmOptions, action);
                profilerClasspath=profiler.getClasspath();
            }
        }
       
        // set the default locale specified in domain.xml config file
        String locale=domain.getLocale();
        if (locale == null || locale.equals(""))
        {
            // if not specified in domain try system
            locale=System.getProperty(SystemPropertyConstants.DEFAULT_LOCALE_PROPERTY);
        }
        // make sure locale is specified before setting it
        if (locale != null && !locale.equals(""))
        {
            command.addSystemVariable(SystemPropertyConstants.DEFAULT_LOCALE_PROPERTY, locale);
        }
        //
        // add jvm args, look for combined jvm options
        String[] jvmOptions=javaConfig.getJvmOptions();
        addJvmOptions(command, jvmOptions, action);
       
        //
        // add config system properties
        addSystemProperties(config.getSystemProperty(), systemProperties);
       
        //
        // add cluster system properties if the server instance is clustered
        if (ServerHelper.isServerClustered(configCtxt, server))
        {
            Cluster cluster = ClusterHelper.getClusterForInstance(configCtxt,
                    server.getName());
            addSystemProperties(cluster.getSystemProperty(), systemProperties);
        }
       
        //
        // add server system properties
        addSystemProperties(server.getSystemProperty(), systemProperties);
       
        //
        // add classpath
        // check to see if jvmCmd starts with same as processLauncher jvm.
        // if so, use the system property java-version to determine jvm version
View Full Code Here

        boolean isEjb = false;
        boolean isStandAlone = false;
        String modName = null;
        String ctxRoot = null;
        String vs  = WebServiceMgrBackEnd.DEFAULT_VIRTUAL_SERVER;
        Server server = null;
        try {
            ServerContext sCtx = ApplicationServer.getServerContext();
            server = ServerHelper.getServerByName(sCtx.getConfigContext(),
                                                  sCtx.getInstanceName());
            ApplicationRef aRef = server.getApplicationRefByRef(appId);
            if (aRef != null) {
                vs = aRef.getVirtualServers();
                if ((vs == null) || ( vs.length() == 0)) {
                    vs = WebServiceMgrBackEnd.DEFAULT_VIRTUAL_SERVER;
                }
View Full Code Here

            ConfigUpdate configUpdate = null;
            ArrayList configChangeList = ue.getConfigChangeList();

            String xpath = null;
            Server serverBean = ServerBeansFactory.getServerBean(configContext);
            ElementProperty elementProperty = null;
            Object object;
            Object configObject;

            for (int i = 0; i < configChangeList.size(); i++) {
View Full Code Here

    }   
       
    public static NodeAgent getNodeAgentForServer(ConfigContext configContext, String instanceName)
        throws ConfigException
    {       
        final Server server = ServerHelper.getServerByName(configContext, instanceName);
        final Domain domain = getDomainConfigBean(configContext);         
        final NodeAgent controller = domain.getNodeAgents().getNodeAgentByName(
            server.getNodeAgentRef());
        if (controller == null) {
            throw new ConfigException(_strMgr.getString("noSuchAgentForInstance",
                instanceName, server.getNodeAgentRef()));
        }
        return controller;
    }
View Full Code Here

        try {
            Domain domain = (Domain) configContext.getRootConfigBean();
            Clusters clusters = domain.getClusters();
            Cluster[] cl = clusters.getCluster();
            Server[] servers = ServerHelper.getServersOfANodeAgent(configContext, nodeAgentName);
            Server aServerContextOfNodeAgent = null;
            if (servers != null && servers.length >=1) {
                aServerContextOfNodeAgent = servers[0];
            }
           
            for (int i=0; i < cl.length; i++) {
View Full Code Here

    }
   
    private void cleanCachedConnectionToDAS()
    throws ConfigException, InstanceException {
   
        Server das = ServerHelper.getDAS(getConfigContext());
        InstanceRegistry.removeInstanceConnection(das.getName());
        try {
            InstanceRegistry.getDASConnection(getConfigContext());
        } catch (InstanceException ex) {
            // nothing more can be done, next attempt to connect to DAS
            // hopefully works     
View Full Code Here

                              dasInfo.getHost()});
           
        }
       
        // check to see if jmx secure flas has changed
        Server das = ServerHelper.getDAS(getConfigContext());
        if (das != null) {
            String dasName=das.getName();
            JmxConnector dasConnector = ServerHelper.getServerSystemConnector(
                                            getConfigContext(), dasName);
            if (dasConnector != null) {
                String jmxConnSecure =
                    String.valueOf(dasConnector.isSecurityEnabled());
View Full Code Here

                server = (MBeanServer)mbservers.get(0);
            }
    } else {
      // non DAS instance
      server = null;
      Server dasSrv = ServerHelper.getDAS(configContext);
      String dasName = dasSrv.getName();
      MBeanServerConnection mbsc = ServerHelper.connect(configContext, dasName);
      if (mbsc != null) {
    server = mbsc;
      }
    }
View Full Code Here

           
            ConfigAdd configAdd = null;
            ArrayList configChangeList = event.getConfigChangeList();
            VirtualServer vsBean = null;
            String xpath = null;
            Server serverBean = ServerBeansFactory.getServerBean(configContext);
            ElementProperty elementProperty = null;
            Object object;
            Object configObject;
           
            for (int i=0; i < configChangeList.size(); i++){
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.