com.arjuna.ats.arjuna.tools.osb.mbean
Class ActionBean

java.lang.Object
  extended by com.arjuna.ats.arjuna.tools.osb.mbean.OSEntryBean
      extended by com.arjuna.ats.arjuna.tools.osb.mbean.ActionBean
All Implemented Interfaces:
ActionBeanMBean, ObjStoreItemMBean, OSEntryBeanMBean

public class ActionBean
extends OSEntryBean
implements ActionBeanMBean

MBean implementation of an ObjectStore entry that represents an AtomicAction


Field Summary
 
Fields inherited from class com.arjuna.ats.arjuna.tools.osb.mbean.OSEntryBean
w
 
Constructor Summary
ActionBean(UidWrapper w)
           
 
Method Summary
protected  LogRecordWrapper createParticipant(AbstractRecord rec, ParticipantStatus listType)
          Extension point for other Bean implementations to provide an implementation bean for its participants.
 long getAgeInSeconds()
           
 String getCreationTime()
           
 LogRecordWrapper getParticipant(AbstractRecord rec)
          See if there is participant Bean corresponding to the given record
 Collection<LogRecordWrapper> getParticipants()
           
 Uid getUid(AbstractRecord rec)
          return the Uid for given AbstractRecord
 boolean isParticipant()
           
 void register()
          register this bean (and its participants) with the MBeanServer
 String remove()
          Remove this AtomicAction from the ObjectStore
 boolean setStatus(LogRecordWrapper logrec, ParticipantStatus newStatus)
          Request a change in status of a participant.
 StringBuilder toString(String prefix, StringBuilder sb)
           
 void unregister()
          unregister this bean (and its participants) with the MBeanServer
 
Methods inherited from class com.arjuna.ats.arjuna.tools.osb.mbean.OSEntryBean
activate, getId, getName, getType, getUid, register, type, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.arjuna.ats.arjuna.tools.osb.mbean.OSEntryBeanMBean
getId, getType
 

Constructor Detail

ActionBean

public ActionBean(UidWrapper w)
Method Detail

toString

public StringBuilder toString(String prefix,
                              StringBuilder sb)
Overrides:
toString in class OSEntryBean

getUid

public Uid getUid(AbstractRecord rec)
return the Uid for given AbstractRecord

Overrides:
getUid in class OSEntryBean
Parameters:
rec - the record whose Uid is required
Returns:
the Uid of the requested record

remove

public String remove()
Remove this AtomicAction from the ObjectStore

Specified by:
remove in interface ActionBeanMBean
Returns:
a textual indication of whether the remove operation succeeded

createParticipant

protected LogRecordWrapper createParticipant(AbstractRecord rec,
                                             ParticipantStatus listType)
Extension point for other Bean implementations to provide an implementation bean for its participants. For example @see com.arjuna.ats.internal.jta.tools.osb.mbean.jta.JTAActionBean

Parameters:
rec - the record that should be represented by an MBean
listType - the status of the record
Returns:
the MBean implementation of the participant

getParticipant

public LogRecordWrapper getParticipant(AbstractRecord rec)
See if there is participant Bean corresponding to the given record

Parameters:
rec - the record for the target participant
Returns:
the bean corresponding to the requested record

register

public void register()
register this bean (and its participants) with the MBeanServer

Overrides:
register in class OSEntryBean

unregister

public void unregister()
unregister this bean (and its participants) with the MBeanServer

Overrides:
unregister in class OSEntryBean

getAgeInSeconds

public long getAgeInSeconds()
Specified by:
getAgeInSeconds in interface ActionBeanMBean

getCreationTime

public String getCreationTime()
Specified by:
getCreationTime in interface ActionBeanMBean

isParticipant

public boolean isParticipant()
Specified by:
isParticipant in interface ActionBeanMBean

setStatus

public boolean setStatus(LogRecordWrapper logrec,
                         ParticipantStatus newStatus)
Request a change in status of a participant. For example if a record has a heuristic status then this method could be used to move it back into the prepared state so that the recovery system can replay phase 2 of the committment protocol

Parameters:
logrec - the record whose status is to be changed
newStatus - the desired status
Returns:
true if the status was changed

getParticipants

public Collection<LogRecordWrapper> getParticipants()
Returns:
the MBeans corresponding to the participants within this action


Copyright © 2011. All Rights Reserved.