Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.AdminObject


            throw new IllegalArgumentException(getClass() + " cannot handle descriptors of type " + descriptor.getClass());
        }

  //adminObject info
  for (Iterator adminObjects = ((ConnectorDescriptor)descriptor).getAdminObjects().iterator(); adminObjects.hasNext();) {
      AdminObject adminObject = (AdminObject) adminObjects.next();
      Node adminObjectNode = appendChild(parent, ConnectorTagNames.ADMIN_OBJECT);
      appendTextChild(adminObjectNode, ConnectorTagNames.ADMIN_OBJECT_INTERFACE, adminObject.getAdminObjectInterface());  
      appendTextChild(adminObjectNode, ConnectorTagNames.ADMIN_OBJECT_CLASS, adminObject.getAdminObjectClass())

      ConfigPropertyNode config = new ConfigPropertyNode();
      adminObjectNode = config.writeDescriptor(adminObjectNode, adminObject);
  }
View Full Code Here


    Set adminObjects = descriptor.getAdminObjects();
    boolean oneFailed = false;
    Iterator iter = adminObjects.iterator();
    while(iter.hasNext())
    {
      AdminObject adminObj = (AdminObject) iter.next();
      String intf = adminObj.getAdminObjectInterface();
      String impl = adminObj.getAdminObjectClass();
      Class implClass = null;
      try
      {
        implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
      }
View Full Code Here

    Set adminObjects = descriptor.getAdminObjects();
    boolean oneFailed = false;
    Iterator iter = adminObjects.iterator();
    while(iter.hasNext())
    {
      AdminObject adminObj = (AdminObject) iter.next();
      String impl = adminObj.getAdminObjectClass();
      Class implClass = null;
      try
      {
        implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
      }
View Full Code Here

    Set adminObjects = descriptor.getAdminObjects();
    boolean oneFailed = false;
    Iterator iter = adminObjects.iterator();
    while(iter.hasNext())
    {
      AdminObject adminObj = (AdminObject) iter.next();
      String impl = adminObj.getAdminObjectClass();
      Class implClass = null;
      try
      {
        implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
      }
      catch(ClassNotFoundException e)
      {
        result.addErrorDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
        result.failed(smh.getLocalString
            ("com.sun.enterprise.tools.verifier.tests.connector.admin.nonexist",
             "Error: The class [ {0} ] as defined under adminobject-class in the deployment descriptor does not exist",
             new Object[] {impl}));
        return result;
      }
      Set configProps = adminObj.getConfigProperties();
      Iterator propIter = configProps.iterator();
      BeanInfo bi = null;
      try
      {
        bi = Introspector.getBeanInfo(implClass, Object.class);
View Full Code Here

    Set adminObjects = descriptor.getAdminObjects();
    boolean oneFailed = false;
    Iterator iter = adminObjects.iterator();
    while(iter.hasNext())
    {
      AdminObject adminObj = (AdminObject) iter.next();
      String intf = adminObj.getAdminObjectInterface();
      String impl = adminObj.getAdminObjectClass();
      Class implClass = null;
      try
      {
        implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
      }
View Full Code Here

    Set adminObjects = descriptor.getAdminObjects();
    boolean oneFailed = false;
    Iterator iter = adminObjects.iterator();
    while(iter.hasNext())
    {
      AdminObject adminObj = (AdminObject) iter.next();
      String impl = adminObj.getAdminObjectClass();
      Class implClass = null;
      try
      {
        implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
      }
View Full Code Here

    Set adminObjects = descriptor.getAdminObjects();
    boolean oneFailed = false;
    Iterator iter = adminObjects.iterator();
    while(iter.hasNext())
    {
      AdminObject adminObj = (AdminObject) iter.next();
      String impl = adminObj.getAdminObjectClass();
      Class implClass = null;
      try
      {
        implClass = Class.forName(impl, false, getVerifierContext().getClassLoader());
      }
      catch(ClassNotFoundException e)
      {
        result.addErrorDetails(smh.getLocalString
            ("tests.componentNameConstructor",
             "For [ {0} ]",
             new Object[] {compName.toString()}));
        result.failed(smh.getLocalString
            ("com.sun.enterprise.tools.verifier.tests.connector.admin.nonexist",
             "Error: The class [ {0} ] as defined under adminobject-class in the deployment descriptor does not exist",
             new Object[] {impl}));
        return result;
      }
      Set configProps = adminObj.getConfigProperties();
      Iterator propIter = configProps.iterator();
      BeanInfo bi = null;
      try
      {
        bi = Introspector.getBeanInfo(implClass, Object.class);
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;
        // 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

        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.