org.jpos.transaction
Class Context

java.lang.Object
  extended by org.jpos.transaction.Context
All Implemented Interfaces:
Externalizable, Serializable, Pausable, Loggeable

@Persistent
public class Context
extends Object
implements Externalizable, Loggeable, Pausable

See Also:
Serialized Form

Field Summary
static String LOGEVT
           
static String PAUSED_TRANSACTION
           
static String PROFILER
           
 
Constructor Summary
Context()
           
 
Method Summary
 void checkPoint(String detail)
          add a checkpoint to the profiler
 void dump(PrintStream p, String indent)
           
 Object get(Object key)
          Get
 Object get(Object key, long timeout)
          persistent get with timeout
 Object get(Object key, Object defValue)
           
 LogEvent getLogEvent()
          return a LogEvent used to store trace information about this transaction.
 Map getMap()
           
 PausedTransaction getPausedTransaction()
           
 Profiler getProfiler()
          return (or creates) a Profiler object
 String getString(Object key)
           
 String getString(Object key, Object defValue)
           
 long getTimeout()
           
 void log(Object msg)
          adds a trace message
 void put(Object key, Object value)
          puts an Object in the transient Map
 void put(Object key, Object value, boolean persist)
          puts an Object in the transient Map
 void readExternal(ObjectInput in)
           
 Object remove(Object key)
          Transient remove
 void resume()
           
 void setPausedTransaction(PausedTransaction p)
           
 void setTimeout(long timeout)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGEVT

public static String LOGEVT

PROFILER

public static String PROFILER

PAUSED_TRANSACTION

public static String PAUSED_TRANSACTION
Constructor Detail

Context

public Context()
Method Detail

put

public void put(Object key,
                Object value)
puts an Object in the transient Map


put

public void put(Object key,
                Object value,
                boolean persist)
puts an Object in the transient Map


get

public Object get(Object key)
Get


get

public Object get(Object key,
                  Object defValue)

remove

public Object remove(Object key)
Transient remove


getString

public String getString(Object key)

getString

public String getString(Object key,
                        Object defValue)

dump

public void dump(PrintStream p,
                 String indent)
Specified by:
dump in interface Loggeable

get

public Object get(Object key,
                  long timeout)
persistent get with timeout

Parameters:
key - the key
timeout - timeout
Returns:
object (null on timeout)

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

getMap

public Map getMap()
Returns:
transient map

getLogEvent

public LogEvent getLogEvent()
return a LogEvent used to store trace information about this transaction. If there's no LogEvent there, it creates one.

Returns:
LogEvent

getProfiler

public Profiler getProfiler()
return (or creates) a Profiler object

Returns:
Profiler object

log

public void log(Object msg)
adds a trace message


checkPoint

public void checkPoint(String detail)
add a checkpoint to the profiler


setPausedTransaction

public void setPausedTransaction(PausedTransaction p)
Specified by:
setPausedTransaction in interface Pausable

getPausedTransaction

public PausedTransaction getPausedTransaction()
Specified by:
getPausedTransaction in interface Pausable

setTimeout

public void setTimeout(long timeout)
Specified by:
setTimeout in interface Pausable

getTimeout

public long getTimeout()
Specified by:
getTimeout in interface Pausable

resume

public void resume()
Specified by:
resume in interface Pausable


Copyright © 1998-2012 jPOS.org. All Rights Reserved.