try
{
// Get local EJB3 Registrar
Ejb3Registrar registrar = Ejb3RegistrarLocator.locateRegistrar();
Object pfObj = registrar.lookup(proxyFactoryRegistryKey);
assert pfObj != null : ProxyFactory.class.getName() + " from key " + proxyFactoryRegistryKey + " was null";
assert pfObj instanceof ProxyFactory : " Object obtained from key " + proxyFactoryRegistryKey
+ " was expected to be of type " + ProxyFactory.class.getName() + " but was instead " + pfObj;
proxyFactory = (ProxyFactory) pfObj;
}