Property ep = null;
try {
//ServerContext sc = ApplicationServer.getServerContext();
//ConfigContext ctx = sc.getConfigContext();
//Resources rbeans = ServerBeansFactory.getDomainBean(ctx).getResources();
AdminObjectResource res = null;
res = (AdminObjectResource)
ResourcesUtil.createInstance().getResource(logicalDest, appName, moduleName, AdminObjectResource.class);
//AdminObjectResource res = (AdminObjectResource) allResources.getAdminObjectResourceByJndiName(logicalDest);
if (res == null) {
String physicalDest = null;
if (logicalDest.startsWith(ResourceConstants.JAVA_COMP_SCOPE_PREFIX)
|| !logicalDest.startsWith(ResourceConstants.JAVA_SCOPE_PREFIX)) {
if (isEjbInWar(ejbMessageBeanDescriptor)) {
physicalDest = getPhysicalDestination(logicalDest, ejbMessageBeanDescriptor.getEjbBundleDescriptor().getModuleDescriptor());
} else {
physicalDest = getPhysicalDestination(logicalDest, ejbMessageBeanDescriptor);
}
} else if (logicalDest.startsWith(ResourceConstants.JAVA_MODULE_SCOPE_PREFIX)) {
if (isEjbInWar(ejbMessageBeanDescriptor)) {
physicalDest = getPhysicalDestination(logicalDest, ejbMessageBeanDescriptor.getEjbBundleDescriptor().getModuleDescriptor());
} else {
physicalDest = getPhysicalDestination(logicalDest, ejbMessageBeanDescriptor.getEjbBundleDescriptor());
}
} else if (logicalDest.startsWith(ResourceConstants.JAVA_APP_SCOPE_PREFIX)) {
physicalDest = getPhysicalDestination(logicalDest, ejbMessageBeanDescriptor.getApplication());
} else if (logicalDest.startsWith(ResourceConstants.JAVA_GLOBAL_SCOPE_PREFIX)) {
physicalDest = getPhysicalDestination(logicalDest, ejbMessageBeanDescriptor.getApplication());
if (!isValidName(physicalDest)) {
physicalDest = getPhysicalDestination(logicalDest);
}
}
if (isValidName(physicalDest)) {
return physicalDest;
}
String msg = sm.getString("ajra.err_getting_dest", logicalDest);
throw new ConnectorRuntimeException(msg);
}
ep = res.getProperty(PHYSICAL_DESTINATION); //getElementPropertyByName(PHYSICAL_DESTINATION);
} catch(Exception ce) {
String msg = sm.getString("ajra.err_getting_dest", logicalDest);
ConnectorRuntimeException cre = new ConnectorRuntimeException( msg );
cre.initCause( ce );
throw cre;