public static boolean isModuleScopedResource(GenericResourceInfo resourceInfo){ return resourceInfo != null && resourceInfo.getApplicationName() != null && resourceInfo.getModuleName() != null && resourceInfo.getName() != null && resourceInfo.getName().startsWith(ResourceConstants.JAVA_MODULE_SCOPE_PREFIX); } }
public static boolean isApplicationScopedResource(GenericResourceInfo resourceInfo){ return resourceInfo != null && resourceInfo.getApplicationName() != null && resourceInfo.getName() != null && resourceInfo.getName().startsWith(ResourceConstants.JAVA_APP_SCOPE_PREFIX); }
public void unpublishObject(GenericResourceInfo resourceInfo, String jndiName) throws NamingException { String applicationName = resourceInfo.getApplicationName(); String moduleName = resourceInfo.getModuleName(); moduleName = org.glassfish.resourcebase.resources.util.ResourceUtil.getActualModuleName(moduleName); if(!isGlobalName(resourceInfo.getName()) && applicationName != null && moduleName != null){ namingManager.unbindModuleObject(applicationName, moduleName, getModuleScopedName(jndiName)); }else if(!isGlobalName(resourceInfo.getName()) && applicationName != null) { namingManager.unbindAppObject(applicationName, getAppScopedName(jndiName)); unbindAppScopedNameForAppclient(jndiName, applicationName); }else{ namingManager.unpublishObject(jndiName); } }
public Object lookup(GenericResourceInfo resourceInfo, String name, Hashtable env) throws NamingException{ String applicationName = resourceInfo.getApplicationName(); String moduleName = resourceInfo.getModuleName(); moduleName = org.glassfish.resourcebase.resources.util.ResourceUtil.getActualModuleName(moduleName); if(!isGlobalName(resourceInfo.getName()) && applicationName != null && moduleName != null){ return namingManager.lookupFromModuleNamespace(applicationName, moduleName, getModuleScopedName(name), env); }else if(!isGlobalName(resourceInfo.getName()) && applicationName != null) { if(pe.getProcessType().isServer() || pe.getProcessType().isEmbedded()){ return namingManager.lookupFromAppNamespace(applicationName, getAppScopedName(name), env); }else{ String internalGlobalJavaAppName = cnu.composeInternalGlobalJavaAppName(applicationName, getAppScopedName(name)); if(_logger.isLoggable(Level.FINEST)){ debug("appclient lookup : " + internalGlobalJavaAppName); } return namingManager.getInitialContext().lookup(internalGlobalJavaAppName); } }else{ if(env != null){ InitialContext ic = new InitialContext(env); return ic.lookup(name); }else{ return namingManager.getInitialContext().lookup(name); } } }
public void publishObject(GenericResourceInfo resourceInfo, String jndiName, Object object,boolean rebind) throws NamingException{ String applicationName = resourceInfo.getApplicationName(); String moduleName = resourceInfo.getModuleName(); moduleName = org.glassfish.resourcebase.resources.util.ResourceUtil.getActualModuleName(moduleName); if(!isGlobalName(resourceInfo.getName()) && applicationName != null && moduleName != null ){ }else if(!isGlobalName(resourceInfo.getName()) && applicationName != null ) {