Package com.sun.enterprise.config.serverbeans

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


    private String getDefaultTarget() throws AutoDeploymentException {
        try{
            ConfigContext confContext = getConfigContext();
            Domain domain = (Domain)confContext.getRootConfigBean();
            Servers svrs = domain.getServers();
            Server[] svrArr = svrs.getServer();
            int size = svrArr.length;
            String targetName = null;
            /*I am putting this logic specific for TP, as its decided to deploy directly
             *to instsnce, and not DAS. It need to be changed to next release
             */
 
View Full Code Here


    private String[] getTargets(){
        try{
            ConfigContext confContext = _context.getConfigContext();
            Domain domain = (Domain)confContext.getRootConfigBean();
            Servers svrs = domain.getServers();
            Server[] svrArr = svrs.getServer();
            int size = svrArr.length;
            String[] targetNames = new String[size];
            for(int i = 0 ; i< size; i++) {
               targetNames[i] = svrArr[i].getName();
            }
View Full Code Here

                validateUpdate(cce, result);
            } else if (choice.equals(StaticTest.ADD)){
                validateAdd(cce, result);
            } else if(choice.equals(StaticTest.VALIDATE)) {
                Domain domain = (Domain)cce.getConfigContext().getRootConfigBean();
                Servers servers = domain.getServers();
                Server[] server = servers.getServer();
                    String svrName = server[0].getName();
                    if(!server[0].getName().equals("server"))
                        result.failed(smh.getLocalString(getClass().getName() + ".invalidserverName",
                                                         "Invalid Server Name {0}: Required 'server'", new Object[]{svrName}));
            }
View Full Code Here

                checkDuplicate("audit-module", securityservice.getAuditModule(), "name");
                checkDuplicate("auth-realm", securityservice.getAuthRealm(), "name");
                checkDuplicate("jacc-provider", securityservice.getJaccProvider(), "name");
            }

            Servers servers = domain.getServers();
            checkDuplicate("server", servers.getServer(), "name");
           
        } catch(Exception e) {
            e.printStackTrace();
        }
View Full Code Here

     * @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

                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

            }           
           
            //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

                    "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

 
    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

                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

TOP

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

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.