Package jadex.bridge

Class 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 Detail

      • TIMEOUT

        public static final java.lang.String TIMEOUT
        The timeout constant.
        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.
      • properties

        public java.util.Map<java.lang.String,​java.lang.Object> properties
        The service call properties.
    • 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 class java.lang.Object