Package com.sun.enterprise.config.serverbeans

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


   
        // let's get our admin context
        ConfigContext cc = ApplicationServer.getServerContext().getConfigContext();
        Server server = ServerBeansFactory.getServerBean(cc);
        Config config = ServerBeansFactory.getConfigBean(cc);
        ApplicationRef ref = server.getApplicationRefByRef(moduleID);
        return(getWebServerInfo(cc, config, ref.getVirtualServers(), null, null));
    }
View Full Code Here


        String objName = null;
        String cascadedObjName = null;
        if (mBeanName != null) {
            try {
                Domain domain = ServerBeansFactory.getDomainBean(configCtx);
                ApplicationRef appRef = verifyMBean(mBeanName, domain);
                if (appRef != null) {
                    Applications apps = domain.getApplications();
                    Mbean definedMBean = apps.getMbeanByName(mBeanName);
                    if(definedMBean != null) {
                        objName = definedMBean.getObjectName();
View Full Code Here

            throw new RuntimeException(e);
        }
    }*/
    private static ApplicationRef verifyMBean(String mBeanName, Domain domain) {
        ApplicationRef appRef = null;
       
        try {
            Server instanceBean = ServerBeansFactory.getServerBean(configCtx);
            appRef = instanceBean.getApplicationRefByRef(mBeanName);
                                                                                                                                              
View Full Code Here

                ConfigBean app = ApplicationHelper.findApplication(
                          configManager.getConfigContext(), moduleName);

                Server server = ServerBeansFactory.getServerBean(
                                   configManager.getConfigContext());
                ApplicationRef appRef = server.getApplicationRefByRef(moduleName);
                if (appRef == null) {
                    return true;
                } else {
                    modLoader = (ExtensionModuleLoader)getLoader(moduleName);
                }
View Full Code Here

        ConfigContext configContext = module.getConfigContext();
        String name = module.getAttributeValue(ServerTags.NAME);
        Server [] servers = ServerHelper.getServersReferencingApplication(configContext, name);
        Cluster [] clusters = ClusterHelper.getClustersReferencingApplication(configContext, name);
        for (Server s : servers) {
            ApplicationRef ref = s.getApplicationRefByRef(name);
            s.removeApplicationRef(ref);
        }
        for (Cluster c : clusters) {
            ApplicationRef ref = c.getApplicationRefByRef(name);
            c.removeApplicationRef(ref);
        }
    }
View Full Code Here

     * such be aware that bugs fixed here should be fixed there as well.
     */       
    private void addApplicationReferenceToCluster(Cluster cluster, boolean enabled,
        String virtualServers, String referenceName) throws ConfigException
    {
        ApplicationRef ref = cluster.getApplicationRefByRef(referenceName);
        if (ref != null) {
            //Application ref already exists in cluster        
            throw new ConfigException(_strMgr.getString("clusterApplicationRefAlreadyExists",
                referenceName, cluster.getName()));    
        }
        ref = new ApplicationRef();
        ref.setEnabled(enabled);
        ref.setRef(referenceName);
        ref.setVirtualServers(virtualServers);
        cluster.addApplicationRef(ref, BaseConfigMBean.OVERWRITE);       
    }
View Full Code Here

     */        
    private void addApplicationReferenceToClusteredServers(Cluster cluster, Server[] servers, boolean enabled,
        String virtualServers, String referenceName) throws ConfigException
    {
        for (int i = 0; i < servers.length; i++) {
            final ApplicationRef ref = servers[i].getApplicationRefByRef(referenceName);
            if (ref != null) {
                //This indicates that the cluster is in an inconsistent state. Some of the
                //instances in the cluster have the ref and some do not.
                throw new ConfigException(_strMgr.getString("clusterApplicationRefInconsistency",
                    referenceName, cluster.getName(), servers[i].getName()));
View Full Code Here

     * such be aware that bugs fixed here should be fixed there as well.
     */        
    private void addApplicationReferenceToServer(Server server, boolean enabled,
        String virtualServers, String referenceName) throws ConfigException
    {       
        ApplicationRef ref = server.getApplicationRefByRef(referenceName);
        if (ref != null) {
            //Resource ref already exists in server        
            throw new ConfigException(_strMgr.getString("serverApplicationRefAlreadyExists",
                referenceName, server.getName()));        
        }
        ref = new ApplicationRef();
        ref.setEnabled(enabled);
        ref.setRef(referenceName);
        ref.setVirtualServers(virtualServers);
        server.addApplicationRef(ref, BaseConfigMBean.OVERWRITE);       
    }
View Full Code Here

     * such be aware that bugs fixed here should be fixed there as well.
     */        
    private void deleteApplicationReferenceFromCluster(Cluster cluster,
        String referenceName) throws ConfigException
    {
        final ApplicationRef ref = cluster.getApplicationRefByRef(referenceName);
        if (ref == null) {
            //Application ref already exists in cluster        
            throw new ConfigException(_strMgr.getString("clusterApplicationRefDoesNotExist",
                cluster.getName(), referenceName));    
        }
View Full Code Here

     */        
    private void deleteApplicationReferenceFromClusteredServers(Cluster cluster, Server[] servers,
        String referenceName) throws ConfigException
    {
        for (int i = 0; i < servers.length; i++) {
            final ApplicationRef ref = servers[i].getApplicationRefByRef(referenceName);
            if (ref == null) {
                //This indicates that the cluster is in an inconsistent state. Some of the
                //instances in the cluster have the ref and some do not.
                throw new ConfigException(_strMgr.getString("clusterApplicationRefInconsistency",
                    referenceName, cluster.getName(), servers[i].getName()));
View Full Code Here

TOP

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

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.