/** * stop the active resource adapter (runtime) * @param raName resource-adapter name */ public void stopActiveResourceAdapter(String raName) { if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Stopping RA : ", raName); } try { destroyActiveResourceAdapter(raName); } catch (ConnectorRuntimeException cre) { Object params[] = new Object[]{raName, cre.getMessage()}; _logger.log(Level.WARNING, "unable.to.stop.ra", params); if(_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "unable to stop resource adapter [ " + raName + " ]", cre); } } }
/** * Get a wrapper datasource specified by the jdbcjndi name * This API is intended to be used in the DAS. The motivation for having this * API is to provide the CMP backend/ JPA-Java2DB a means of acquiring a connection during * the codegen phase. If a user is trying to deploy an JPA-Java2DB app on a remote server, * without this API, a resource reference has to be present both in the DAS * and the server instance. This makes the deployment more complex for the * user since a resource needs to be forcibly created in the DAS Too. * This API will mitigate this need. * * @param jndiName jndi name of the resource * @return DataSource representing the resource. */ private Object lookupDataSourceInDAS(ResourceInfo resourceInfo) { try{ return connectorResourceAdmService.lookupDataSourceInDAS(resourceInfo); }catch(ConnectorRuntimeException cre){ throw new RuntimeException(cre.getMessage(), cre); } }
public Collection<ConnectorClassFinder> getSystemRARClassLoaders() { try { return getConnectorsClassLoaderUtil().getSystemRARClassLoaders(); } catch (ConnectorRuntimeException cre) { throw new RuntimeException(cre.getMessage(), cre); } }
public Object create(Context ic) throws NamingException { //this is a per-lookup object and once we have the descriptor, //we remove the proxy and bind the descriptor with same jndi-name //hence block synchronization is fine as it blocks only callers //of this particular connector descriptor and also only for first time (initialization) synchronized(this){ if(desc == null){ try { desc = getConnectorRuntime().getConnectorDescriptor(rarName); ic.rebind(jndiName, desc); } catch (ConnectorRuntimeException e) { NamingException ne = new NamingException(e.getMessage()); ne.initCause(e); throw ne; } } } return desc; } }
public void createActiveResourceAdapterForEmbeddedRar(String rarModuleName) throws ConnectorRuntimeException { ConnectorDescriptor cdesc = loadConnectorDescriptorForEmbeddedRAR(rarModuleName); String appName = ConnectorAdminServiceUtils.getApplicationName(rarModuleName); String rarFileName = ConnectorAdminServiceUtils .getConnectorModuleName(rarModuleName) + ".rar"; String loc = getResourcesUtil().getApplicationDeployLocation(appName); loc = loc + File.separator + FileUtils.makeFriendlyFilename(rarFileName); String path = null; try { URI uri = new URI(loc); path = uri.getPath(); } catch (URISyntaxException use) { ConnectorRuntimeException cre = new ConnectorRuntimeException("Invalid path [ "+use.getMessage()+" ]"); cre.setStackTrace(use.getStackTrace()); _logger.log(Level.WARNING, cre.getMessage(), cre); throw cre; } // start RA _runtime.createActiveResourceAdapter(cdesc, rarModuleName, path); }
_logger.log(Level.WARNING, "jdbc.pool_not_reachable", re.getMessage()); String l10nMsg = localStrings.getString("pingpool.cannot_obtain_mcf", poolInfo); ResourceException e = new ResourceException(l10nMsg);