public class SynapseDebugManager extends Object implements Observer
Modifier and Type | Field and Description |
---|---|
static Semaphore |
mediationFlowSem |
Modifier | Constructor and Description |
---|---|
protected |
SynapseDebugManager() |
Modifier and Type | Method and Description |
---|---|
void |
acquireMediationFlowLock()
Acquiring hold on this lock make sure that only one mediation flow
is due inside mediation engine
|
void |
acquireMediationFlowPointProperties(String propertyOrProperties,
String propertyContext,
org.codehaus.jettison.json.JSONObject property_arguments) |
void |
addMediationFlowPointProperty(String propertyContext,
org.codehaus.jettison.json.JSONObject property_arguments,
boolean isActionSet) |
void |
advertiseCommandResponse(String commandResponse) |
void |
advertiseDebugEvent(String event) |
void |
advertiseMediationFlowBreakPoint(MessageContext synCtx,
SynapseMediationFlowPoint breakPoint)
advertise a mediation breakpoint to the communication channel
|
void |
advertiseMediationFlowSkip(MessageContext synCtx,
SynapseMediationFlowPoint skipPoint)
advertise a mediation skip to the communication channel
|
void |
advertiseMediationFlowStartPoint(MessageContext synCtx)
Related to advertising the point where mediation flow starts.
|
void |
advertiseMediationFlowTerminatePoint(MessageContext synCtx)
related to advertising mediation flow terminating point to the communication channel
|
org.codehaus.jettison.json.JSONObject |
createDebugCommandResponse(boolean isPositive,
String failedReason) |
org.codehaus.jettison.json.JSONObject |
createDebugEvent(String eventString) |
org.codehaus.jettison.json.JSONObject |
createDebugMediationFlowPointHitEvent(boolean isBreakpoint,
SynapseMediationFlowPoint point) |
org.codehaus.jettison.json.JSONObject |
createDebugMediationFlowPointJSONForWireLogs(SynapseMediationFlowPoint point)
This method is to generate json string which can be used to identify mediator position for wire logs
|
void |
debugResume() |
protected org.codehaus.jettison.json.JSONObject |
getAxis2Properties() |
static SynapseDebugManager |
getInstance() |
void |
init(SynapseConfiguration synCfg,
SynapseDebugInterface debugInterface,
SynapseEnvironment synEnv,
boolean startListenAsynchronously)
Initializes the debug manager single instance.
|
protected String |
logMediatorPosition(SynapseMediationFlowPoint flowPoint) |
void |
processDebugCommand(String debug_line)
handles main command processing in using line of string received from the command channel
registering/un registering breakpoints and skips as well as mediation level data acquire or set
strings are expected to be JSON over defined protocol
|
void |
registerMediationFlowPoint(String mediation_component,
org.codehaus.jettison.json.JSONObject med_component_arguments,
boolean isBreakpoint,
boolean registerMode)
handles registering/un registering breakpoints and skips as well as mediation level data acquire or set
|
void |
releaseMediationFlowLock()
Releasing hold on this lock make sure that next mediation flow is started after
completion of the previous
|
void |
setMessageContext(MessageContext synCtx) |
void |
shutdownDebugManager()
Shutdown debug manager instance and close communication channels for event and command.
|
protected String |
toString(int[] position) |
void |
transitMediationFlowStateToActive()
Transit the mediation flow state to the ACTIVE from previous UNKNOWN state
Transiting to ACTIVE state will put the calling thread awakes as sem.up() is called
|
void |
transitMediationFlowStateToSuspended()
Transit the mediation flow state to the SUSPENDED from previous UNKNOWN state
Transiting to SUSPENDED state will put the calling thread to sleep as sem.down() is called
|
void |
update(Observable o,
Object arg) |
public static volatile Semaphore mediationFlowSem
public static SynapseDebugManager getInstance()
public void setMessageContext(MessageContext synCtx)
public void init(SynapseConfiguration synCfg, SynapseDebugInterface debugInterface, SynapseEnvironment synEnv, boolean startListenAsynchronously)
synCfg
- reference to Synapse configurationdebugInterface
- reference to interface which environment communicatessynEnv
- reference to environmentstartListenAsynchronously
- start interacting with interface asynchronouslypublic void acquireMediationFlowLock()
public void releaseMediationFlowLock()
public void shutdownDebugManager()
public void transitMediationFlowStateToSuspended()
public void transitMediationFlowStateToActive()
public void advertiseMediationFlowStartPoint(MessageContext synCtx)
synCtx
- message contextpublic void advertiseMediationFlowTerminatePoint(MessageContext synCtx)
synCtx
- message contextpublic void advertiseMediationFlowSkip(MessageContext synCtx, SynapseMediationFlowPoint skipPoint)
skipPoint
- describes a unique point in the mediation flowsynCtx
- message contextpublic void advertiseMediationFlowBreakPoint(MessageContext synCtx, SynapseMediationFlowPoint breakPoint)
breakPoint
- describes a unique point in the mediation flowsynCtx
- message contextprotected String logMediatorPosition(SynapseMediationFlowPoint flowPoint)
public void processDebugCommand(String debug_line) throws IOException
debug_line
- string in JSON format which is communicated via command channelIOException
public void registerMediationFlowPoint(String mediation_component, org.codehaus.jettison.json.JSONObject med_component_arguments, boolean isBreakpoint, boolean registerMode)
mediation_component
- sequence connector or either templatemed_component_arguments
- defines mediation componentisBreakpoint
- either breakpoint or skipregisterMode
- either register or un registerpublic void advertiseCommandResponse(String commandResponse)
public void advertiseDebugEvent(String event)
public void debugResume()
public org.codehaus.jettison.json.JSONObject createDebugCommandResponse(boolean isPositive, String failedReason)
public org.codehaus.jettison.json.JSONObject createDebugMediationFlowPointHitEvent(boolean isBreakpoint, SynapseMediationFlowPoint point)
public org.codehaus.jettison.json.JSONObject createDebugMediationFlowPointJSONForWireLogs(SynapseMediationFlowPoint point)
point
- public org.codehaus.jettison.json.JSONObject createDebugEvent(String eventString)
protected String toString(int[] position)
public void acquireMediationFlowPointProperties(String propertyOrProperties, String propertyContext, org.codehaus.jettison.json.JSONObject property_arguments) throws IOException
IOException
protected org.codehaus.jettison.json.JSONObject getAxis2Properties() throws org.codehaus.jettison.json.JSONException, IOException
org.codehaus.jettison.json.JSONException
IOException
public void addMediationFlowPointProperty(String propertyContext, org.codehaus.jettison.json.JSONObject property_arguments, boolean isActionSet)
public void update(Observable o, Object arg)
Copyright © 2005–2019 Apache Software Foundation. All rights reserved.