|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.curjent.impl.agent.CallInfo
public final class CallInfo
Information for an agent's call site. This follows the prototype model for agent initialization. Information for each unique interface method is collected and cached when an agent's unique proxy factory is created. Each agent instance receives a copy of this call site for custom configuration on a per instance basis.
ProxyFactory.newInstance()
Field Summary | |
---|---|
(package private) CallStateListener<?>[] |
assigned
Configured listeners for each CallState . |
(package private) Controller |
controller
The controller instance for this call site. |
private Object |
data
Client data for this call site. |
(package private) CallStateListener<?>[] |
effective
Effective listeners for each CallState based on the hiearchy of
general to more specific configured listeners. |
(package private) long |
expirationNanos
Call site expirate timeout converted to nanoseconds. |
(package private) long |
expirationTimeout
Call site expiration timeout duration. |
(package private) TimeUnit |
expirationUnit
Call site expiration timeout unit. |
(package private) boolean |
future
true if the agent call is asynchronous and the interface
method returns a Future or AgentCall . |
(package private) Method |
interfaceMethod
The call site's unique interface method. |
(package private) CallStateListener<?> |
listener
Default configured listener for this call site. |
(package private) MarkerType |
markerType
Type of Marker . |
(package private) int |
paramCount
Number of method parameters. |
(package private) boolean |
reentrant
true if the task's method is annotated with
Reentrant . |
(package private) boolean |
synchronous
true if the call is implicitly or explicitly synchronous. |
(package private) boolean |
synthetic
true if this is a non-standard call. |
(package private) Method |
taskMethod
The task's method for this call site. |
Constructor Summary | |
---|---|
CallInfo(Controller controller,
CallInfo prototype)
Creates a new instance for a new agent based on the cached prototype. |
|
CallInfo(MethodInfo info)
Initialization of the cached prototype. |
|
CallInfo(Method interfaceMethod,
Method taskMethod,
MarkerType markerType)
Initialization of a cached prototype for a synthetic marker method. |
Method Summary | |
---|---|
Object |
getAgent()
Returns the front-end object of the agent. |
CallStateListener<?> |
getCallStateListener()
Returns the default listener for the given call site. |
CallStateListener<?> |
getCallStateListener(CallState state)
Returns a call site's listener for a given state. |
Object |
getData()
Returns the caller's data associated with this call site. |
long |
getExpirationTimeout()
Returns the call site's default expiration timeout. |
TimeUnit |
getExpirationTimeoutUnit()
Returns the call site's default expiration timeout unit. |
Method |
getInterfaceMethod()
Returns this call site's interface method. |
MarkerType |
getMarkerType()
Type of Marker . |
Method |
getTaskMethod()
Returns this call site's task method. |
boolean |
isFuture()
true if an asynchronous call and the interface returns
Future or AgentCall . |
boolean |
isReentrant()
true if task method is Reentrant . |
boolean |
isSynchronous()
true if an implicitly or explicitly synchronous call. |
boolean |
isSynthetic()
true if this is a non-standard call. |
void |
setCallStateListener(CallState state,
CallStateListener<?> listener)
Sets a call site's listener for a given state and updates its effective listeners. |
void |
setCallStateListener(CallStateListener<?> listener)
Sets the default listener for the given call site and updates its effective listeners. |
void |
setData(Object data)
Sets the caller's data associated with this call site. |
void |
setExpirationTimeout(long value,
TimeUnit unit)
Sets the call site's default expiration timeout. |
String |
toString()
Returns a description of this call site's interface method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
final Controller controller
null
for the
prototype instance saved with the proxy cache. Initialized in the
prototype's copy to the owning controller for each agent instance.
final Method interfaceMethod
final Method taskMethod
final MarkerType markerType
Marker
. null
for a non-marker call.
final int paramCount
final boolean future
true
if the agent call is asynchronous and the interface
method returns a Future
or AgentCall
.
final boolean synchronous
true
if the call is implicitly or explicitly synchronous.
final boolean reentrant
true
if the task's method is annotated with
Reentrant
.
final boolean synthetic
true
if this is a non-standard call.
long expirationTimeout
Long.MAX_VALUE
unless and until this call site is annotated
with an expiration timeout or configured at runtime.
TimeUnit expirationUnit
TimeUnit.NANOSECONDS
unless and until this call site is
annotated with an expiration timeout or configured at runtime.
long expirationNanos
Expirations.NIL
unless and until the expiration is configured
via an annotation or configuration call.
CallStateListener<?> listener
null
.
final CallStateListener<?>[] assigned
CallState
. Each is initially
null
. Not used in the cached prototype instance.
final CallStateListener<?>[] effective
CallState
based on the hiearchy of
general to more specific configured listeners. Each is initially
null
. Not used in the cached prototype instance.
private Object data
Constructor Detail |
---|
CallInfo(MethodInfo info)
CallInfo(Method interfaceMethod, Method taskMethod, MarkerType markerType)
CallInfo(Controller controller, CallInfo prototype)
Method Detail |
---|
public Object getAgent()
getAgent
in interface CallSite
Agent.newInstance(AgentLoader, Class[], AgentTasks, Class)
public Method getInterfaceMethod()
getInterfaceMethod
in interface CallSite
public Method getTaskMethod()
getTaskMethod
in interface CallSite
public boolean isFuture()
true
if an asynchronous call and the interface returns
Future
or AgentCall
.
isFuture
in interface CallSite
public boolean isSynchronous()
true
if an implicitly or explicitly synchronous call.
isSynchronous
in interface CallSite
public MarkerType getMarkerType()
Marker
. null
for non-marker calls.
getMarkerType
in interface CallSite
public boolean isReentrant()
true
if task method is Reentrant
.
isReentrant
in interface CallSite
public boolean isSynthetic()
true
if this is a non-standard call.
isSynthetic
in interface CallSite
public long getExpirationTimeout()
getExpirationTimeout
in interface CallSite
Expirations.getExpirationTimeout(CallInfo)
public TimeUnit getExpirationTimeoutUnit()
getExpirationTimeoutUnit
in interface CallSite
Expirations.getExpirationTimeoutUnit(CallInfo)
public void setExpirationTimeout(long value, TimeUnit unit)
setExpirationTimeout
in interface CallSite
Expirations.setExpirationTimeout(CallInfo, long, TimeUnit)
public CallStateListener<?> getCallStateListener()
getCallStateListener
in interface CallSite
CallSite.getCallStateListener()
public void setCallStateListener(CallStateListener<?> listener)
setCallStateListener
in interface CallSite
CallSite.setCallStateListener(CallStateListener)
public CallStateListener<?> getCallStateListener(CallState state)
getCallStateListener
in interface CallSite
CallSite.getCallStateListener(CallState)
public void setCallStateListener(CallState state, CallStateListener<?> listener)
setCallStateListener
in interface CallSite
CallSite.setCallStateListener(CallStateListener)
public Object getData()
getData
in interface CallSite
CallSite.setData(Object)
public void setData(Object data)
setData
in interface CallSite
AgentConfig.setData(Object)
,
AgentCall.setData(Object)
public String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |