com.retek.commons.component
Class DistributedContext

java.lang.Object
  extended bycom.retek.commons.component.DistributedContext

public class DistributedContext
extends java.lang.Object

Manages identity for DistributedObjects. A context is essentially a state pool which holds working copies of distributed objects. Each context only has a single instance of the distributed object with a given identity; in other words, the fundamental contract of this framework is:

DistributedContext + DistributedReference = unique instance of DistributedObject


Field Summary
protected  java.util.Map statePool
           
 
Constructor Summary
DistributedContext()
          Deprecated. until 2-25 by Paul C: pass in a name for this context, explaining where it was created. This gives nice debug messages when your context shows up dirty or closed or mismatched or whatever.
DistributedContext(boolean forMigration, java.lang.String createdBy)
          remove when migration is complete
DistributedContext(java.lang.String name)
           
 
Method Summary
 void checkOpen()
          Throws an appropriate exception if the context is closed or poisoned.
 void close()
          Closes the context, checking for dirty objects.
 void discard()
          Closes the context, regardless of whether there are dirty objects.
 java.lang.String dumpAll()
           
 java.lang.String dumpDirty()
           
 boolean isClosed()
           
 boolean isDirty()
           
 boolean isTempContextForMigration()
          remove when migration is complete
 void poison(java.lang.Throwable poisonCause)
          Marks the context as corrupted.
 void purge(DistributedReference ref)
           
 void registerNew(DistributedObject dobj)
           
 DistributedObject resolve(DistributedReference ref)
           
 java.util.List resolve(java.util.List distributedReferences)
           
 java.util.Set resolve(java.util.Set distributedRefs)
           
 DistributedObject specialResolveForUseInCommonsOnly(DistributedReference ref, boolean errorIfDeleted)
           
 java.util.Set specialResolveForUseInCommonsOnly(java.util.Set distributedReferences, boolean errorIfDeleted)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

statePool

protected java.util.Map statePool
Constructor Detail

DistributedContext

public DistributedContext()
Deprecated. until 2-25 by Paul C: pass in a name for this context, explaining where it was created. This gives nice debug messages when your context shows up dirty or closed or mismatched or whatever.


DistributedContext

public DistributedContext(java.lang.String name)

DistributedContext

public DistributedContext(boolean forMigration,
                          java.lang.String createdBy)
remove when migration is complete

Method Detail

isClosed

public boolean isClosed()

isDirty

public boolean isDirty()

close

public void close()
Closes the context, checking for dirty objects. Does nothing if the context is already closed or poisoned.

Throws:
DirtyContextException - If the context holds dirty objects. In this case, the context remains open.

discard

public void discard()
Closes the context, regardless of whether there are dirty objects.


poison

public void poison(java.lang.Throwable poisonCause)
Marks the context as corrupted. This is usually due some exception ocurring during a critical process, such as DTO merging. If the context was already poisoned before a call to this method, it does nothing.


checkOpen

public void checkOpen()
Throws an appropriate exception if the context is closed or poisoned.


resolve

public java.util.Set resolve(java.util.Set distributedRefs)
                      throws SystemException
Throws:
SystemException

specialResolveForUseInCommonsOnly

public java.util.Set specialResolveForUseInCommonsOnly(java.util.Set distributedReferences,
                                                       boolean errorIfDeleted)
                                                throws SystemException
Throws:
SystemException
See Also:
Dto.mergePropertiesFrom(com.retek.commons.component.DistributedContext, com.retek.commons.component.impl.Dto)

specialResolveForUseInCommonsOnly

public DistributedObject specialResolveForUseInCommonsOnly(DistributedReference ref,
                                                           boolean errorIfDeleted)
                                                    throws SystemException
Throws:
SystemException

resolve

public java.util.List resolve(java.util.List distributedReferences)
                       throws SystemException
Throws:
SystemException

resolve

public DistributedObject resolve(DistributedReference ref)
                          throws SystemException
Throws:
SystemException

purge

public void purge(DistributedReference ref)

registerNew

public void registerNew(DistributedObject dobj)

toString

public java.lang.String toString()

dumpAll

public java.lang.String dumpAll()

dumpDirty

public java.lang.String dumpDirty()

isTempContextForMigration

public boolean isTempContextForMigration()
remove when migration is complete



Copyright © 2005 Retek Inc. All Rights Reserved. - Generated at Fri, 01/21/2005 14:25