public class TransactionManager extends QBeanSupport implements java.lang.Runnable, TransactionConstants, TransactionManagerMBean, Loggeable, MetricsProvider
| Modifier and Type | Class and Description |
|---|---|
class |
TransactionManager.InputQueueMonitor |
static class |
TransactionManager.PausedMonitor |
class |
TransactionManager.RetryTask |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Integer |
COMMITTING |
static java.lang.String |
CONTEXT |
static java.lang.String |
DEFAULT_GROUP |
static java.lang.Integer |
DONE |
protected java.util.Map<java.lang.String,java.util.List<TransactionParticipant>> |
groups |
static java.lang.String |
GROUPS |
static java.lang.String |
HEAD |
static long |
MAX_PARTICIPANTS |
static long |
MAX_WAIT |
static java.lang.Integer |
PREPARING |
static java.lang.String |
RETRY_QUEUE |
static java.lang.String |
STATE |
static java.lang.String |
TAIL |
static java.lang.String |
TAILLOCK |
static long |
TIMER_PURGE_INTERVAL |
cfg, log, scheduledThreadPoolExecutor| Constructor and Description |
|---|
TransactionManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
abort(int session,
long id,
java.io.Serializable context,
java.util.List<TransactionParticipant> members,
boolean recover,
LogEvent evt,
Profiler prof) |
protected void |
abort(TransactionParticipant p,
long id,
java.io.Serializable context) |
protected void |
addGroup(long id,
java.lang.String groupName) |
void |
addListener(TransactionStatusListener l) |
protected void |
checkRetryTask() |
protected void |
checkTail() |
protected void |
commit(int session,
long id,
java.io.Serializable context,
java.util.List<TransactionParticipant> members,
boolean recover,
LogEvent evt,
Profiler prof) |
protected void |
commit(TransactionParticipant p,
long id,
java.io.Serializable context) |
protected void |
commitOff(Space sp) |
protected void |
commitOn(Space sp) |
TransactionParticipant |
createParticipant(org.jdom2.Element e) |
void |
dump(java.io.PrintStream ps,
java.lang.String indent) |
protected FrozenLogEvent |
freeze(java.io.Serializable context,
LogEvent evt,
Profiler prof)
This method gives the opportunity to decorate a LogEvent right before
it gets logged.
|
int |
getActiveSessions() |
int |
getActiveTransactions() |
static <T extends java.io.Serializable> |
getContext() |
boolean |
getDebug() |
boolean |
getDebugContext() |
long |
getHead() |
static java.lang.Long |
getId() |
Space |
getInputSpace() |
long |
getInTransit() |
protected java.lang.String |
getKey(java.lang.String prefix,
long id) |
int |
getMaxSessions() |
Metrics |
getMetrics() |
int |
getOutstandingTransactions() |
protected java.util.List<TransactionParticipant> |
getParticipants(long id) |
protected java.util.List<TransactionParticipant> |
getParticipants(java.lang.String groupName) |
int |
getPausedCounter() |
Space |
getPersistentSpace() |
java.lang.String |
getQueueName() |
static java.io.Serializable |
getSerializable() |
protected int |
getSessionsToStandUp()
This method returns the number of sessions that can be started at this point in time
|
Space |
getSpace() |
long |
getTail() |
TPS |
getTPS() |
java.lang.String |
getTPSAsString() |
float |
getTPSAvg() |
long |
getTPSElapsed() |
int |
getTPSPeak() |
java.util.Date |
getTPSPeakWhen() |
protected long |
initCounter(java.lang.String name,
long defValue) |
protected java.util.List<TransactionParticipant> |
initGroup(org.jdom2.Element e) |
protected void |
initParticipants(org.jdom2.Element config) |
void |
initService() |
protected void |
initStatusListeners(org.jdom2.Element config) |
protected void |
initTailLock() |
protected boolean |
isSessionToStandDown()
This method returns true if current session should stop working on more messages
|
protected long |
nextId() |
protected int |
prepare(int session,
long id,
java.io.Serializable context,
java.util.List<TransactionParticipant> members,
java.util.Iterator<TransactionParticipant> iter,
boolean abort,
LogEvent evt,
Profiler prof) |
protected int |
prepare(TransactionParticipant p,
long id,
java.io.Serializable context) |
protected int |
prepareForAbort(TransactionParticipant p,
long id,
java.io.Serializable context) |
protected void |
purge(long id,
boolean full) |
void |
push(java.io.Serializable context) |
void |
queue(java.io.Serializable context) |
protected void |
recover() |
protected void |
recover(int session,
long id) |
void |
removeListener(TransactionStatusListener l) |
void |
resetTPS() |
void |
run() |
void |
setConfiguration(Configuration cfg) |
void |
setDebug(boolean debug) |
void |
setDebugContext(boolean debugContext) |
protected void |
setState(long id,
java.lang.Integer state) |
protected void |
snapshot(long id,
java.io.Serializable context) |
protected void |
snapshot(long id,
java.io.Serializable context,
java.lang.Integer status) |
void |
startService() |
void |
stopService() |
protected void |
syncTail() |
protected boolean |
tailDone() |
addAttr, close, createElement, destroy, destroyService, getAttrs, getAttrs, getConfiguration, getDump, getFactory, getLoader, getLoaderURLS, getLog, getLogger, getName, getPersist, getProperties, getProperty, getRealm, getScheduledThreadPoolExecutor, getServer, getState, getStateAsString, init, isModified, running, setAttr, setLogger, setModified, setName, setPersist, setProperty, setRealm, setServer, setState, start, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDump, getLoader, getLoaderURLS, getLogger, getName, getRealm, getServer, setLogger, setName, setPersist, setRealm, setServerdestroy, getState, getStateAsString, init, start, stopgetPersist, isModifiedpublic static final java.lang.String HEAD
public static final java.lang.String TAIL
public static final java.lang.String CONTEXT
public static final java.lang.String STATE
public static final java.lang.String GROUPS
public static final java.lang.String TAILLOCK
public static final java.lang.String RETRY_QUEUE
public static final java.lang.Integer PREPARING
public static final java.lang.Integer COMMITTING
public static final java.lang.Integer DONE
public static final java.lang.String DEFAULT_GROUP
public static final long MAX_PARTICIPANTS
public static final long MAX_WAIT
public static final long TIMER_PURGE_INTERVAL
protected java.util.Map<java.lang.String,java.util.List<TransactionParticipant>> groups
public void initService()
throws ConfigurationException
initService in class QBeanSupportConfigurationExceptionpublic void startService()
throws java.lang.Exception
startService in class QBeanSupportjava.lang.Exceptionpublic void stopService()
stopService in class QBeanSupportpublic void queue(java.io.Serializable context)
public void push(java.io.Serializable context)
public java.lang.String getQueueName()
public Space getSpace()
public Space getInputSpace()
public Space getPersistentSpace()
public void run()
run in interface java.lang.Runnablepublic long getTail()
getTail in interface TransactionManagerMBeanpublic long getHead()
getHead in interface TransactionManagerMBeanpublic long getInTransit()
public void setConfiguration(Configuration cfg) throws ConfigurationException
setConfiguration in interface ConfigurablesetConfiguration in class QBeanSupportcfg - Configuration objectConfigurationExceptionpublic void addListener(TransactionStatusListener l)
public void removeListener(TransactionStatusListener l)
public TPS getTPS()
public java.lang.String getTPSAsString()
getTPSAsString in interface TransactionManagerMBeanpublic float getTPSAvg()
getTPSAvg in interface TransactionManagerMBeanpublic int getTPSPeak()
getTPSPeak in interface TransactionManagerMBeanpublic java.util.Date getTPSPeakWhen()
getTPSPeakWhen in interface TransactionManagerMBeanpublic long getTPSElapsed()
getTPSElapsed in interface TransactionManagerMBeanpublic void resetTPS()
resetTPS in interface TransactionManagerMBeanpublic Metrics getMetrics()
getMetrics in interface MetricsProviderpublic void dump(java.io.PrintStream ps,
java.lang.String indent)
protected void commit(int session,
long id,
java.io.Serializable context,
java.util.List<TransactionParticipant> members,
boolean recover,
LogEvent evt,
Profiler prof)
protected void abort(int session,
long id,
java.io.Serializable context,
java.util.List<TransactionParticipant> members,
boolean recover,
LogEvent evt,
Profiler prof)
protected int prepareForAbort(TransactionParticipant p, long id, java.io.Serializable context)
protected int prepare(TransactionParticipant p, long id, java.io.Serializable context)
protected void commit(TransactionParticipant p, long id, java.io.Serializable context)
protected void abort(TransactionParticipant p, long id, java.io.Serializable context)
protected int prepare(int session,
long id,
java.io.Serializable context,
java.util.List<TransactionParticipant> members,
java.util.Iterator<TransactionParticipant> iter,
boolean abort,
LogEvent evt,
Profiler prof)
protected java.util.List<TransactionParticipant> getParticipants(java.lang.String groupName)
protected java.util.List<TransactionParticipant> getParticipants(long id)
protected void initStatusListeners(org.jdom2.Element config)
throws ConfigurationException
ConfigurationExceptionprotected void initParticipants(org.jdom2.Element config)
throws ConfigurationException
ConfigurationExceptionprotected java.util.List<TransactionParticipant> initGroup(org.jdom2.Element e) throws ConfigurationException
ConfigurationExceptionpublic TransactionParticipant createParticipant(org.jdom2.Element e) throws ConfigurationException
ConfigurationExceptionpublic int getOutstandingTransactions()
getOutstandingTransactions in interface TransactionManagerMBeanprotected java.lang.String getKey(java.lang.String prefix,
long id)
protected long initCounter(java.lang.String name,
long defValue)
protected void commitOff(Space sp)
protected void commitOn(Space sp)
protected void syncTail()
protected void initTailLock()
protected void checkTail()
protected boolean tailDone()
protected long nextId()
protected void snapshot(long id,
java.io.Serializable context)
protected void snapshot(long id,
java.io.Serializable context,
java.lang.Integer status)
protected void setState(long id,
java.lang.Integer state)
protected void addGroup(long id,
java.lang.String groupName)
protected void purge(long id,
boolean full)
protected void recover()
protected void recover(int session,
long id)
protected void checkRetryTask()
protected FrozenLogEvent freeze(java.io.Serializable context, LogEvent evt, Profiler prof)
context - current Contextevt - current LogEventprof - profiler (may be null)public void setDebug(boolean debug)
setDebug in interface TransactionManagerMBeanpublic boolean getDebugContext()
getDebugContext in interface TransactionManagerMBeanpublic void setDebugContext(boolean debugContext)
setDebugContext in interface TransactionManagerMBeanpublic boolean getDebug()
getDebug in interface TransactionManagerMBeanprotected int getSessionsToStandUp()
protected boolean isSessionToStandDown()
public int getActiveSessions()
getActiveSessions in interface TransactionManagerMBeanpublic int getPausedCounter()
getPausedCounter in interface TransactionManagerMBeanpublic int getActiveTransactions()
getActiveTransactions in interface TransactionManagerMBeanpublic int getMaxSessions()
getMaxSessions in interface TransactionManagerMBeanpublic static java.io.Serializable getSerializable()
public static <T extends java.io.Serializable> T getContext()
public static java.lang.Long getId()