LocalSerialContextProviderImplpublic class LocalSerialContextProviderImpl extends SerialContextProviderImpl This class is the implementation of the local SerialContextProvider |
Fields Summary |
---|
private static LocalStringManagerImpl | localStrings | static Logger | _logger |
Constructors Summary |
---|
LocalSerialContextProviderImpl(TransientContext rootContext)
super(rootContext);
|
Methods Summary |
---|
public void | bind(java.lang.String name, java.lang.Object obj)overriding the super.bind() since we need to make a copy of the object
before it gets put into the rootContext
Remote Provider already does that since when a method is called
on a remote object (in our case the remote provider),
the copies of the method arguments get passed and not the real objects.
Object copyOfObj = NamingUtils.makeCopyOfObject(obj);
super.bind(name, copyOfObj);
| static com.sun.enterprise.naming.LocalSerialContextProviderImpl | getProvider(TransientContext rootContext)
try {
return new LocalSerialContextProviderImpl(rootContext);
} catch (RemoteException re) {
_logger.log(Level.SEVERE,
localStrings.getLocalString("local.provider.null",
"Exception occurred. Returning null provider : {0}" ,
new Object[] {re.getMessage()}));
return null;
}
| public java.lang.Object | lookup(java.lang.String name)
Object obj = super.lookup(name);
// If CORBA object, resolve here in server to prevent a
// another round-trip to CosNaming.
try {
if( obj instanceof Reference ) {
Reference ref = (Reference) obj;
if( ref.getFactoryClassName().equals
(NamingManagerImpl.IIOPOBJECT_FACTORY)) {
Hashtable env = new Hashtable();
org.omg.CORBA.ORB orb = ORBManager.getORB();
env.put("java.naming.corba.orb", orb);
obj = javax.naming.spi.NamingManager.getObjectInstance
(obj, new CompositeName(name), null, env);
return obj;
}
}
return NamingUtils.makeCopyOfObject(obj);
} catch(RemoteException re) {
throw re;
} catch(Exception e) {
RemoteException re = new RemoteException("", e);
throw re;
}
| public void | rebind(java.lang.String name, java.lang.Object obj)overriding the super.rebind() since we need to make a copy of the object
before it gets put into the rootContext.
Remote Provider already does that since when a method is called
on a remote object (in our case the remote provider),
the copies of the method arguments get passed and not the real objects.
Object copyOfObj = NamingUtils.makeCopyOfObject(obj);
super.rebind(name, copyOfObj);
|
|