public Object lookup(GenericResourceInfo resourceInfo, String name) throws NamingException{ return lookup(resourceInfo, name, null); }
/** * Create a ConnectorConnectionPool from information in memory */ private ConnectorConnectionPool getOriginalConnectorConnectionPool( PoolInfo poolInfo) throws NamingException { ConnectorConnectionPool ccpOrig = null; String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo); try { ccpOrig = (ConnectorConnectionPool)_runtime.getResourceNamingService().lookup(poolInfo, jndiNameForPool); } catch (NamingException ne) { throw ne; } return ccpOrig; }
/** * Checks if a conncetor connection pool has been deployed to this server * instance * * @param poolInfo * @return */ public boolean isConnectorConnectionPoolDeployed(PoolInfo poolInfo) { try { String jndiName = ConnectorAdminServiceUtils. getReservePrefixedJNDINameForPool(poolInfo); _runtime.getResourceNamingService().lookup(poolInfo, jndiName); return true; } catch (NamingException e) { return false; } }
/** * Returns the connector connection pool object corresponding * to the pool name * * @param poolInfo Name of the pool.MCF pertaining to this pool is * created/returned. * @return Connector connection pool corresponding to this instance * @throws ConnectorRuntimeException if creation/retrieval * of MCF fails */ private ConnectorConnectionPool getConnectorConnectionPool(PoolInfo poolInfo, Hashtable env) throws ConnectorRuntimeException, NamingException { String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo); ConnectorConnectionPool connectorConnectionPool = (ConnectorConnectionPool) _runtime.getResourceNamingService().lookup(poolInfo, jndiNameForPool, env); if (connectorConnectionPool == null) { String i18nMsg = localStrings.getString("ccp_adm.null_pool", poolInfo); ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg); _logger.log(Level.SEVERE, "rardeployment.connectionpool_object_null", poolInfo); if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "", cre); } throw cre; } return connectorConnectionPool; }
protected ConnectorConnectionPool getPoolConfigurationFromJndi(Hashtable env) throws PoolingException { ConnectorConnectionPool poolResource; try { String jndiNameOfPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo); poolResource = (ConnectorConnectionPool) ConnectorRuntime.getRuntime().getResourceNamingService().lookup(poolInfo, jndiNameOfPool, env); } catch (NamingException ex) { throw new PoolingException(ex); } return poolResource; }
/** * Look up the JNDI name with appropriate suffix. * Suffix can be either __pm or __nontx. * * @param resourceInfo resource-name * @return Object - from jndi * @throws NamingException - when unable to get the object form jndi */ public Object lookup(ResourceInfo resourceInfo) throws NamingException { Hashtable env = null; String jndiName = resourceInfo.getName(); String suffix = ConnectorsUtil.getValidSuffix(jndiName); //To pass suffix that will be used by connector runtime during lookup if(suffix != null){ env = new Hashtable(); env.put(ConnectorConstants.JNDI_SUFFIX_PROPERTY, suffix); jndiName = jndiName.substring(0, jndiName.lastIndexOf(suffix)); } ResourceInfo actualResourceInfo = new ResourceInfo(jndiName, resourceInfo.getApplicationName(), resourceInfo.getModuleName()); return namingService.lookup(actualResourceInfo, actualResourceInfo.getName(), env); }
actualObject = namingService.lookup(resourceInfo, resourceInfo.getName(), env); proxies.put(this, true); debug("actualObject : " + actualObject);
String jndiNameForPool = ConnectorAdminServiceUtils.getReservePrefixedJNDINameForPool(poolInfo); connectorConnectionPool = (ConnectorConnectionPool) _runtime.getResourceNamingService().lookup(poolInfo, jndiNameForPool, env); } catch (NamingException ne) { throw ne;
getReservePrefixedJNDINameForPool(poolInfo); try { ccp = (ConnectorConnectionPool) namingService.lookup(poolInfo, jndiNameForPool); } catch (NamingException ne) { ccp = (ConnectorConnectionPool) namingService.lookup(poolInfo, jndiNameForPool); } catch (NamingException e) { Object params[] = new Object[]{poolInfo, e}; ccp = (ConnectorConnectionPool) namingService.lookup(poolInfo, jndiNameForPool);
public Object create(Context ic) throws NamingException { //this is a per-lookup object and once we have the resource, //we remove the proxy and bind the resource (ref) with same jndi-name //hence block synchronization is fine as it blocks only callers //of this particular resource and also only for first time (initialization) synchronized(this){ try{ if(result == null){ getResourceDeployer(resource).deployResource(resource, resourceInfo.getApplicationName(), resourceInfo.getModuleName()); } result = namingService.lookup(resourceInfo, resourceInfo.getName(), ic.getEnvironment()); }catch(Exception e){ throwResourceNotFoundException(e, resourceInfo); } } return result; }