Methods Summary |
---|
public NamingContextImpl | addContext(java.lang.String objKey, NamingContextImpl context)
File contextFile = new File(logDir, objKey);
if (contextFile.exists())
{
context = readInContext(objKey);
}
else {
try {
FileOutputStream fos = new FileOutputStream(contextFile);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(context);
oos.close();
} catch (Exception ex) {
}
}
try
{
contexts.remove( objKey );
}
catch( Exception e)
{
}
contexts.put(objKey, context);
return context;
|
public java.lang.String | getNewObjectKey()
return objKeyPrefix + counterDb.getNextCounter();
|
public static java.lang.String | getRootObjectKey()
return objKeyPrefix + CounterDB.rootCounter;
|
public void | postinvoke(byte[] oid, org.omg.PortableServer.POA adapter, java.lang.String operation, java.lang.Object cookie, org.omg.PortableServer.Servant servant)
// nada
|
public org.omg.PortableServer.Servant | preinvoke(byte[] oid, org.omg.PortableServer.POA adapter, java.lang.String operation, org.omg.PortableServer.ServantLocatorPackage.CookieHolder cookie)
String objKey = new String(oid);
Servant servant = (Servant) contexts.get(objKey);
if (servant == null)
{
servant = readInContext(objKey);
}
return servant;
|
public NamingContextImpl | readInContext(java.lang.String objKey)
NamingContextImpl context = (NamingContextImpl) contexts.get(objKey);
if( context != null )
{
// Returning Context from Cache
return context;
}
File contextFile = new File(logDir, objKey);
if (contextFile.exists()) {
try {
FileInputStream fis = new FileInputStream(contextFile);
ObjectInputStream ois = new ObjectInputStream(fis);
context = (NamingContextImpl) ois.readObject();
context.setORB( orb );
context.setServantManagerImpl( this );
context.setRootNameService( theNameService );
ois.close();
} catch (Exception ex) {
}
}
if (context != null)
{
contexts.put(objKey, context);
}
return context;
|
public void | updateContext(java.lang.String objKey, NamingContextImpl context)
File contextFile = new File(logDir, objKey);
if (contextFile.exists())
{
contextFile.delete( );
contextFile = new File(logDir, objKey);
}
try {
FileOutputStream fos = new FileOutputStream(contextFile);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(context);
oos.close();
} catch (Exception ex) {
ex.printStackTrace( );
}
|