Package com.sun.enterprise.config.serverbeans

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


        // Next, make properties of this jacc provider available to provider

        int propCount = jacc.sizeElementProperty();
        for (int i=0; i<propCount; i++) {

            ElementProperty p = jacc.getElementProperty(i);
            String name = POLICY_PROP_PREFIX + p.getName();
            String value = p.getValue();
            _logger.finest("PolicyLoader set ["+name+"] to ["+value+"]");
            System.setProperty(name, value);
        }

    }
View Full Code Here


        if (vsBean != null) {

            state = vsBean.getState();

            ElementProperty prop = null;

            //Begin EE: 4920692 Make the default-web.xml be relocatable
            prop = vsBean.getElementPropertyByName("default-web-xml");
            if (prop != null) {
                defaultWebXmlLocation = prop.getValue();
            }
            //End EE: 4920692 Make the default-web.xml be relocatable

            // allowLinking
            prop = vsBean.getElementPropertyByName("allowLinking");
            if (prop != null) {
                allowLinking = ConfigBean.toBoolean(prop.getValue());
            }

            prop = vsBean.getElementPropertyByName("contextXmlDefault");
            if (prop != null) {
                defaultContextXmlLocation = prop.getValue();
            }

        }

        vs.setDefaultWebXmlLocation(defaultWebXmlLocation);
