Package jadex.bridge
Class ServiceCall
- java.lang.Object
-
- jadex.bridge.ServiceCall
-
- Direct Known Subclasses:
CallAccess
public class ServiceCall extends java.lang.ObjectInformation about a current service call. Similar to a ThreadLocal in Java but for service calls, i.e. between different threads and hosts available.
-
-
Field Summary
Fields Modifier and Type Field Description IComponentIdentifiercallerThe calling component.protected static java.lang.ThreadLocal<ServiceCall>CURRENTThe current service calls mapped to threads.static java.lang.StringDEFTIMEOUTstatic java.lang.StringINHERITThe inherit constant.protected static java.lang.ThreadLocal<ServiceCall>LASTThe upcoming service invocations.IComponentIdentifierlastmodstatic java.lang.StringMONITORINGThe monitoring constant.protected static java.lang.ThreadLocal<ServiceCall>NEXTThe upcoming service invocations.java.util.Map<java.lang.String,java.lang.Object>propertiesThe service call properties.static java.lang.StringREALTIMEThe realtime constant.static java.lang.StringSECURITY_INFOSThe security infos constant.static java.lang.StringTIMEOUTThe timeout constant.
-
Constructor Summary
Constructors Modifier Constructor Description protectedServiceCall(IComponentIdentifier caller, java.util.Map<java.lang.String,java.lang.Object> props)Create a service call info object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static ServiceCallcreateServiceCall(IComponentIdentifier caller, java.util.Map<java.lang.String,java.lang.Object> props)Create a service call.IComponentIdentifiergetCaller()Get the caller component.static ServiceCallgetCurrentInvocation()Get the service call instance corresponding to the current execution context.static ServiceCallgetLastInvocation()Get the last service call instance corresponding to the current execution context.static ServiceCallgetNextInvocation()Get the invocation data for the next service call.static ServiceCallgetOrCreateNextInvocation()Set the properties of the next invocation.static ServiceCallgetOrCreateNextInvocation(java.util.Map<java.lang.String,java.lang.Object> props)Get or create the next servicecall for the next invocation.java.util.Map<java.lang.String,java.lang.Object>getProperties()Get a property.java.lang.ObjectgetProperty(java.lang.String name)Get a property.longgetTimeout()Get the timeout value.booleanhasUserTimeout()Test if the user has set a timeout.booleanisRemoteCall(IComponentIdentifier callee)Test if a call is remote.voidremoveProperty(java.lang.String name)Remove a property.voidsetProperty(java.lang.String name, java.lang.Object val)Set a property.voidsetTimeout(long to)Set the timeout.java.lang.StringtoString()Get the string represntation.
-
-
-
Field Detail
-
TIMEOUT
public static final java.lang.String TIMEOUT
The timeout constant.- See Also:
- Constant Field Values
-
DEFTIMEOUT
public static final java.lang.String DEFTIMEOUT
- See Also:
- Constant Field Values
-
REALTIME
public static final java.lang.String REALTIME
The realtime constant.- See Also:
- Constant Field Values
-
MONITORING
public static final java.lang.String MONITORING
The monitoring constant.- See Also:
- Constant Field Values
-
INHERIT
public static final java.lang.String INHERIT
The inherit constant.- See Also:
- Constant Field Values
-
SECURITY_INFOS
public static final java.lang.String SECURITY_INFOS
The security infos constant.- See Also:
- Constant Field Values
-
CURRENT
protected static final java.lang.ThreadLocal<ServiceCall> CURRENT
The current service calls mapped to threads.
-
NEXT
protected static final java.lang.ThreadLocal<ServiceCall> NEXT
The upcoming service invocations.
-
LAST
protected static final java.lang.ThreadLocal<ServiceCall> LAST
The upcoming service invocations.
-
caller
public IComponentIdentifier caller
The calling component.
-
properties
public java.util.Map<java.lang.String,java.lang.Object> properties
The service call properties.
-
lastmod
public IComponentIdentifier lastmod
-
-
Constructor Detail
-
ServiceCall
protected ServiceCall(IComponentIdentifier caller, java.util.Map<java.lang.String,java.lang.Object> props)
Create a service call info object.
-
-
Method Detail
-
createServiceCall
protected static ServiceCall createServiceCall(IComponentIdentifier caller, java.util.Map<java.lang.String,java.lang.Object> props)
Create a service call.
-
getNextInvocation
public static ServiceCall getNextInvocation()
Get the invocation data for the next service call.
-
getCurrentInvocation
public static ServiceCall getCurrentInvocation()
Get the service call instance corresponding to the current execution context.- Returns:
- The service call instance or null.
-
getLastInvocation
public static ServiceCall getLastInvocation()
Get the last service call instance corresponding to the current execution context.- Returns:
- The service call instance or null.
-
getOrCreateNextInvocation
public static ServiceCall getOrCreateNextInvocation()
Set the properties of the next invocation.- Parameters:
timeout- The timeout.realtime- The realtime flag.
-
getOrCreateNextInvocation
public static ServiceCall getOrCreateNextInvocation(java.util.Map<java.lang.String,java.lang.Object> props)
Get or create the next servicecall for the next invocation.- Parameters:
timeout- The timeout.realtime- The realtime flag.
-
getCaller
public IComponentIdentifier getCaller()
Get the caller component.- Returns:
- The caller component.
-
getTimeout
public long getTimeout()
Get the timeout value.- Returns:
- The timeout value or -1.
-
hasUserTimeout
public boolean hasUserTimeout()
Test if the user has set a timeout.- Returns:
- True, if the user has set a timeout.
-
setTimeout
public void setTimeout(long to)
Set the timeout.- Parameters:
to- The timeout.
-
isRemoteCall
public boolean isRemoteCall(IComponentIdentifier callee)
Test if a call is remote.
-
getProperty
public java.lang.Object getProperty(java.lang.String name)
Get a property.- Parameters:
name- The property name.- Returns:
- The property.
-
setProperty
public void setProperty(java.lang.String name, java.lang.Object val)Set a property.- Parameters:
name- The property name.val- The property value.
-
removeProperty
public void removeProperty(java.lang.String name)
Remove a property.- Parameters:
name- The property name.
-
getProperties
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
Get a property.- Parameters:
name- The property name.- Returns:
- The property.
-
toString
public java.lang.String toString()
Get the string represntation.- Overrides:
toStringin classjava.lang.Object
-
-