Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.AdminObject


        Set ddAdminObjects = desc.getAdminObjects();
        //merge DD and annotation values of admin-objects
        //merge involves simple union
        boolean ignore = false;
        for (Object o : ddAdminObjects) {
            AdminObject ddAdminObject = (AdminObject) o;
            if (ddAdminObject.getAdminObjectInterface().equals(adminObjectInterfaceName) &&
                    ddAdminObject.getAdminObjectClass().equals(adminObjectClassName)) {
                ignore = true;
                break;
            }
        }
        if (!ignore) {
            AdminObject ao = new AdminObject(adminObjectInterfaceName, adminObjectClassName);
            desc.addAdminObject(ao);
        }else{
            if(logger.isLoggable(Level.FINEST)){
                logger.log(Level.FINEST,"Ignoring administered object annotation " +
                        "[ "+adminObjectInterfaceName+"," + adminObjectClassName + "] as it is already defined ");
View Full Code Here


        ConnectorRegistry registry = ConnectorRegistry.getInstance();

        ConnectorDescriptor desc = registry.getDescriptor(connectorName);

        AdminObject aoDesc = null;
        // The admin-object can be identified by interface name, class name
        // or the combination of the both names.
        if(adminObjectClassName == null || adminObjectClassName.trim().equals("")){
            // get AO through interface name
            List<AdminObject> adminObjects =
                    desc.getAdminObjectsByType(adminObjectType);
            if(adminObjects.size() > 1){
                String msg = localStrings.getString("aor.could_not_determine_aor_type", adminObjectType);
                throw new ConnectorRuntimeException(msg);
            }else{
                aoDesc = adminObjects.get(0);
            }
        }else if(adminObjectType == null || adminObjectType.trim().equals("")){
          // get AO through class name
          List<AdminObject> adminObjects =
                  desc.getAdminObjectsByClass(adminObjectClassName);
          if(adminObjects.size() > 1){
              String msg = localStrings.getString("aor.could_not_determine_aor_class", adminObjectClassName);
              throw new ConnectorRuntimeException(msg);
          }else{
              aoDesc = adminObjects.get(0);
          }
        }else{
          // get AO through interface name and class name
          aoDesc = desc.getAdminObject(adminObjectType, adminObjectClassName);
        }
        if(aoDesc==null){
          String msg = localStrings.getString("aor.could_not_determine_aor", adminObjectType, adminObjectClassName);
          throw new ConnectorRuntimeException(msg);
        }

        AdministeredObjectResource aor = new AdministeredObjectResource(resourceInfo);
        aor.initialize(aoDesc);
        aor.setResourceAdapter(connectorName);

        Object[] envProps = aoDesc.getConfigProperties().toArray();

        //Add default config properties to aor
        //Override them if same config properties are provided by the user
        for (int i = 0; i < envProps.length; i++) {
            ConnectorConfigProperty  envProp = (ConnectorConfigProperty ) envProps[i];
View Full Code Here

        Set ddAdminObjects = desc.getAdminObjects();
        //merge DD and annotation values of admin-objects
        //merge involves simple union
        boolean ignore = false;
        for (Object o : ddAdminObjects) {
            AdminObject ddAdminObject = (AdminObject) o;
            if (ddAdminObject.getAdminObjectInterface().equals(adminObjectInterfaceName) &&
                    ddAdminObject.getAdminObjectClass().equals(adminObjectClassName)) {
                ignore = true;
                break;
            }
        }
        if (!ignore) {
            AdminObject ao = new AdminObject(adminObjectInterfaceName, adminObjectClassName);
            desc.addAdminObject(ao);
        }else{
            if(logger.isLoggable(Level.FINEST)){
                logger.log(Level.FINEST,"Ignoring administered object annotation " +
                        "[ "+adminObjectInterfaceName+"," + adminObjectClassName + "] as it is already defined ");
View Full Code Here

        ConnectorRegistry registry = ConnectorRegistry.getInstance();

        ConnectorDescriptor desc = registry.getDescriptor(connectorName);

        AdminObject aoDesc = null;
        if(adminObjectClassName == null){
            List<AdminObject> adminObjects =
                    desc.getAdminObjectsByType(adminObjectType);
            if(adminObjects.size() > 1){
                String msg = localStrings.getString("aor.could_not_determine_aor_type", adminObjectType);
                throw new ConnectorRuntimeException(msg);
            }else{
                aoDesc = adminObjects.get(0);
            }
        }else{
            aoDesc = desc.getAdminObject(adminObjectType, adminObjectClassName);
        }

        AdministeredObjectResource aor = new AdministeredObjectResource(resourceInfo);
        aor.initialize(aoDesc);
        aor.setResourceAdapter(connectorName);

        Object[] envProps = aoDesc.getConfigProperties().toArray();

        //Add default config properties to aor
        //Override them if same config properties are provided by the user
        for (int i = 0; i < envProps.length; i++) {
            ConnectorConfigProperty  envProp = (ConnectorConfigProperty ) envProps[i];
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.AdminObject

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.