View Full Code Here

    }

    public static void setPropertyOnAppBean(ConfigBean appBean,
        DeploymentRequest request) throws ConfigException {
        if (request.isExternallyManagedApp()) {
            ElementProperty extManagedProperty = new ElementProperty();
            extManagedProperty.setName(EXTERNALLY_MANAGED);
            extManagedProperty.setValue("true");
            if (appBean instanceof J2eeApplication) {
                J2eeApplication app = (J2eeApplication) appBean;
                app.addElementProperty(extManagedProperty);
            } else if (appBean instanceof EjbModule) {
                EjbModule app = (EjbModule) appBean;
                app.addElementProperty(extManagedProperty);
            } else if (appBean instanceof WebModule) {
                WebModule app = (WebModule) appBean;
                app.addElementProperty(extManagedProperty);
            } else if (appBean instanceof AppclientModule) {
                AppclientModule app = (AppclientModule) appBean;
                app.addElementProperty(extManagedProperty);
            } else if (appBean instanceof ConnectorModule) {
                ConnectorModule app = (ConnectorModule) appBean;
                app.addElementProperty(extManagedProperty);
            }
        }
       
        // Set the context root on the extension module as a property
        if(appBean instanceof ExtensionModule) {
           
            ExtensionModule extApp = (ExtensionModule) appBean;
           
            ElementProperty isConvergedProperty = new ElementProperty();
            isConvergedProperty.setName(IS_CONVERGED);
           
            ElementProperty contextRootProperty = new ElementProperty();
            contextRootProperty.setName(CONTEXT_ROOT);
           
            Properties props = request.getOptionalArguments();

            /*
             * The (name=value)[:name=value]* of the property option is
             * converted to ElementProperty here.
             */
            Map<String, String> propMap = (Map) props.get("property");
            if(propMap != null) {
                ArrayList list = new ArrayList();
                for (Iterator<String> itr = propMap.keySet().iterator(); itr.hasNext();) {
                    String key = itr.next();
                    ElementProperty property = new ElementProperty();
                    property.setName(key);
                    property.setValue(propMap.get(key));
                    list.add(property);
                }

                ElementProperty[] eProp = (ElementProperty[]) list.toArray(new ElementProperty[list.size()]);
                extApp.setElementProperty(eProp);
            }

            String value = props.getProperty("isConverged");
            if(value != null ) {
                if("true".equals(value)) {
                    isConvergedProperty.setValue("true");
                    // Check if context root is explictily set
                    if(request.getContextRoot() != null) {
                        contextRootProperty.setValue(request.getContextRoot());
                    } else {
                        contextRootProperty.setValue(
                            request.getDefaultContextRoot());
                    }
                    if(extApp.getElementPropertyByName("isConverged") != null ) {
                        extApp.removeElementProperty(
                               extApp.getElementPropertyByName("isConverged"));
                    }
                    if(extApp.getElementPropertyByName("contextRoot") != null) {
                         extApp.removeElementProperty(
                                extApp.getElementPropertyByName("contextRoot"));
                    }
                    extApp.addElementProperty(isConvergedProperty, true);
                    extApp.addElementProperty(contextRootProperty, true );
                } else {
                    isConvergedProperty.setValue("false");
                    if(extApp.getElementPropertyByName("isConverged") != null ) {
                        extApp.removeElementProperty(
                            extApp.getElementPropertyByName("isConverged"));
                    }
                    extApp.addElementProperty(isConvergedProperty);               
                }
            }
        }
       
        // now see if there is a property added for j2ee-applications
        if(appBean instanceof J2eeApplication) {
            Properties props = request.getOptionalArguments();
            if(props.containsKey("isConverged")) {
                ElementProperty isConvergedAppProp = new ElementProperty();
                isConvergedAppProp.setName(IS_CONVERGED);
                isConvergedAppProp.setValue("true");
                if(((J2eeApplication)appBean).getElementPropertyByName("isConverged") != null ) {
                        ((J2eeApplication)appBean).removeElementProperty(
                            ((J2eeApplication)appBean).getElementPropertyByName("isConverged"));
                }
           
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 =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                } else if (appBean instanceof EjbModule) {
                    EjbModule app = (EjbModule) appBean;
                    extManagedProperty =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                } else if (appBean instanceof WebModule) {
                    WebModule app = (WebModule) appBean;
                    extManagedProperty =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                } else if (appBean instanceof AppclientModule) {
                    AppclientModule app = (AppclientModule) appBean;
                    extManagedProperty =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                } else if (appBean instanceof ConnectorModule) {
                    ConnectorModule app = (ConnectorModule) appBean;
                    extManagedProperty =
                        app.getElementPropertyByName(EXTERNALLY_MANAGED);
                }
                                                                               
                if (extManagedProperty != null) {
                    return Boolean.valueOf(
                        extManagedProperty.getValue()).booleanValue();
                } else {
                    return false;
                }
            } else {
                return false;
View Full Code Here

        if ( elemProps == null ) {
            return false;
        }

        for( int i =0; i < elemProps.length; i++ ) {
            ElementProperty ep = elemProps[i];
            if (ep.getName().equalsIgnoreCase("UserName") ||
                ep.getName().equalsIgnoreCase("User") ||
                ep.getName().equalsIgnoreCase("Password")) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

        if( properties == null ) return;
        Method[] methods = null;
        try {
            methods = getDeclaredMethods( o.getClass( ) );
            for( int i = 0; i < properties.length; i++ ) {
                ElementProperty property = properties[i];
                String propertyName = property.getName( ).toLowerCase( );
                String propertyValue = property.getValue( );
                for( int j = 0; j < methods.length; j++ ) {
                    String methodName = methods[j].getName().toLowerCase();
                    if ( ( methodName.startsWith( "set" ) )
                       && ( methodName.endsWith( propertyName ) ) )
                    {
View Full Code Here

        if( properties == null ) return;
        Method[] methods = null;
        try {
            methods = getDeclaredMethods( o.getClass( ) );
            for( int i = 0; i < properties.length; i++ ) {
                ElementProperty property = properties[i];
                String propertyName = property.getName( ).toLowerCase( );
                String propertyValue = property.getValue( );
                for( int j = 0; j < methods.length; j++ ) {
                    String methodName = methods[j].getName().toLowerCase();
                    if ( ( methodName.startsWith( "set" ) )
                       && ( methodName.endsWith( propertyName ) ) )
                    {
View Full Code Here

   
    public Event instrumentEvent(
            ElementProperty[] properties, String description ) {
        String eventName = null;
        for( int i = 0; i < properties.length; i++ ){
            ElementProperty property = properties[i];
            String propertyName = property.getName( ).toLowerCase( );
            if( propertyName.equals(PROPERTY_LIFECYCLE_NAME)) {
                eventName = "lifecycle." + property.getValue( ).toLowerCase( );
                if (!LifeCycleEvent.isValidType(eventName))
                    throw new IllegalArgumentException(
                            sm.getString("name","selfmgmt_event.invalid_event_property","lifecycle"));
            }
        }
View Full Code Here

                    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();
                                boolean logExists = LogMBean.getInstance().findLogger(loggerName);
                                if (!logExists) {
                                    Logger.getLogger(loggerName)//if the logger doesn't exist, create it.
        }       
                                LogMBean.getInstance().setLogLevel( loggerName, logLevel );
View Full Code Here

        // sourcembean
        //String sourceMbean = null;
        String sourceMbeanObjName = null;
        String sourceMbeanName = null;
        for( int i = 0; i < properties.length; i++ ){
            ElementProperty property = properties[i];
            String propertyName = property.getName( ).toLowerCase( );
            if (propertyName.equals(PROPERTY_NOTIFICATION_SOURCE_OBJ_NAME)) {
                sourceMbeanObjName = property.getValue();
            } else if (propertyName.equals(PROPERTY_NOTIFICATION_SOURCEMBEAN)) {
                sourceMbeanName = property.getValue();
            }
        }
        if (sourceMbeanName ==  null && sourceMbeanObjName == null) {
            throw new IllegalArgumentException(
                    sm.getString("selfmgmt_event.invalid_event_property","sourceMBean","notification"));
View Full Code Here

TOP

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

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.