jPOS 1.6.1 API Documentation

org.jpos.transaction.participant
Class HasEntry

java.lang.Object
  extended by org.jpos.transaction.participant.HasEntry
All Implemented Interfaces:
Configurable, GroupSelector, TransactionConstants, TransactionParticipant

public class HasEntry
extends java.lang.Object
implements GroupSelector, Configurable

HasEntry is a general purpose GroupSelector that can be used to verify that a given object is available in the context. It checks the Context for the given entry ('name' property) and returns the content of the 'yes' or 'no' properties as the group list. If "yes" or "no" is not specified, it returns the constant UNKNOWN


Field Summary
static java.lang.String NO
           
static java.lang.String UNKNOWN
           
static java.lang.String YES
           
 
Fields inherited from interface org.jpos.transaction.TransactionConstants
ABORTED, NO_JOIN, PAUSE, PREPARED, READONLY, RETRY
 
Constructor Summary
HasEntry()
           
 
Method Summary
 void abort(long id, java.io.Serializable o)
          Called by TransactionManager upon transaction commit.
 void commit(long id, java.io.Serializable o)
          Called by TransactionManager upon transaction commit.
 int prepare(long id, java.io.Serializable o)
          Called by TransactionManager in preparation for a transaction
 java.lang.String select(long id, java.io.Serializable ser)
           
 void setConfiguration(Configuration cfg)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YES

public static final java.lang.String YES
See Also:
Constant Field Values

NO

public static final java.lang.String NO
See Also:
Constant Field Values

UNKNOWN

public static final java.lang.String UNKNOWN
See Also:
Constant Field Values
Constructor Detail

HasEntry

public HasEntry()
Method Detail

prepare

public int prepare(long id,
                   java.io.Serializable o)
Description copied from interface: TransactionParticipant
Called by TransactionManager in preparation for a transaction

Specified by:
prepare in interface TransactionParticipant
Parameters:
id - the Transaction identifier
o - transaction context
Returns:
PREPARED or ABORTED (| NO_JOIN | READONLY)

select

public java.lang.String select(long id,
                               java.io.Serializable ser)
Specified by:
select in interface GroupSelector
Parameters:
id - transaction id
ser - transaction context
Returns:
group name or null for no-action

commit

public void commit(long id,
                   java.io.Serializable o)
Description copied from interface: TransactionParticipant
Called by TransactionManager upon transaction commit. Warning: implementation should be able to handle multiple calls with the same transaction id (rare crash recovery)

Specified by:
commit in interface TransactionParticipant
Parameters:
id - the Transaction identifier
o - transaction context

abort

public void abort(long id,
                  java.io.Serializable o)
Description copied from interface: TransactionParticipant
Called by TransactionManager upon transaction commit. Warning: implementation should be able to handle multiple calls with the same transaction id (rare crash recovery)

Specified by:
abort in interface TransactionParticipant
Parameters:
id - the Transaction identifier
o - transaction context

setConfiguration

public void setConfiguration(Configuration cfg)
Specified by:
setConfiguration in interface Configurable
Parameters:
cfg - Configuration object

jPOS.org