Methods Summary |
---|
public synchronized void | deleteServant(byte[] transientKey)
int index = ORBUtility.bytesToInt(transientKey,0);
if (orb.transientObjectManagerDebugFlag)
dprint( "deleting servant at index=" + index ) ;
elementArray[index].delete(freeList);
freeList = elementArray[index];
|
private void | doubleSize()
// Assume caller is synchronized
Element old[] = elementArray;
int oldSize = maxSize;
maxSize *= 2;
elementArray = new Element[maxSize];
for ( int i=0; i<oldSize; i++ )
elementArray[i] = old[i];
elementArray[maxSize-1] = new Element(maxSize-1,null);
for ( int i=maxSize-2; i>=oldSize; i-- )
elementArray[i] = new Element(i,elementArray[i+1]);
freeList = elementArray[oldSize];
|
void | dprint(java.lang.String msg)
ORBUtility.dprint( this, msg ) ;
|
public synchronized byte[] | getKey(java.lang.Object servant)
for ( int i=0; i<maxSize; i++ )
if ( elementArray[i].valid &&
elementArray[i].servant == servant )
return elementArray[i].toBytes();
// if we come here Object does not exist
return null;
|
public synchronized java.lang.Object | lookupServant(byte[] transientKey)
int index = ORBUtility.bytesToInt(transientKey,0);
int counter = ORBUtility.bytesToInt(transientKey,4);
if (orb.transientObjectManagerDebugFlag)
dprint( "lookupServant called with index=" + index + ", counter=" + counter ) ;
if (elementArray[index].counter == counter &&
elementArray[index].valid ) {
if (orb.transientObjectManagerDebugFlag)
dprint( "\tcounter is valid" ) ;
return elementArray[index].servant;
}
// servant not found
if (orb.transientObjectManagerDebugFlag)
dprint( "\tcounter is invalid" ) ;
return null;
|
public synchronized java.lang.Object | lookupServantData(byte[] transientKey)
int index = ORBUtility.bytesToInt(transientKey,0);
int counter = ORBUtility.bytesToInt(transientKey,4);
if (orb.transientObjectManagerDebugFlag)
dprint( "lookupServantData called with index=" + index + ", counter=" + counter ) ;
if (elementArray[index].counter == counter &&
elementArray[index].valid ) {
if (orb.transientObjectManagerDebugFlag)
dprint( "\tcounter is valid" ) ;
return elementArray[index].servantData;
}
// servant not found
if (orb.transientObjectManagerDebugFlag)
dprint( "\tcounter is invalid" ) ;
return null;
|
public synchronized byte[] | storeServant(java.lang.Object servant, java.lang.Object servantData)
if ( freeList == null )
doubleSize();
Element elem = freeList;
freeList = (Element)freeList.servant;
byte[] result = elem.getKey(servant, servantData);
if (orb.transientObjectManagerDebugFlag)
dprint( "storeServant returns key for element " + elem ) ;
return result ;
|