new DeploymentSummary());
mdWithApplicationName2.getEnterpriseBeansMetaData().getEjbJarMetaData().getDeploymentSummary()
.setDeploymentScopeBaseName("EAR2");
// Create a registrar
JndiStatelessSessionRegistrar reg = new JndiStatelessSessionRegistrar(StatelessSessionProxyObjectFactory.class
.getName());
// Get the target ProxyFactory Names
String regNameWithApplicationName1 = reg.getProxyFactoryRegistryKey(commonJndiName, mdWithApplicationName1, true);
String regNameWithApplicationName2 = reg.getProxyFactoryRegistryKey(commonJndiName, mdWithApplicationName2, true);
String regNameWithoutApplicationName = reg.getProxyFactoryRegistryKey(commonJndiName, mdWithoutApplicationName,
true);
// Log
log.info("regNameWithApplicationName1: " + regNameWithApplicationName1);
log.info("regNameWithApplicationName2: " + regNameWithApplicationName2);