Class ComponentSuspendable

    • Field Detail

      • COMSUPS

        public static final java.lang.ThreadLocal<ComponentSuspendable> COMSUPS
        The component suspendables.
      • future

        protected Future<?> future
        The current future.
      • vals

        protected java.util.Map<java.lang.ThreadLocal<java.lang.Object>,​java.lang.Object> vals
        The thread locals.
    • Constructor Detail

      • ComponentSuspendable

        public ComponentSuspendable​(IInternalAccess agent)
        Create a component suspendable.
    • Method Detail

      • suspend

        public void suspend​(Future<?> future,
                            long timeout,
                            boolean realtime)
        Suspend the execution of the suspendable.
        Specified by:
        suspend in interface ISuspendable
        Parameters:
        future - The future to wait for.
        timeout - The timeout.
        realtime - Flag if timeout is realtime (in contrast to simulation time).
      • resume

        public void resume​(Future<?> future)
        Resume the execution of the suspendable.
        Specified by:
        resume in interface ISuspendable
        Parameters:
        future - The future that issues the resume.
      • getMonitor

        public java.lang.Object getMonitor()
        Get the monitor for waiting.
        Specified by:
        getMonitor in interface ISuspendable
        Returns:
        The monitor.
      • getFuture

        public Future<?> getFuture()
        Get the future.
        Returns:
        The future.
      • getDefaultTimeout

        public long getDefaultTimeout()
        Get the default timeout.
        Returns:
        The default timeout (-1 for none).
      • toString

        public java.lang.String toString()
        Get the string representation.
        Overrides:
        toString in class java.lang.Object