/** * uninitializes the resource adapter. It also destroys the default pools * and resources */ public void destroy() { if (isServer()) { destroyAllConnectorResources(); } }
/** * Deletes both the default connector connection pools and resources */ protected void destroyAllConnectorResources() { if (!(isSystemRar(moduleName_))) { deleteDefaultConnectorResources(); deleteDefaultConnectorConnectionPools(); // Added to ensure clean-up of the Sun RA connection pool if (desc_.getSunDescriptor() != null && desc_.getSunDescriptor().getResourceAdapter() != null) { // sun-ra.xml exists String jndiName = (String) desc_.getSunDescriptor(). getResourceAdapter().getValue(ResourceAdapter.JNDI_NAME); if (jndiName == null || jndiName.equals("")) { // jndiName is empty, sunRA pool not created, so don't need to delete } else { // jndiName is not empty, need to delete pool deleteSunRAConnectionPool(); } } } }
/** * It initializes the resource adapter. It also creates the default pools * and resources of all the connection definitions. * * @throws ConnectorRuntimeException This exception is thrown if the * ra.xml is invalid or the default pools and resources couldn't * be created */ public void setup() throws ConnectorRuntimeException { if (connectionDefs_ == null || connectionDefs_.length != 1) { _logger.log(Level.SEVERE, "rardeployment.invalid_connector_desc", moduleName_); String i18nMsg = localStrings.getString("ccp_adm.invalid_connector_desc", moduleName_); throw new ConnectorRuntimeException(i18nMsg); } if (isServer() && !isSystemRar(moduleName_)) { createAllConnectorResources(); } if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Completed Active Resource adapter setup", moduleName_); } }
createDefaultConnectorConnectionPools(true); } else { createSunRAConnectionPool(); createDefaultConnectorConnectionPools(false); createDefaultConnectorConnectionPools(false); createDefaultConnectorResources(); } catch (ConnectorRuntimeException cre) {
/** * Destroys default pools and resources. Stops the Resource adapter * java bean. */ public void destroy() { //it is possible that a 1.5 ra may not have connection-definition at all if ((connectionDefs_ != null) && (connectionDefs_.length != 0)) { super.destroy(); } stopResourceAdapter(); }
/** * Creates an instance of <code>ManagedConnectionFactory</code> * object using the connection pool properties. Also set the * <code>ResourceAdapterAssociation</code> * * @param pool <code>ConnectorConnectionPool</code> properties. * @param jcl <code>ClassLoader</code> */ public ManagedConnectionFactory createManagedConnectionFactory( ConnectorConnectionPool pool, ClassLoader jcl) { ManagedConnectionFactory mcf; mcf = super.createManagedConnectionFactory(pool, jcl); if (mcf instanceof ResourceAdapterAssociation) { try { ((ResourceAdapterAssociation) mcf).setResourceAdapter(this.resourceadapter_); } catch (ResourceException ex) { _logger.log(Level.SEVERE, "rardeployment.assoc_failed", ex); } } return mcf; }