Package jadex.bridge
Class ServiceCall
- java.lang.Object
-
- jadex.bridge.ServiceCall
-
- Direct Known Subclasses:
CallAccess
public class ServiceCall extends java.lang.Object
Information 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 IComponentIdentifier
caller
The calling component.protected static java.lang.ThreadLocal<ServiceCall>
CURRENT
The current service calls mapped to threads.static java.lang.String
DEFTIMEOUT
static java.lang.String
INHERIT
The inherit constant.protected static java.lang.ThreadLocal<ServiceCall>
LAST
The upcoming service invocations.IComponentIdentifier
lastmod
static java.lang.String
MONITORING
The monitoring constant.protected static java.lang.ThreadLocal<ServiceCall>
NEXT
The upcoming service invocations.java.util.Map<java.lang.String,java.lang.Object>
properties
The service call properties.static java.lang.String
REALTIME
The realtime constant.static java.lang.String
SECURITY_INFOS
The security infos constant.static java.lang.String
TIMEOUT
The timeout constant.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ServiceCall(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 ServiceCall
createServiceCall(IComponentIdentifier caller, java.util.Map<java.lang.String,java.lang.Object> props)
Create a service call.IComponentIdentifier
getCaller()
Get the caller component.static ServiceCall
getCurrentInvocation()
Get the service call instance corresponding to the current execution context.static ServiceCall
getLastInvocation()
Get the last service call instance corresponding to the current execution context.static ServiceCall
getNextInvocation()
Get the invocation data for the next service call.static ServiceCall
getOrCreateNextInvocation()
Set the properties of the next invocation.static ServiceCall
getOrCreateNextInvocation(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.Object
getProperty(java.lang.String name)
Get a property.long
getTimeout()
Get the timeout value.boolean
hasUserTimeout()
Test if the user has set a timeout.boolean
isRemoteCall(IComponentIdentifier callee)
Test if a call is remote.void
removeProperty(java.lang.String name)
Remove a property.void
setProperty(java.lang.String name, java.lang.Object val)
Set a property.void
setTimeout(long to)
Set the timeout.java.lang.String
toString()
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:
toString
in classjava.lang.Object
-
-