@Singleton public class CallTraceServiceImpl extends Object implements CallTraceService
Modifier and Type | Class and Description |
---|---|
static class |
CallTraceServiceImpl.ActivityUnitCursor
This class provides a cursor for working through the
activity types associated with the unit.
|
static class |
CallTraceServiceImpl.CTState
This class maintains state information associated with the
derivation of a call trace.
|
Constructor and Description |
---|
CallTraceServiceImpl() |
Modifier and Type | Method and Description |
---|---|
protected static void |
checkForLinkedAU(ActivityType cur,
CallTraceServiceImpl.CTState state,
ActivityUnit au,
List<ActivityUnit> topLevel)
This method checks whether there is a linked context.
|
protected void |
commitTxn()
This method commits the transaction.
|
protected static Call |
createCall(RPCActivityType at)
This method returns a call node associated with the supplied
activity event.
|
CallTrace |
createCallTrace(Context context)
This method creates a call trace associated with the
supplied correlation value.
|
protected static Task |
createTask(ActivityType at)
This method returns a task associated with the supplied
activity event.
|
ActivityServer |
getActivityServer()
This method gets the activity server.
|
protected static TraceNode.Status |
getStatus(ActivityType at)
This method determines the status for the supplied
activity type.
|
protected static List<ActivityUnit> |
getTopLevelAUs(CallTraceServiceImpl.CTState state)
This method identifies the top level activity units that
contain receive request activities, with no corresponding
send request.
|
protected static void |
initializeResponseReceived(CallTraceServiceImpl.CTState state,
ResponseReceived rr)
This method initializes the call details based on current
state and the supplied response received event.
|
protected static void |
initializeResponseSent(CallTraceServiceImpl.CTState state,
ResponseSent rs,
Call call)
This method initializes the call details based on current
state and the supplied response sent.
|
protected static void |
initPercentages(long duration,
TraceNode node)
This method initializes the percentages related to the
supplied trace node, traversing the tree structure if
appropriate.
|
protected static void |
instrumentCall(Call call,
ActivityUnit au,
RPCActivityType at)
This method adds client or server specific information to the call,
depending upon whether the activity is the client sending or server
receiving the interaction.
|
protected void |
loadActivityUnits(CallTraceServiceImpl.CTState state,
Context context,
ActivityType actType)
This method loads activity units associated with the supplied
correlation key.
|
protected static void |
processAU(CallTraceServiceImpl.CTState state,
ActivityUnit startau,
List<ActivityUnit> topLevel)
This method processes the supplied activity unit to
create a set of trace nodes.
|
protected static CallTrace |
processAUs(CallTraceServiceImpl.CTState state)
This method processes the supplied call trace state
to return the call trace model.
|
protected static boolean |
processSubsequentAU(ActivityUnit previous,
ActivityUnit subsequent)
This method determines whether the subsequent activity unit should be processed
following the previous activity unit.
|
protected void |
rollbackTxn()
This method rolls back the transaction.
|
void |
setActivityServer(ActivityServer as)
This method sets the activity server.
|
protected static boolean |
shouldPostpone(CallTraceServiceImpl.CTState state,
ActivityUnit au,
List<ActivityUnit> topLevel,
ActivityType cur)
This method identifies whether processing should be postponed
based on the current activity type.
|
protected boolean |
startTxn()
This method starts the transaction.
|
public void setActivityServer(ActivityServer as)
setActivityServer
in interface CallTraceService
as
- The activity serverpublic ActivityServer getActivityServer()
getActivityServer
in interface CallTraceService
protected boolean startTxn() throws Exception
Exception
- Failed to start txnprotected void commitTxn() throws Exception
Exception
- Failed to commitprotected void rollbackTxn() throws Exception
Exception
- Failed to rollbackpublic CallTrace createCallTrace(Context context) throws Exception
createCallTrace
in interface CallTraceService
context
- The context valueException
- Failed to create call traceprotected void loadActivityUnits(CallTraceServiceImpl.CTState state, Context context, ActivityType actType)
state
- The statecontext
- The contextactType
- The activity typeprotected static CallTrace processAUs(CallTraceServiceImpl.CTState state)
state
- The stateprotected static void initPercentages(long duration, TraceNode node)
duration
- The parent durationnode
- The nodeprotected static void processAU(CallTraceServiceImpl.CTState state, ActivityUnit startau, List<ActivityUnit> topLevel)
state
- The statestartau
- The activity unit being processedtopLevel
- The top level activity unitsprotected static void checkForLinkedAU(ActivityType cur, CallTraceServiceImpl.CTState state, ActivityUnit au, List<ActivityUnit> topLevel)
cur
- The current activity typestate
- The stateau
- The activity unittopLevel
- The list of top level activity unitsprotected static boolean processSubsequentAU(ActivityUnit previous, ActivityUnit subsequent)
previous
- The previously processed activity unitsubsequent
- The subsequent activity unit to assessprotected static void initializeResponseSent(CallTraceServiceImpl.CTState state, ResponseSent rs, Call call)
state
- The staters
- The response sent eventcall
- The callprotected static void initializeResponseReceived(CallTraceServiceImpl.CTState state, ResponseReceived rr)
state
- The staterr
- The response received eventprotected static boolean shouldPostpone(CallTraceServiceImpl.CTState state, ActivityUnit au, List<ActivityUnit> topLevel, ActivityType cur)
state
- The stateau
- The activity unittopLevel
- The top level unitscur
- The current activity typeprotected static Call createCall(RPCActivityType at)
at
- The activity eventprotected static void instrumentCall(Call call, ActivityUnit au, RPCActivityType at)
call
- The callau
- The activity unitat
- The activity typeprotected static Task createTask(ActivityType at)
at
- The activity eventprotected static TraceNode.Status getStatus(ActivityType at)
at
- The activity typeprotected static List<ActivityUnit> getTopLevelAUs(CallTraceServiceImpl.CTState state)
state
- The stateCopyright © 2013-2015 JBoss by Red Hat. All Rights Reserved.