/** * Does the necessary initial setup. Creates the default pool and * resource. * * @throws ConnectorRuntimeException If there is a failure */ public void setup() throws ConnectorRuntimeException { if (connectionDefs_ == null || connectionDefs_.length == 0) { return; } if (isServer() && !isSystemRar(moduleName_)) { createAllConnectorResources(); } if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Completed Active Resource adapter setup", moduleName_); } }
/** * Destroys default pools and resources. Stops the Resource adapter * java bean. */ public void destroy() { deactivateEndPoints(); super.destroy(); }
private void stopResourceAdapter() { if (resourceadapter_ != null) { try { if(_logger.isLoggable(Level.FINE)) { _logger.fine("Calling Resource Adapter stop" + this.getModuleName()); } resourceadapter_.stop(); if(_logger.isLoggable(Level.FINE)){ _logger.fine("Resource Adapter stop call of " + this.getModuleName() + " returned successfully"); _logger.fine("rar_stop_call_successful"); } } catch (Throwable t) { _logger.log(Level.SEVERE, "rardeployment.stop_warning", t); } finally { //not needed when there is no ResourceAdapter instance (implementation) removeProxiesFromRegistry(moduleName_); } } }
if (resourceadapter_ != null) { try { loadRAConfiguration(); validateWorkContextSupport(desc); startResourceAdapter(bootStrapContextImpl);
/** * Loads RA javabean. This method is protected, so that any system * resource adapter can have specific configuration done during the * loading. * * @throws ConnectorRuntimeException if there is a failure. */ protected void loadRAConfiguration() throws ConnectorRuntimeException { try { Set mergedProps; ConnectorRegistry registry = ConnectorRegistry.getInstance(); ResourceAdapterConfig raConfig = registry.getResourceAdapterConfig(moduleName_); List<Property> raConfigProps = new ArrayList<Property>(); mergedProps = mergeRAConfiguration(raConfig, raConfigProps); logMergedProperties(mergedProps); SetMethodAction setMethodAction = new SetMethodAction(this.resourceadapter_, mergedProps); setMethodAction.run(); } catch (Exception e) { String i18nMsg = localStrings.getString("ccp_adm.wrong_params_for_create", e.getMessage()); ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg); cre.initCause(e); throw cre; } }
/** * Creates an active inbound resource adapter. Sets all RA java bean * properties and issues a start. * * @param ra <code>ResourceAdapter<code> java bean. * @param desc <code>ConnectorDescriptor</code> object. * @param moduleName Resource adapter module name. * @param jcl <code>ClassLoader</code> instance. * @throws com.sun.appserv.connectors.internal.api.ConnectorRuntimeException * If there is a failure in loading * or starting the resource adapter. */ public void init(ResourceAdapter ra, ConnectorDescriptor desc, String moduleName, ClassLoader jcl) throws ConnectorRuntimeException { super.init(ra, desc, moduleName, jcl); this.factories_ = new Hashtable<String, MessageEndpointFactoryInfo>(); }
/** * merge RA bean configuration with resource-adapter-config properties * Union of both. * resource-adapter-config properties will override the values of resource-adapter bean's config * @param raConfig resource-adapter-config * @param raConfigProps resource-adapter bean configuration * @return merged set of config properties */ protected Set mergeRAConfiguration(ResourceAdapterConfig raConfig, List<Property> raConfigProps) { Set mergedProps; if (raConfig != null) { raConfigProps = raConfig.getProperty(); } mergedProps = ConnectorDDTransformUtils.mergeProps(raConfigProps, getDescriptor().getConfigProperties()); return mergedProps; }
public void addAdminObject( String appName, String connectorName, ResourceInfo resourceInfo, String adminObjectType, String adminObjectClassName, Properties props) throws ConnectorRuntimeException { ActiveResourceAdapter ar = _registry.getActiveResourceAdapter(connectorName); if (ar == null) { ifSystemRarLoad(connectorName); ar = _registry.getActiveResourceAdapter(connectorName); } if (ar instanceof ActiveOutboundResourceAdapter) { ActiveOutboundResourceAdapter aor = (ActiveOutboundResourceAdapter) ar; aor.addAdminObject(appName, connectorName, resourceInfo, adminObjectType, adminObjectClassName, props); } else { ConnectorRuntimeException cre = new ConnectorRuntimeException( "This adapter is not 1.5 compliant"); _logger.log(Level.SEVERE, "rardeployment.non_1.5_compliant_rar", resourceInfo); throw cre; } }