Package com.sun.enterprise.connectors.util

Examples of com.sun.enterprise.connectors.util.ResourcesUtil


                    moduleName_);
      String i18nMsg = localStrings.getString(
          "ccp_adm.invalid_connector_desc", moduleName_);
            throw new ConnectorRuntimeException( i18nMsg );
        }
        ResourcesUtil resUtil = ResourcesUtil.createInstance();

        if(isServer() && !resUtil.belongToSystemRar(moduleName_)) {
            createAllConnectorResources();
        }
        _logger.log(Level.FINE,
    "Completed Active Resource adapter setup", moduleName_);
    }
View Full Code Here


    public void destroyActiveResourceAdapter(
        String moduleName,
        boolean cascade)
        throws ConnectorRuntimeException {

        ResourcesUtil resutil= ResourcesUtil.createInstance();
        if (resutil == null) {
            ConnectorRuntimeException cre=
                new ConnectorRuntimeException("Failed to get ResourcesUtil object");
            _logger.log(Level.SEVERE, "resourcesutil_get_failure", moduleName);
            _logger.log(Level.SEVERE, "", cre);
            throw cre;
        }
        Object[][] resources= null;
        try {
            resources= resutil.getAllConnectorResourcesForRar(moduleName, true);
        } catch (ConfigException ce) {
            ConnectorRuntimeException cre=
                new ConnectorRuntimeException("Failed to get Resources from domain.xml");
            ce.initCause(ce);
            _logger.log(
View Full Code Here

        }
       
        // If pool name contains more than 2 #, return false as the
        // default system pool will have exacly one # for a standalone rar
        // and exactly two #s for an embedded rar
        ResourcesUtil resUtil = ResourcesUtil.createInstance();
        switch (matchCount){
       
        case 1:
          if (resUtil.belongToStandAloneRar(moduleNameFromPoolName))
            return true;
        case 2:
          if (resUtil.belongToEmbeddedRar(moduleNameFromPoolName))
            return true;
        default:
          return false;
        }
    }
View Full Code Here

        try {
            InitialContext ic = new InitialContext();
            ic.unbind(jndiName);
        }
        catch(NamingException ne) {
            ResourcesUtil resutil = ResourcesUtil.createInstance();
            if(resutil.adminObjectBelongsToSystemRar(jndiName)) {
                return;
            }
            if(ne instanceof NameNotFoundException){
                _logger.log(Level.FINE,
                  "rardeployment.admin_object_delete_failure",jndiName);
View Full Code Here

          "ccp_adm.null_pool_name");
            throw new ConnectorRuntimeException( i18nMsg );
        }
        boolean errorOccured=false;
        ResourcesUtil resUtil = ResourcesUtil.createInstance();
        Object[] connectorResourcesJndiNames =
                        resUtil.getConnectorResourcesJndiNames(poolName);
        if(cascade==true && connectorResourcesJndiNames != null) {
           for(int i=0;i<connectorResourcesJndiNames.length;++i) {
               try {
                   getRuntime().deleteConnectorResource(
                              (String)connectorResourcesJndiNames[i]);
               } catch(ConnectorRuntimeException cre) {
                 errorOccured=true;
               }
           }

        } else if(connectorResourcesJndiNames != null &&
                      connectorResourcesJndiNames.length != 0) {

           // FIXME: ResourcesUtil class needs to change so that
           // it is reference friendly.
           // Refer to bug 5004451
           /*
      String i18nMsg = localStrings.getString(
          "ccp_adm.connector_res_exist");
            ConnectorRuntimeException cre = new
        ConnectorRuntimeException( i18nMsg );   
           _logger.log(Level.SEVERE,"rardeployment.resources_exist",
                                     poolName);
           _logger.log(Level.SEVERE,"",cre);
            throw cre;
            */
        }
        killPool(poolName);
        boolean result = _registry.removeManagedConnectionFactory(poolName);
        if(result == false && !resUtil.poolBelongsToSystemRar(poolName)) {
            _logger.log( Level.FINE,
                           "rardeployment.mcf_removal_failure",poolName);
      return;
        }
        try {
            String jndiNameForPool = ConnectorAdminServiceUtils.
                getReservePrefixedJNDINameForPool( poolName );
            InitialContext ic = new InitialContext();
            ic.unbind(jndiNameForPool);
        } catch(NamingException ne) {
            if(resUtil.poolBelongsToSystemRar(poolName)) {
                return;
            }
            _logger.log(Level.SEVERE,
                   "rardeployment.connectionpool_removal_from_jndi_error",
                   poolName);
      String i18nMsg = localStrings.getString(
          "ccp_adm.failed_to_remove_from_jndi", poolName);
      ConnectorRuntimeException cre = new
          ConnectorRuntimeException( i18nMsg )
            cre.initCause(ne);
            _logger.log(Level.SEVERE,"",cre);
      throw cre;
        }
        if(errorOccured==true && !resUtil.poolBelongsToSystemRar(poolName)) {
      String i18nMsg = localStrings.getString(
          "ccp_adm.failed_to_delete_conn_res", poolName);
      ConnectorRuntimeException cre = new
        ConnectorRuntimeException( i18nMsg );   
            _logger.log(Level.SEVERE,
View Full Code Here

     @moduleName Rar module Name
     */

    public void killAllPools(String moduleName) {

        ResourcesUtil resUtil = ResourcesUtil.createInstance();
        Object[] poolNamesArray = resUtil.getConnectorConnectionPoolNames(
                                           moduleName);
        String poolName=null;
        for(int i=0;poolNamesArray != null && i<poolNamesArray.length;i++) {
            poolName = (String)poolNamesArray[i];
            killPool(poolName);
View Full Code Here

    /** This method is used to find out if pool is linked to datasource or not
      * if pool is not linked then ping will not take changes to pool
      * dynamically.
      */
    private boolean isPoolReferedByDatabaseResource(String poolName){
        ResourcesUtil resUtil = ResourcesUtil.createInstance();
        try
        {
            return resUtil.isPoolReferredInServerInstance(poolName);

        } catch(ConfigException e) {
        }
        return false;
    }
View Full Code Here

        try {
            InitialContext ic = new InitialContext();
            ic.unbind(jndiName);
        } catch(NamingException ne) {
            ResourcesUtil resUtil = ResourcesUtil.createInstance();
            if(resUtil.resourceBelongsToSystemRar(jndiName)) {
                return;
            }
            if(ne instanceof  NameNotFoundException){
                _logger.log(Level.FINE,
                    "rardeployment.connectorresource_removal_from_jndi_error",
View Full Code Here

    public void setup() throws ConnectorRuntimeException {
        if(connectionDefs_ == null || connectionDefs_.length == 0) {
            return;
        }
        obtainServerXMLvalue();
        ResourcesUtil resUtil = ResourcesUtil.createInstance();

        if(isServer() && !resUtil.belongToSystemRar(moduleName_)) {
            createAllConnectorResources();
        }
    }
View Full Code Here

        //and its dependents
        resname = ConnectorAdminServiceUtils.getOriginalResourceName(resname);
        _logger.fine("ConnectorServiceImpl :: checkAndLoadResource resolved to " +
                "load " + resname);

        ResourcesUtil resutil = ResourcesUtil.createInstance();
        DeferredResourceConfig defResConfig = resutil.getDeferredResourceConfig(
                                        resname);
        return loadResourcesAndItsRar(defResConfig);
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.connectors.util.ResourcesUtil

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.