Class ArgumentsResultsComponentFeature

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<java.lang.String,​java.lang.Object> arguments
      The arguments.
      protected boolean notified
      Flag to remember when an exception was notified to a listener.
      protected java.util.Set<jadex.commons.future.SubscriptionIntermediateFuture<jadex.commons.Tuple2<java.lang.String,​java.lang.Object>>> resfuts
      The result subscription, if any.
      protected java.util.Map<java.lang.String,​java.lang.Object> results
      The results.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doCleanup()
      Perform cleanup in shutdown or kill.
      boolean exceptionNotified()
      Check if there is somebody waiting for this component to finish.
      java.lang.Object fetchValue​(java.lang.String name)
      Fetch the arguments.
      java.lang.Object get​(java.lang.Object key)
      Provide default values for basic types, if not set.
      java.util.Map<java.lang.String,​java.lang.Object> getArguments()
      Get the arguments.
      jadex.commons.future.IFuture<java.util.Map<java.lang.String,​java.lang.Object>> getArgumentsAsync()
      Get the arguments.
      jadex.commons.future.IFuture<java.lang.Exception> getExceptionAsync()
      Get the exception, if any.
      java.util.Map<java.lang.String,​java.lang.Object> getResults()
      Get the current results.
      jadex.commons.future.IFuture<java.util.Map<java.lang.String,​java.lang.Object>> getResultsAsync()
      Get the current results.
      static java.lang.String getReverseName​(java.lang.String dotname)
      Get the reverse name of a dot name (component id).
      jadex.commons.IValueFetcher getValueFetcher()
      The feature can inject parameters for expression evaluation by providing an optional value fetcher.
      boolean hasUserBody()
      Check if the feature potentially executed user code in body.
      jadex.commons.future.IFuture<java.lang.Void> init()
      Initialize the feature.
      protected void initDefaultArguments()
      Init unset arguments from default values.
      protected void initDefaultResults()
      Init unset results from default values.
      void kill()
      Kill is only invoked, when shutdown of some (e.g.
      protected void postEvent​(java.lang.String result, java.lang.Object value)
      Post an event to subscribed listeners.
      jadex.commons.future.IFuture<java.lang.Void> shutdown()
      Shutdown the feature.
      jadex.commons.future.ISubscriptionIntermediateFuture<jadex.commons.Tuple2<java.lang.String,​java.lang.Object>> subscribeToResults()
      Subscribe to receive results.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • arguments

        protected java.util.Map<java.lang.String,​java.lang.Object> arguments
        The arguments.
      • results

        protected java.util.Map<java.lang.String,​java.lang.Object> results
        The results.
      • resfuts

        protected java.util.Set<jadex.commons.future.SubscriptionIntermediateFuture<jadex.commons.Tuple2<java.lang.String,​java.lang.Object>>> resfuts
        The result subscription, if any.
      • notified

        protected boolean notified
        Flag to remember when an exception was notified to a listener.
    • Method Detail

      • getReverseName

        public static java.lang.String getReverseName​(java.lang.String dotname)
        Get the reverse name of a dot name (component id).
        Returns:
        The reverse name as string.
      • hasUserBody

        public boolean hasUserBody()
        Check if the feature potentially executed user code in body. Allows blocking operations in user bodies by using separate steps for each feature. Non-user-body-features are directly executed for speed. If unsure just return true. ;-)
        Specified by:
        hasUserBody in interface IComponentFeature
        Overrides:
        hasUserBody in class AbstractComponentFeature
      • initDefaultArguments

        protected void initDefaultArguments()
        Init unset arguments from default values.
      • initDefaultResults

        protected void initDefaultResults()
        Init unset results from default values.
      • kill

        public void kill()
        Kill is only invoked, when shutdown of some (e.g. other) feature does not return due to timeout. The feature should do any kind of possible cleanup, but no asynchronous operations.
        Specified by:
        kill in interface IComponentFeature
        Overrides:
        kill in class AbstractComponentFeature
      • doCleanup

        protected void doCleanup()
        Perform cleanup in shutdown or kill.
      • getValueFetcher

        public jadex.commons.IValueFetcher getValueFetcher()
        The feature can inject parameters for expression evaluation by providing an optional value fetcher. The fetch order is the reverse init order, i.e., later features can override values from earlier features.
        Specified by:
        getValueFetcher in interface IComponentFeature
        Overrides:
        getValueFetcher in class AbstractComponentFeature
      • fetchValue

        public java.lang.Object fetchValue​(java.lang.String name)
        Fetch the arguments.
        Specified by:
        fetchValue in interface jadex.commons.IValueFetcher
      • get

        public java.lang.Object get​(java.lang.Object key)
        Provide default values for basic types, if not set.
        Specified by:
        get in interface jadex.javaparser.IMapAccess
      • getArguments

        public java.util.Map<java.lang.String,​java.lang.Object> getArguments()
        Get the arguments.
        Specified by:
        getArguments in interface IArgumentsResultsFeature
        Returns:
        The arguments.
      • getResults

        public java.util.Map<java.lang.String,​java.lang.Object> getResults()
        Get the current results.
        Specified by:
        getResults in interface IArgumentsResultsFeature
        Returns:
        The current result values (if any).
      • getArgumentsAsync

        public jadex.commons.future.IFuture<java.util.Map<java.lang.String,​java.lang.Object>> getArgumentsAsync()
        Get the arguments.
        Specified by:
        getArgumentsAsync in interface IExternalArgumentsResultsFeature
        Returns:
        The arguments.
      • getResultsAsync

        public jadex.commons.future.IFuture<java.util.Map<java.lang.String,​java.lang.Object>> getResultsAsync()
        Get the current results.
        Specified by:
        getResultsAsync in interface IExternalArgumentsResultsFeature
        Returns:
        The current result values (if any).
      • getExceptionAsync

        public jadex.commons.future.IFuture<java.lang.Exception> getExceptionAsync()
        Get the exception, if any.
        Specified by:
        getExceptionAsync in interface IExternalArgumentsResultsFeature
        Returns:
        The failure reason for use during cleanup, if any.
      • subscribeToResults

        public jadex.commons.future.ISubscriptionIntermediateFuture<jadex.commons.Tuple2<java.lang.String,​java.lang.Object>> subscribeToResults()
        Subscribe to receive results.
        Specified by:
        subscribeToResults in interface IExternalArgumentsResultsFeature
      • exceptionNotified

        public boolean exceptionNotified()
        Check if there is somebody waiting for this component to finish. Used to decide if a fatal error needs to be printed to the console.
        Specified by:
        exceptionNotified in interface IInternalArgumentsResultsFeature
      • postEvent

        protected void postEvent​(java.lang.String result,
                                 java.lang.Object value)
        Post an event to subscribed listeners.