|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.curjent.impl.agent.MarkCall
public final class MarkCall
Implementation for configuring synthetic marks. This class is not loaded unless synthetic marks are used, and most data structures are lazily initialized on first use.
Prototype call sites are initialized and stored in this class, but runtime call sites are lazily initialized and stored in each agent. This is consistent with standard call sites which are configured per agent instance.
Agent.mark(Object)
Field Summary | |
---|---|
private CallStateListener<Void>[] |
assigned
Call state listeners. |
private Controller |
controller
The agent's controller. |
private CallStateListener<Void> |
listener
Default call listener. |
private static HashMap<MarkerType,CallInfo> |
markerPrototype
Map of marker types to prototype call sites for each synthetic interface and task method specific to marks. |
private MarkerType |
markerType
The type of marker send to the agent. |
Constructor Summary | |
---|---|
MarkCall(Proxy proxy)
Saves the proxy's controller to controller for later use by
call() . |
Method Summary | |
---|---|
private static void |
addMarker(MarkerType marker,
String method)
Initializes a prototype call site and adds it to markerPrototype . |
static boolean |
await(Proxy proxy,
long timeout,
TimeUnit unit)
Helper method for Agent.await(Object) and related methods. |
AgentCall<Void> |
call()
Creates and initializes a new synthetic message with the current configuration settings. |
static Message |
call(Proxy proxy)
Helper method for Agent.await(Object) and related methods. |
CallStateListener<Void> |
getCallStateListener()
Returns the default call state listener or null if none. |
CallStateListener<Void> |
getCallStateListener(CallState state)
Returns a call state listener or null if none. |
MarkerType |
getMarkerType()
Returns the (possibly null ) marker type. |
private static CallInfo |
getSyntheticSite(Controller controller,
CallInfo prototype)
Returns configuration settings for an agent's synthetic method. |
private static Message |
newMessage(Controller controller,
MarkerType marker)
Creates and returns a new synthetic message for the given type of marker. |
private static void |
send(Message message)
Sends the given message to its controller and wraps checked exceptions. |
void |
setCallStateListener(CallState state,
CallStateListener<Void> listener)
Sets or clears a call state listener. |
void |
setCallStateListener(CallStateListener<Void> listener)
Sets or clears the default call state listener. |
void |
setMarkerType(MarkerType markerType)
Sets or clears the marker type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final HashMap<MarkerType,CallInfo> markerPrototype
private final Controller controller
call()
and sent to the controller. Runtime call sites are also
stored in the controller.
Controller.send(Message)
private MarkerType markerType
null
for
standard, non-marker calls.
private CallStateListener<Void> listener
call()
prior to sending the call to the agent's controller.
AgentCall.setCallStateListener(CallStateListener)
private CallStateListener<Void>[] assigned
call()
prior to sending the call to the agent's controller.
AgentCall.setCallStateListener(CallState, CallStateListener)
Constructor Detail |
---|
public MarkCall(Proxy proxy)
controller
for later use by
call()
.
Agent.mark(Object)
Method Detail |
---|
private static void addMarker(MarkerType marker, String method) throws Throwable
markerPrototype
.
Throwable
private static Message newMessage(Controller controller, MarkerType marker)
markerPrototype
and defers
creation of the runtime call site to the given controller.
getSyntheticSite(Controller, CallInfo)
private static CallInfo getSyntheticSite(Controller controller, CallInfo prototype)
public static Message call(Proxy proxy)
Agent.await(Object)
and related methods. It
avoids unnecessary creation and configuration of an instance of
MarkCall
since the await
methods use the
default settings.
public static boolean await(Proxy proxy, long timeout, TimeUnit unit) throws InterruptedException
Agent.await(Object)
and related methods. It
avoids unnecessary creation and configuration of instances of
MarkCall
and MessageCall
since the
await
methods use the default settings.
InterruptedException
private static void send(Message message)
public AgentCall<Void> call()
call
in interface AgentMark
public MarkerType getMarkerType()
null
) marker type.
getMarkerType
in interface AgentMark
public void setMarkerType(MarkerType markerType)
call()
.
setMarkerType
in interface AgentMark
public CallStateListener<Void> getCallStateListener()
null
if none.
getCallStateListener
in interface AgentMark
AgentCall.getCallStateListener()
public void setCallStateListener(CallStateListener<Void> listener)
call()
.
setCallStateListener
in interface AgentMark
AgentCall.setCallStateListener(CallStateListener)
public CallStateListener<Void> getCallStateListener(CallState state)
null
if none.
getCallStateListener
in interface AgentMark
AgentCall.getCallStateListener(CallState)
public void setCallStateListener(CallState state, CallStateListener<Void> listener)
call()
.
setCallStateListener
in interface AgentMark
AgentCall.setCallStateListener(CallState, CallStateListener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |