private void deleteResource(CustomResource customResource, ResourceInfo resourceInfo) throws NamingException { // converts the config data to j2ee resource //JavaEEResource j2eeResource = toCustomJavaEEResource(customRes, resourceInfo); // removes the resource from jndi naming cns.unpublishObject(resourceInfo, resourceInfo.getName()); }
public void publishObject(ResourceInfo resourceInfo, Object object,boolean rebind) throws NamingException{ String jndiName = resourceInfo.getName(); publishObject(resourceInfo, jndiName, object, rebind); }
/** * Un-installs the external jndi resource. * * @param resource external jndi resource */ public void uninstallExternalJndiResource(JavaEEResource resource, ResourceInfo resourceInfo) { // removes the jndi context from the factory cache //String bindName = resource.getResourceInfo().getName(); JndiProxyObjectFactory.removeInitialContext(resource.getResourceInfo()); // removes the resource from jndi naming try { namingService.unpublishObject(resourceInfo, resourceInfo.getName()); /* TODO V3 handle jms later //START OF IASRI 4660565 if (((ExternalJndiResource)resource).isJMSConnectionFactory()) { nm.unpublishObject(IASJmsUtil.getXAConnectionFactoryName(resourceName)); } //END OF IASRI 4660565 */ } catch (javax.naming.NamingException e) { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "Error while unpublishing resource: " + resourceInfo, e); } } }
public boolean equals(Object o){ boolean result = false; if(o == this){ result = true; }else if(o instanceof ResourceInfo){ ResourceInfo resourceInfo = (ResourceInfo)o; boolean poolNameEqual = resourceInfo.getName().equals(name); boolean appNameEqual = false; if(applicationName == null && resourceInfo.getApplicationName() == null){ appNameEqual = true; }else if(applicationName !=null && resourceInfo.getApplicationName() != null && applicationName.equals(resourceInfo.getApplicationName())){ appNameEqual = true; } boolean moduleNameEqual = false; if(moduleName == null && resourceInfo.getModuleName() == null){ moduleNameEqual = true; }else if(moduleName !=null && resourceInfo.getModuleName() != null && moduleName.equals(resourceInfo.getModuleName())){ moduleNameEqual = true; } result = poolNameEqual && appNameEqual && moduleNameEqual; } return result; }
ref.add(new ProxyRefAddr(extJndiRes.getResourceInfo().getName(), env));
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; }