Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigBean


     * @throws ConfigException if data in trancient property has wrong type
     */
    public static void resetAppContextRoots(ConfigContext ctx, String appName,
                        boolean bForceToSetActualValue) throws ConfigException, IASDeploymentException
    {
        ConfigBean appBean = ApplicationHelper.findApplication(ctx, appName);
        if(appBean==null)
        {
            throw new ConfigException(_strMgr.getString("applicationElementIsNotFoundForName", appName));
        }
        resetAppContextRoots(appBean, bForceToSetActualValue);
View Full Code Here


     *  inside of virtual servers.
     **/
    public static String checkContextRootUniqueness(ConfigContext ctx, String appId, String targetName, String virtualServerList)
        throws ConfigException, IASDeploymentException
    {
        ConfigBean appBean = ApplicationHelper.findApplication(ctx, appId);
        if(appBean==null)
        {
            throw new ConfigException(_strMgr.getString("applicationElementIsNotFoundForName", appId));
        }
       
        //get context roots for testing element
        String[] ctxRoots = getAppContextRoots(appBean);
        if(ctxRoots==null || ctxRoots.length<=0)
          return null;

        //create target by name
        final Target target = TargetBuilder.INSTANCE.createTarget(
            new TargetType[]{TargetType.CLUSTER, TargetType.SERVER, TargetType.DAS}, targetName, ctx);           
       
        //get apprefs for target
        ApplicationRef[] refs = null;
        if (target.getType() == TargetType.CLUSTER ||
            target.getType() == TargetType.STANDALONE_CLUSTER)
        {
            refs = ClusterHelper.getApplicationReferences(ctx, targetName);
        }
        else
        {
            refs = ServerHelper.getApplicationReferences(ctx, targetName);
        }
           
        if(refs==null)
            return null;
       
        for(int i=0; i<refs.length; i++)
        {
            if(isVSListsIntersected(refs[i].getVirtualServers(), virtualServerList))
            {
                ConfigBean appBeanToCompare = ApplicationHelper.findApplication(ctx, refs[i].getRef());
                if(appBeanToCompare==null)
                {
                    throw new ConfigException(_strMgr.getString("applicationElementIsNotFoundForName", refs[i].getRef()));
                }  
                if(((Object)appBeanToCompare)!=((Object)appBean))
View Full Code Here

    protected boolean isEnabled (ConfigContext config, String moduleName) {
        try {
            if (config == null) {
                config = AdminService.getAdminService().getAdminContext().getAdminConfigContext();
            }
            ConfigBean app = ApplicationHelper.findApplication(config,
                moduleName);
            Server server = ServerBeansFactory.getServerBean(config);
            ApplicationRef appRef = server.getApplicationRefByRef(moduleName);

            return ((app != null && app.isEnabled()) &&
                        (appRef != null && appRef.isEnabled()));
        } catch (ConfigException e) {
            _logger.log(Level.FINE, "Error in finding " + moduleName, e);

            //If there is anything wrong, do not enable the module
View Full Code Here

    }

    private String getUriInDomainConfig(String appId) {
            ConfigContext configCtx = AdminService.getAdminService().
                getAdminContext().getAdminConfigContext();
        ConfigBean cb = null;
       
        try {
            cb = ApplicationHelper.findApplication(configCtx, appId);
        } catch( Exception e) {
            //String msg = "Could not find a deployed application/module by name "
View Full Code Here

    // Retrieving the location attribute
    public static String getLocation(String appId, DeployableObjectType type)
        throws IASDeploymentException {
        try {
            ConfigBean module = getModule(appId, type);
            String location = module.getAttributeValue(ServerTags.LOCATION);
            return (new RelativePathResolver()).resolve(location);
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

    // Retrieving the enabled attribute
    public static boolean isEnabled(String appId, DeployableObjectType type)
        throws IASDeploymentException {
        try {
            ConfigBean module = getModule(appId, type);
            String enabled = module.getAttributeValue(ServerTags.ENABLED);
            return Boolean.valueOf(enabled).booleanValue();
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

    // Retrieving the directory-deployed attribute
    public static boolean isDirectoryDeployed(String appId,
        DeployableObjectType type) throws IASDeploymentException {
        try {
            ConfigBean module = getModule(appId, type);
            String[] attributeNames = module.getAttributeNames();
            for (String attributeName: attributeNames) {
                if (attributeName.equals(DIRECTORY_DEPLOYED_ATTR)) {
                    String directoryDeployed =
                        module.getAttributeValue(DIRECTORY_DEPLOYED_ATTR);
                    return Boolean.valueOf(directoryDeployed).booleanValue();
                }
            }

            return false;
View Full Code Here

        try {
            // appclient module does not have object type
            if (type.isCAR()) {
                return null;
            }
            ConfigBean module = getModule(appId, type);
            String objectType = module.getAttributeValue(ServerTags.OBJECT_TYPE);
            return objectType;
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

        // module is not in the registry - must have been undeployed
        if (modLoader == null) {
            // now lets check if its in the configContext
            try {
                ConfigBean app = ApplicationHelper.findApplication(
                          configManager.getConfigContext(), moduleName);

                Server server = ServerBeansFactory.getServerBean(
                                   configManager.getConfigContext());
                ApplicationRef appRef = server.getApplicationRefByRef(moduleName);
View Full Code Here

    // Set the context-root attribute
    public static void setContextRoot(String appId, DeployableObjectType type,
              String contextRoot) throws IASDeploymentException {
        try {
            if (contextRoot != null && contextRoot.length() > 0) {
                ConfigBean module = getModule(appId, type);
                module.setAttributeValue(ServerTags.CONTEXT_ROOT, contextRoot);
            }
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.config.ConfigBean

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.