Examples of Servers


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

     * @param  appName  name of the application id
     * @return true if the names application is referenced by this server
     */
    private boolean isReferenced(String appName) {

        Servers servers = domain.getServers();
        Server server = servers.getServerByName(
                                _serverContext.getInstanceName());

        ApplicationRef ref = server.getApplicationRefByRef(appName);
        return (ref == null) ? false : true;
    }
View Full Code Here

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

                VALID_TYPES, serverName, configContext);  
            final NodeAgent controller = target.getNodeAgents()[0];
           
            //Remove the server instance
            final Domain domain = ConfigAPIHelper.getDomainConfigBean(configContext);           
            final Servers servers = domain.getServers();
            final Server server = target.getServers()[0];
            boolean isReachable = true;

            try {               
                ServerRuntimeMBean serverMBean = InstanceProxy.getInstanceProxy(serverName);
                Status status = serverMBean.getRuntimeStatus().getStatus();
            } catch (Exception ex) {
                if (InstanceProxy.isUnreachable(ex)) {
                    isReachable = false;
                }
            }

            if(isReachable)
                throw new InstanceException(_strMgr.getString("serverIsNotStopped",
                    serverName));
           
            if (ServerHelper.isServerStandAlone(configContext, serverName)) {
                //If the server instance is stand-alone, we must remove its stand alone
                //configuration after removing the server instance (since a configuration
                //can only be deleted if it is unreferenced). Unfortunately, if
                //this fails, we leave an unreferenced standalone configurtion.               
                String configName = server.getConfigRef();
                // remove the server
                servers.removeServer(server, OVERWRITE);           
                //remove the standalone configuration               
                //FIXTHIS: One issue is that the call below will result in a call to flushAll
                //which is also called below. This must be taken into account when we
                //figure out the notification story.
                getConfigsConfigBean().deleteConfiguration(configName);
            } else {
                if (ServerHelper.isServerClustered(configContext, server)) {
                    //If the instance is clustered, the we must remove the server refs from
                    //the cluster.
                    deleteClusterReferences(serverName);
                }               
                //Remove the server
                servers.removeServer(server, OVERWRITE);    
            }
           
            //Remove our connction to the server instance
            InstanceRegistry.removeInstanceConnection(serverName);
           
View Full Code Here

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

            }           
           
            //Ensure that server specified by serverName does not already exist.
            //Given that we've already checked for uniqueness earlier, this should never
            //be the case, but we'll be extra safe here.
            Servers servers = domain.getServers();
            Server server = servers.getServerByName(serverName);
            if (server != null) {
                throw new InstanceException(_strMgr.getString("serverAlreadyExists",
                    serverName));
            }                           
           
View Full Code Here

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

                    "configurationNameRestricted", newConfigName));
            }

      // Ensure that the name is a valid target meaning that there are no
      // servers and clusters with the same name                    
      Servers servers = domain.getServers();
      Server server = servers.getServerByName(newConfigName);
            if (server != null) {
                throw new ConfigException(_strMgr.getString(
                    "configurationNameAlreadyExistsAsServer", newConfigName));
            }
View Full Code Here

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

 
    protected void setUp() throws ConfigException, LbReaderException{
       
        ConfigContext ctx = ConfigFactory.createConfigContext(URL);
        Servers servers=((Domain) ctx.getRootConfigBean()).getServers();

        FileInputStream in = null;
        try {
            in = new FileInputStream( new File(URL2));
        } catch (FileNotFoundException fne) {
            fne.printStackTrace();
            System.out.println(" File could not opened " + URL2);
        }

        SunWebApp sunWebApp = null;
        try {
            sunWebApp = SunWebApp.createGraph(in);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println(" Sun web app bean creation failed  " );
        }

        ApplicationRef ref =
            servers.getServerByName(SERVERNAME).getApplicationRefByRef(APPNAME);
        impl = new SunWebModuleReaderImpl(ctx, ref, sunWebApp);
    }
View Full Code Here

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

                return false;
            }



            final Servers servers = server.getParent(Servers.class);
            final Domain domain = servers.getParent(Domain.class);
            final Configs configs = domain.getConfigs();

            if (servers.getServer(serverName) != null) { // validate for set, not _register-instance
                // cannot change config ref of a clustered instance
                Cluster cluster = domain.getClusterForInstance(serverName);
                if (cluster != null) { // cluster is not null during create-local-instance --cluster c1 i1
                    if (!cluster.getConfigRef().equals(configRef)) {
                        // During set when trying to change config-ref of a clustered instance,
View Full Code Here

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

        }
        //debug( "AMXJ2EEStartupService.postConstruct(): registered: " + OBJECT_NAME);
    }

    private void addListenerToServer() {
        Servers servers = domain.getServers();
        ObservableBean bean = (ObservableBean) ConfigSupport.getImpl((ConfigBeanProxy) servers);
        bean.addListener(this);
    }
View Full Code Here

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

    public void postConstruct() {
        addListenerToServer();
    }

    private void addListenerToServer() {
        Servers servers = domain.getServers();
        ObservableBean bean = (ObservableBean) ConfigSupport.getImpl((ConfigBeanProxy) servers);
        bean.addListener(this);
    }
View Full Code Here

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

    public void postConstruct() {
        addListenerToServer();
    }

    private void addListenerToServer() {
        Servers servers = domain.getServers();
        ObservableBean bean = (ObservableBean) ConfigSupport.getImpl((ConfigBeanProxy) servers);
        bean.addListener(this);
    }
View Full Code Here

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

            if (gmsAdapter != null) {
                domain = habitat.getComponent( Domain.class ) ;
                fineLog( "IiopFolbGmsClient: domain {0}", domain) ;

                Servers servers = habitat.getComponent(Servers.class ) ;
                fineLog( "IiopFolbGmsClient: servers {0}", servers );

                nodes = habitat.getComponent(Nodes.class) ;
                fineLog( "IiopFolbGmsClient: nodes {0}", nodes );

                String instanceName = gmsAdapter.getModule().getInstanceName() ;
                fineLog( "IiopFolbGmsClient: instanceName {0}", instanceName );

                myServer = servers.getServer(instanceName) ;
                fineLog( "IiopFolbGmsClient: myServer {0}", myServer );

                gis = new GroupInfoServiceGMSImpl() ;
                fineLog("IiopFolbGmsClient: IIOP GIS created");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.