com.ibm.wsspi.wim.pluginmanager
Interface ModificationSubscriber

All Superinterfaces:
Subscriber

public interface ModificationSubscriber
extends Subscriber

ModificationSubscriber helps define a 'modification-type' subscriber which allows to develop an exit plugin which can allow 2-Phase commit. It implements the Subscriber interface to call the exit function and then allow the subscriber to 'veto' modifications made to the datagraph by other subscribers.


Field Summary
static java.lang.String COPYRIGHT_NOTICE
           
 
Method Summary
 void commit(java.lang.String emitter, commonj.sdo.DataObject rootDO, int exitPointType, java.lang.String inlineName)
          Commit is called if all the modification subscribers that are listed with a preExit or inlineExit or postExit have returned true during the runtime.
 boolean inlineExitCall(java.lang.String emitter, commonj.sdo.DataObject daisyChainDGRootDO, java.lang.String inlineTopicName)
          This function is called in the middle of a Topic-Emitter's execution and allows the ModificationSubscriber to execute its inlineExit code.
 boolean postExitCall(java.lang.String emitter, commonj.sdo.DataObject daisyChainDGRootDO, commonj.sdo.DataObject adapterDGRootDo)
          This function is called at the end of a Topic-Emitter's execution and allows the ModificationSubscriber to execute its PostExit code.
 boolean preExitCall(java.lang.String emitter, commonj.sdo.DataObject pristineDGRootDO)
          This function is called at the beginning of a Topic-Emitter and allows the ModificationSubscriber to execute its PreExit code.
 void rollback(java.lang.String emitter, commonj.sdo.DataObject rootDO, int exitPointType, java.lang.String inlineName)
          Rollback is called if any of the modification subscribers that are listed with a preExit or inlineExit or postExit have returned false during the runtime.
 
Methods inherited from interface com.ibm.wsspi.wim.pluginmanager.Subscriber
getSubscriberName, getSubscriberType, initSubscriber, recovery, shutdownSubscriber
 

Field Detail

COPYRIGHT_NOTICE

static final java.lang.String COPYRIGHT_NOTICE
See Also:
Constant Field Values
Method Detail

preExitCall

boolean preExitCall(java.lang.String emitter,
                    commonj.sdo.DataObject pristineDGRootDO)
                    throws SubscriberException
This function is called at the beginning of a Topic-Emitter and allows the ModificationSubscriber to execute its PreExit code. The Topic-Emitter developer has to make a backup of the pristineDGRootDO before calling this function because the original object is modified.

Parameters:
emitter - The topic-emitter name on which the subscriber is listening on
pristineDGRootDO - Root The DataObject which has the information passed from API
Throws:
SubscriberException
Return:
boolean to check if the function call is OK with the changes made by other modification subscribers in the list

inlineExitCall

boolean inlineExitCall(java.lang.String emitter,
                       commonj.sdo.DataObject daisyChainDGRootDO,
                       java.lang.String inlineTopicName)
                       throws SubscriberException
This function is called in the middle of a Topic-Emitter's execution and allows the ModificationSubscriber to execute its inlineExit code. The Topic-Emitter developer has to make a backup of the daisyChainDGRootDO before calling this function because daisyChainDGRootDO object will be modified during the process.

Parameters:
emitter - The topic-emitter name on which we are listening on
daisyChainDGRootDO - Root DataObject which has the information passed from API which might have been modified by other subscribers
inlineTopicName - inline topic name
Throws:
SubscriberException
Return:
boolean to check if the function call is OK with the changes made by other modification subscribers in the list

postExitCall

boolean postExitCall(java.lang.String emitter,
                     commonj.sdo.DataObject daisyChainDGRootDO,
                     commonj.sdo.DataObject adapterDGRootDo)
                     throws SubscriberException
This function is called at the end of a Topic-Emitter's execution and allows the ModificationSubscriber to execute its PostExit code. The Topic-Emitter developer has to make a backup of the daisyChainDGRootDO before calling this function because daisyChainDGRootDO object will be modified during the process.

Parameters:
emitter - The topic-emitter name on which we are listening on
daisyChainDGRootDO - Root DataObject which has the information passed from API which might have been modified by other subscribers
adapterDGRootDO - Root DataObject returned by the adapter
Throws:
SubscriberException
Return:
boolean to check if the function call is OK with the changes made by other modification subscribers in the list

commit

void commit(java.lang.String emitter,
            commonj.sdo.DataObject rootDO,
            int exitPointType,
            java.lang.String inlineName)
            throws SubscriberException
Commit is called if all the modification subscribers that are listed with a preExit or inlineExit or postExit have returned true during the runtime. This allows the subscriber to commit its changes to its own datastore, etc.

Parameters:
emitter - Topic-emitter name
rootDO - The modified DataObject Object, for postExitCall it is the adapterDGRootDO
exitPointType - Defines the point in the code execution at which the commit is being called
inlineName - - null for preExitCall & postExitCall but has the name of the inline point
Throws:
SubscriberException

rollback

void rollback(java.lang.String emitter,
              commonj.sdo.DataObject rootDO,
              int exitPointType,
              java.lang.String inlineName)
              throws SubscriberException
Rollback is called if any of the modification subscribers that are listed with a preExit or inlineExit or postExit have returned false during the runtime. This allows a subscriber to rollback any changes that it has made during execution.

Parameters:
emitter - Topic-emitter name
rootDO - The modified DataObject Object, for postExitCall it is the adapterDGRootDO
exitPointType - Defines the point in the code execution at which the commit is being called
inlineName - - null for preExitCall & postExitCall but has the name of the inline point
Throws:
SubscriberException