Package com.sun.enterprise.config

Examples of com.sun.enterprise.config.ConfigBean


    // used when adding app/module to config
    public static void addToConfig(DeploymentRequest request)
        throws IASDeploymentException {
        try {
            ConfigBean newApp = createNewModule(request.getType());
            DeployableObjectType type = request.getType();
           
            AttributeList attrList = populateAttributeList(request);
            for (Object obj : attrList) {
                Attribute attr = (Attribute) obj;
                newApp.setAttributeValue(attr.getName(), (String) attr.getValue());
            }
           
            setPropertyOnAppBean(newApp, request);

            addModule(request.getType(), newApp);
View Full Code Here


    // used when updating config
    public static void updateConfig(DeploymentRequest request)
        throws IASDeploymentException {
        try {
            String name = request.getName();
            ConfigBean appBean =
                    ApplicationHelper.findApplication(getConfigContext(), name);
            if (appBean != null) {
                for (Iterator itr = populateAttributeList(request).iterator();
                     itr.hasNext();) {
                    Attribute attr = (Attribute)itr.next();
                    appBean.setAttributeValue(attr.getName(),
                                              (String)attr.getValue());
               
                setPropertyOnAppBean(appBean, request);

                getConfigContext().flush();
View Full Code Here

    // used when removing app/module to config
    public static void removeFromConfig(String name, DeployableObjectType type)
        throws IASDeploymentException {
        try {
            ConfigBean module = getModule(name, type);
            if (module != null) {
                removeModule(type, module);
                getConfigContext().flush();
                getConfigContext().resetConfigChangeList();
            }
View Full Code Here

    }

    public static boolean isExternallyManagedApp(String appName,
        DeployableObjectType type) throws IASDeploymentException {
        try {
            ConfigBean appBean = getModule(appName, type);
            if (appBean != null) {
                ElementProperty extManagedProperty = null;
                if (appBean instanceof J2eeApplication) {
                    J2eeApplication app = (J2eeApplication) appBean;
                    extManagedProperty =
View Full Code Here

    }

    public static boolean isRegistered(String appName,
               DeployableObjectType type) throws IASDeploymentException {
        try {
            ConfigBean module = getModule(appName, type);
            return (module != null);
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

     *Creates a new instance of the specified module type.
     *@param type the DeployableObjectType to be instantiated
     *@return a ConfigBean subclass instance of the appropriate type
     */
    private static ConfigBean createNewModule(DeployableObjectType type) {
        ConfigBean result = null;
        if (type.equals(DeployableObjectType.APP)) {
            result = new J2eeApplication();
        } else if (type.equals(DeployableObjectType.CAR)) {
            result = new AppclientModule();
        } else if (type.equals(DeployableObjectType.CONN)) {
View Full Code Here

     *@param appID the module ID
     *@param type the DeployableObjectType indicating the type of module of interest
     *@return the requested module as an instance of the appropriate subclass of ConfigBean
     */
    private static ConfigBean getModule(String appID, DeployableObjectType type) throws ConfigException {
        ConfigBean module = ApplicationHelper.findApplication(getConfigContext(), appID);
        if (module != null && type.equals(toDeployableObjectType(module))) {
            return module;
        } else {
            return null;
        }
View Full Code Here

       final ConfigContext cc) throws ConfigException {
       final Set<Resource> conflicts = new HashSet<Resource>();
       if (resSet != null) {
           for (final Resource res : resSet) {
               final String id = getIdToCompare(res);
               final ConfigBean sb = ResourceHelper.findResource(cc, id);
               if (sb != null) {
                   conflicts.add(res);
               }
           }
       }
View Full Code Here

             Iterator<Resource> iterRes = resList.iterator();
             StringBuffer conflictingResources = new StringBuffer();
             while (iterRes.hasNext()) {
                 Resource res = iterRes.next();
                 final String id = getIdToCompare(res);
                 final ConfigBean sb = ResourceHelper.findResource(configContext, id);
                 if (sb != null) {
                     conflictingResources.append("\n");
                     String message = localStrings.getString(
                             "conflict.resource.with.domain.xml",
                             getIdToCompare(res));
View Full Code Here

                while (iter.hasNext() )  {
                    Object change= iter.next();
                    if (change instanceof ConfigAdd || change instanceof ConfigUpdate) {
                        String xpath = ((ConfigChange)change).getXPath();
                        if( xpath != null){
                            ConfigBean item = newConfig.exactLookup(xpath);
                            if (item instanceof ElementProperty) {
                                ElementProperty elementProperty = (ElementProperty)item;
                                String loggerName  = elementProperty.getName();
                                loggerName = lef.getLoggerName(loggerName);
                                String logLevel    = elementProperty.getValue();
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.