private ActiveResourceAdapter instantiateActiveResourceAdapter(ConnectorDescriptor cd, String moduleName, ClassLoader loader, ResourceAdapter ra) throws ConnectorRuntimeException { ActiveResourceAdapter activeResourceAdapter = getActiveRA(cd, moduleName); activeResourceAdapter.init(ra, cd, moduleName, loader); return activeResourceAdapter; }
/** * 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(); }
/** * Checks if the rar module is already reployed. * * @param moduleName Rarmodule name * @return true if it is already deployed. false if it is not deployed. */ public boolean isRarDeployed(String moduleName) { ActiveResourceAdapter activeResourceAdapter = _registry.getActiveResourceAdapter(moduleName); return activeResourceAdapter != null; }
public void initialize() throws ConnectorRuntimeException { ConnectorRuntime runtime = ConnectorRuntime.getRuntime(); if(runtime.isNonACCRuntime()){ jndiName = ConnectorsUtil.getPMJndiName(jndiName); } ConnectorRegistry registry = ConnectorRegistry.getInstance(); PoolMetaData pmd = registry.getPoolMetaData(poolInfo); defaultPrin = pmd.getResourcePrincipal(); }
/** * initializes XATerminator reference */ private void initializeXATerminator() { if (xa == null) { xa = ConnectorRuntime.getRuntime().getXATerminatorProxy(moduleName); } } }
private PoolType getPoolType(ConnectorConnectionPool connectorConnectionPool) { PoolType pt = PoolType.STANDARD_POOL; if (!connectorConnectionPool.isPoolingOn()) { pt = PoolType.POOLING_DISABLED; } else if (connectorConnectionPool.isAssociateWithThread()) { pt = PoolType.ASSOCIATE_WITH_THREAD_POOL; } else if (connectorConnectionPool.isPartitionedPool()) { pt = PoolType.PARTITIONED_POOL; } return pt; }
/** * Remove all the proxy objects (Work-Manager) from connector registry * * @param moduleName_ resource-adapter name */ private void removeProxiesFromRegistry(String moduleName_) { ConnectorRuntime.getRuntime().removeWorkManagerProxy(moduleName_); }
private ComponentEnvManager getComponentEnvManager() { return ConnectorRuntime.getRuntime().getComponentEnvManager(); }
/** * provides XATerminator proxy that is Serializable * @param moduleName resource-adapter name * @return XATerminator */ public XATerminator getXATerminatorProxy(String moduleName){ XATerminator xat = getTransactionManager().getXATerminator(); return new XATerminatorProxy(xat); }
/** * Default Constructor */ public ConnectorService() { _runtime = ConnectorRuntime.getRuntime(); }
/** * uninitializes the resource adapter. It also destroys the default pools * and resources */ public void destroy() { if (isServer()) { destroyAllConnectorResources(); } }
/** * Constructs a <code>BootstrapContext</code> with default * thread pool for work manager. * * @param moduleName resource-adapter name * @throws ConnectorRuntimeException If there is a failure in * retrieving WorkManager. */ public BootstrapContextImpl (String moduleName) throws ConnectorRuntimeException{ this.moduleName = moduleName; initializeWorkManager(); }
/** * unregister the connector application from registry * @param rarName resource-adapter name */ public void unregisterConnectorApplication(String rarName){ connectorRegistry.removeConnectorApplication(rarName); }
public Object allocateConnection(ManagedConnectionFactory mcf, ConnectionRequestInfo cxRequestInfo) throws ResourceException { return this.allocateConnection(mcf, cxRequestInfo, jndiName); }
/** * Check if the execution environment is appserver runtime or application * client container. * * @return boolean if the environment is appserver runtime */ protected boolean isServer() { if (connectorRuntime_.isServer()) { return true; } else { return false; } }
/** * Retrieves the <code>XATerminator</code> object. */ public XATerminator getXATerminator() { initializeXATerminator(); return xa; }
/** * register the connector application with registry * @param rarModule resource-adapter module */ public void registerConnectorApplication(ConnectorApplication rarModule){ connectorRegistry.addConnectorApplication(rarModule); }
public void associateConnection(Object connection, javax.resource.spi.ManagedConnectionFactory mcf, javax.resource.spi.ConnectionRequestInfo info) throws ResourceException { //the following call will also take care of associating "connection" //with a new ManagedConnection instance allocateConnection(mcf, info, jndiName, connection); }
private ConnectorRuntime getRuntime(){ if(runtime == null){ runtime = ConnectorRuntime.getRuntime(); } return runtime; }
/** * Retrieves the work manager. * * @return <code>WorkManager</code> instance. * @see com.sun.enterprise.connectors.work.CommonWorkManager * @see com.sun.enterprise.connectors.work.WorkManagerFactory */ public WorkManager getWorkManager() { initializeWorkManager(); return wm; }