public class Context extends java.lang.Object implements java.io.Externalizable, Loggeable, Pausable, java.lang.Cloneable
Constructor and Description |
---|
Context() |
Modifier and Type | Method and Description |
---|---|
void |
checkPoint(java.lang.String detail)
add a checkpoint to the profiler
|
Context |
clone() |
void |
dump(java.io.PrintStream p,
java.lang.String indent) |
protected void |
dumpEntry(java.io.PrintStream p,
java.lang.String indent,
java.util.Map.Entry<java.lang.Object,java.lang.Object> entry) |
protected void |
dumpMap(java.io.PrintStream p,
java.lang.String indent) |
boolean |
equals(java.lang.Object o) |
void |
evict(java.lang.Object key)
Evicts a persistent entry
|
<T> T |
get(java.lang.Object key)
Get object instance from transaction context.
|
<T> T |
get(java.lang.Object key,
long timeout)
persistent get with timeout
|
<T> T |
get(java.lang.Object key,
T defValue)
Get object instance from transaction context.
|
LogEvent |
getLogEvent()
return a LogEvent used to store trace information
about this transaction.
|
java.util.Map<java.lang.Object,java.lang.Object> |
getMap() |
PausedTransaction |
getPausedTransaction() |
PausedTransaction |
getPausedTransaction(long timeout) |
Profiler |
getProfiler()
return (or creates) a Profiler object
|
Result |
getResult()
return (or creates) a Resultr object
|
java.lang.String |
getString(java.lang.Object key) |
java.lang.String |
getString(java.lang.Object key,
java.lang.String defValue) |
long |
getTimeout() |
int |
hashCode() |
boolean |
hasKey(java.lang.Object key)
Check if key present
|
boolean |
hasPersistedKey(java.lang.Object key)
Check key exists present persisted map
|
boolean |
isTrace() |
void |
log(java.lang.Object msg)
adds a trace message
|
<T> T |
move(java.lang.Object from,
java.lang.Object to)
Move entry to new key name
|
void |
persist(java.lang.Object key)
Persists a transient entry
|
void |
put(java.lang.Object key,
java.lang.Object value)
puts an Object in the transient Map
|
void |
put(java.lang.Object key,
java.lang.Object value,
boolean persist)
puts an Object in the transient Map
|
void |
readExternal(java.io.ObjectInput in) |
<T> T |
remove(java.lang.Object key)
Transient remove
|
void |
resume() |
void |
setPausedTransaction(PausedTransaction p) |
void |
setTimeout(long timeout) |
void |
setTrace(boolean trace) |
void |
writeExternal(java.io.ObjectOutput out) |
public void put(java.lang.Object key, java.lang.Object value)
public void put(java.lang.Object key, java.lang.Object value, boolean persist)
public void persist(java.lang.Object key)
key
- the keypublic void evict(java.lang.Object key)
key
- the keypublic <T> T get(java.lang.Object key)
T
- desired type of object instancekey
- the key of object instancenull
otherwisepublic boolean hasKey(java.lang.Object key)
key
- the keypublic boolean hasPersistedKey(java.lang.Object key)
key
- the keypublic <T> T move(java.lang.Object from, java.lang.Object to)
from
- keyto
- keypublic <T> T get(java.lang.Object key, T defValue)
T
- desired type of object instancekey
- the key of object instancedefValue
- default value returned if there is no value in contextdefValue
otherwisepublic <T> T remove(java.lang.Object key)
public java.lang.String getString(java.lang.Object key)
public java.lang.String getString(java.lang.Object key, java.lang.String defValue)
public void dump(java.io.PrintStream p, java.lang.String indent)
public <T> T get(java.lang.Object key, long timeout)
key
- the keytimeout
- timeoutpublic void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public Context clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.util.Map<java.lang.Object,java.lang.Object> getMap()
protected void dumpMap(java.io.PrintStream p, java.lang.String indent)
protected void dumpEntry(java.io.PrintStream p, java.lang.String indent, java.util.Map.Entry<java.lang.Object,java.lang.Object> entry)
public LogEvent getLogEvent()
public Profiler getProfiler()
public Result getResult()
public void log(java.lang.Object msg)
msg
- trace informationpublic void checkPoint(java.lang.String detail)
public void setPausedTransaction(PausedTransaction p)
setPausedTransaction
in interface Pausable
public PausedTransaction getPausedTransaction()
getPausedTransaction
in interface Pausable
public PausedTransaction getPausedTransaction(long timeout)
public void setTimeout(long timeout)
setTimeout
in interface Pausable
public long getTimeout()
getTimeout
in interface Pausable
public boolean isTrace()
public void setTrace(boolean trace)