Package com.sun.enterprise.config.serverbeans

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


     * @param resource a resource object (eg. AdminObjectResource)
     * @exception Exception thrown if fail
     */
    public synchronized void deployResource(Object resource) throws Exception {

        final AdminObjectResource aor =
           (com.sun.enterprise.config.serverbeans.AdminObjectResource)resource;
        final ConnectorRuntime crt = ConnectorRuntime.getRuntime();
       
        if (aor.isEnabled()) {
            //registers the jsr77 object for the mail resource deployed
            final ManagementObjectManager mgr =
                getAppServerSwitchObject().getManagementObjectManager();
            mgr.registerAdminObjectResource(aor.getJndiName(),
                aor.getResAdapter(), aor.getResType(),
                getPropNamesAsStrArr(aor.getElementProperty()),
                getPropValuesAsStrArr(aor.getElementProperty()));
        } else {
                _logger.log(Level.INFO, "core.resource_disabled",
                        new Object[] {aor.getJndiName(),
                        IASJ2EEResourceFactoryImpl.JMS_RES_TYPE});
        }
       
        _logger.log(Level.FINE,
            "Calling backend to add adminObject",aor.getJndiName());
        crt.addAdminObject(null,aor.getResAdapter(),aor.getJndiName(),
                aor.getResType(),transformProps(aor.getElementProperty()));
        _logger.log(Level.FINE,
            "Added adminObject in backend",aor.getJndiName());
    }
View Full Code Here


     *d
     */
    public synchronized void undeployResource(Object resource)
                        throws Exception {

        final AdminObjectResource aor =
           (com.sun.enterprise.config.serverbeans.AdminObjectResource)resource;
        final ConnectorRuntime crt = ConnectorRuntime.getRuntime();
       
        _logger.log(Level.FINE,
                   "Calling backend to delete adminObject",aor.getJndiName());
        crt.deleteAdminObject(aor.getJndiName());
        _logger.log(Level.FINE,
                   "Deleted adminObject in backend",aor.getJndiName());
       
        //unregister the managed object
        final ManagementObjectManager mgr =
                getAppServerSwitchObject().getManagementObjectManager();
        mgr.unregisterAdminObjectResource(aor.getJndiName(), aor.getResType());

    }
View Full Code Here

        if(cce.getChoice().equals(StaticTest.UPDATE)) {
            try {
                ConfigContext context = cce.getConfigContext();
                String name = cce.getName();
                String value = (String) cce.getObject();
                AdminObjectResource admin = (AdminObjectResource)cce.getClassObject();
                validateAttribute(name, value,  admin, result);
            } catch(Exception e) {
                _logger.log(Level.FINE, "domainxmlverifier.exception", e);
            }
        }
       
        if(cce.getChoice().equals(StaticTest.ADD) || cce.getChoice().equals(StaticTest.VALIDATE)) {
            try {
                ConfigContext context = cce.getConfigContext();
                Object value = cce.getObject();
                AdminObjectResource admin = (AdminObjectResource)value;
                validateAttribute(ServerTags.RES_TYPE, admin.getResType(),  admin, result);
            } catch(Exception e) {
                _logger.log(Level.FINE, "domainxmlverifier.exception", e);
            }
        }
        return result;
View Full Code Here

        if(resourceType == null){
          try{
            //list all JMS resources
            for (Object r :  adminObjectResources) {
               AdminObjectResource adminObject = (AdminObjectResource) r;
               if (JMSRA.equalsIgnoreCase(adminObject.getResAdapter()))
              //if(QUEUE.equals(r.getResType()) || TOPIC.equals(r.getResType()))
                list.add(adminObject.getJndiName());
            }

            for (Object c: connectorResources) {
                ConnectorResource cr = (ConnectorResource) c;
                ConnectorConnectionPool cp = (ConnectorConnectionPool) domain.getResources().getResourceByName(ConnectorConnectionPool.class, cr.getPoolName());

                if (cp  != null && JMSRA.equalsIgnoreCase(cp.getResourceAdapterName())){
                      list.add(cr.getJndiName());
                }
               //if(QUEUE_CF.equals(cp.getConnectionDefinitionName()) || TOPIC_CF.equals(cp.getConnectionDefinitionName())
                 //      || UNIFIED_CF.equals(cp.getConnectionDefinitionName()))

            }
            if (list.isEmpty()) {
                final ActionReport.MessagePart part = report.getTopMessagePart().addChild();
                part.setMessage(localStrings.getLocalString("nothingToList",
                    "Nothing to list."));
                extraProperties.put("jmsResources", list);
            } else {

               List <String> resourceList = null;
         //if("domain".equalsIgnoreCase(target))
    if(CommandTarget.DOMAIN.isValid(habitat, target))
      resourceList=list;
         else 
                   resourceList = filterListForTarget(list);
               if(resourceList == null)
                    resourceList = list;


                for (String jndiName : resourceList) {
                    final ActionReport.MessagePart part = report.getTopMessagePart().addChild();
                    part.setMessage(jndiName);
                }
                extraProperties.put("jmsResources", resourceList);
            }
            report.setExtraProperties(extraProperties);
        } catch (Exception e) {
            report.setMessage(localStrings.getLocalString("list.jms.resources.fail",
                    "Unable to list JMS Resources") + " " + e.getLocalizedMessage());
            report.setActionExitCode(ActionReport.ExitCode.FAILURE);
            report.setFailureCause(e);
            return;
        }
      } else {
          if(resourceType.equals(TOPIC_CF) || resourceType.equals(QUEUE_CF) || resourceType.equals(UNIFIED_CF)){


            for (Object c : connectorResources) {
               ConnectorResource cr = (ConnectorResource)c;
               ConnectorConnectionPool cp = (ConnectorConnectionPool) domain.getResources().getResourceByName(ConnectorConnectionPool.class, cr.getPoolName());
               if(cp != null && resourceType.equals(cp.getConnectionDefinitionName()) && JMSRA.equalsIgnoreCase(cp.getResourceAdapterName()))
                    list.add(cp.getName());
            }
          }  else if (resourceType.equals(TOPIC) || resourceType.equals(QUEUE))
          {
                for (Object r : adminObjectResources) {
                    AdminObjectResource res = (AdminObjectResource)r;
                    if(resourceType.equals(res.getResType()))
                        list.add(res.getJndiName());
            }

          }

View Full Code Here

    /**
     * {@inheritDoc}
     */
    public synchronized void undeployResource(Object resource)
            throws Exception {
        final AdminObjectResource aor = (AdminObjectResource) resource;
        ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(aor);
        deleteAdminObjectResource(aor, resourceInfo);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public synchronized void deployResource(Object resource, String applicationName, String moduleName) throws Exception {
        final AdminObjectResource aor = (AdminObjectResource) resource;
        String jndiName = aor.getJndiName();
        ResourceInfo resourceInfo = new ResourceInfo(jndiName, applicationName, moduleName);
        createAdminObjectResource(aor, resourceInfo);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public synchronized void deployResource(Object resource) throws Exception {

        final AdminObjectResource aor = (AdminObjectResource) resource;
        ResourceInfo resourceInfo = ConnectorsUtil.getResourceInfo(aor);
        createAdminObjectResource(aor, resourceInfo);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void undeployResource(Object resource, String applicationName, String moduleName) throws Exception{
        final AdminObjectResource aor = (AdminObjectResource) resource;
        ResourceInfo resourceInfo = new ResourceInfo(aor.getJndiName(), applicationName, moduleName);
        deleteAdminObjectResource(aor, resourceInfo);
    }
View Full Code Here

TOP

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

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.