Class AbstractDumbInsert

  • All Implemented Interfaces:
    java.lang.Runnable, org.objectweb.fractal.api.control.BindingController, ActivityControl, BladeControl
    Direct Known Subclasses:
    AbstractInsert, Insert, Insert, Insert, Insert, Insert, Insert, Insert, Insert_JRockit5

    public abstract class AbstractDumbInsert
    extends java.lang.Object
    implements BladeControl, org.objectweb.fractal.api.control.BindingController, java.lang.Runnable
    This abstract implementation of a blade insert component manages a single thread, doing a periodic task (probing) with a given period (in milliseconds) and during an given actual time. It provides a "dumb" interpretation of the blade lifecycle with regard to the ActivityControl interface, inasmuch as it actually probes from its initialization time to its stop time, regardless of start(), suspend() and resume() orders.
    Author:
    Bruno Dillenseger, Emmanuel Varoquaux
    • Field Detail

      • probeId

        protected java.lang.String probeId
      • activity_lock

        protected java.lang.Object activity_lock
      • sr_lock

        protected java.lang.Object sr_lock
      • dc_lock

        protected java.lang.Object dc_lock
      • arg_period_ms

        protected long arg_period_ms
      • arg_duration_ms

        protected long arg_duration_ms
      • baseTime_ms

        protected long baseTime_ms
      • started

        protected volatile boolean started
      • stopped

        protected volatile boolean stopped
      • suspended

        protected volatile boolean suspended
      • terminated

        protected volatile boolean terminated
      • poller

        protected java.lang.Thread poller
      • storeLifeCycleEvents

        protected final BooleanHolder storeLifeCycleEvents
      • storeAlarmEvents

        protected final BooleanHolder storeAlarmEvents
      • storeProbeEvents

        protected final BooleanHolder storeProbeEvents
      • eventStorageStatesMap

        protected final java.util.Map<java.lang.String,​java.lang.Object> eventStorageStatesMap
    • Constructor Detail

      • AbstractDumbInsert

        public AbstractDumbInsert()
    • Method Detail

      • doProbe

        protected abstract ProbeEvent doProbe()
        Define this method to perform your measure and return it
        Returns:
        an probe event holding the measure
      • getHelpMessage

        public java.lang.String getHelpMessage()
        Gives probe help. This basic implementation mentions the 2 first arguments: polling period and execution time. Override this method to extend the help message by adding extra arguments when necessary.
        Returns:
        a message giving basic help to use this probe
      • setExtraArguments

        protected void setExtraArguments​(java.util.List<java.lang.String> extraArgs)
                                  throws ClifException
        Override this method when you are willing to pass some extra parameters to the Insert, below the sampling period and duration standard arguments.
        Throws:
        ClifException
      • close

        protected void close()
                      throws ClifException
        Override this method when you are willing to release some resources when the probe ends its activity.
        Throws:
        ClifException
      • lookupFc

        public java.lang.Object lookupFc​(java.lang.String clientItfName)
        Specified by:
        lookupFc in interface org.objectweb.fractal.api.control.BindingController
      • bindFc

        public void bindFc​(java.lang.String clientItfName,
                           java.lang.Object serverItf)
        Specified by:
        bindFc in interface org.objectweb.fractal.api.control.BindingController
      • unbindFc

        public void unbindFc​(java.lang.String clientItfName)
        Specified by:
        unbindFc in interface org.objectweb.fractal.api.control.BindingController
      • listFc

        public java.lang.String[] listFc()
        Specified by:
        listFc in interface org.objectweb.fractal.api.control.BindingController
      • init

        public void init​(java.io.Serializable testId)
        Description copied from interface: ActivityControl
        Initialize the activity
        Specified by:
        init in interface ActivityControl
        Parameters:
        testId - unique identifier of the new test
      • setArgument

        public void setArgument​(java.lang.String arg)
                         throws ClifException
        Sets sampling period duration parameters. Possible extra arguments are passed through
        Specified by:
        setArgument in interface BladeControl
        Parameters:
        arg - should hold 2 integer parameters (separated with usual separators) setting (1) the observation polling period in ms, and (2) the test duration in seconds.
        Throws:
        ClifException
      • setId

        public void setId​(java.lang.String id)
        Sets this scenario's unique identifier
        Specified by:
        setId in interface BladeControl
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface BladeControl
        Returns:
        the scenario/blade identifier
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • changeParameter

        public void changeParameter​(java.lang.String parameter,
                                    java.io.Serializable value)
                             throws ClifException
        Description copied from interface: BladeControl
        Sets the parameter parameter of this blade with the value value. This method allows to change parameters independently of the activity of the blade. However, some parameters can depend on the state of the blade.
        Specified by:
        changeParameter in interface BladeControl
        Throws:
        ClifException
      • getCurrentParameters

        public java.util.Map<java.lang.String,​java.io.Serializable> getCurrentParameters()
        Description copied from interface: BladeControl
        Returns a Map which maps the defined parameters to their values.
        Specified by:
        getCurrentParameters in interface BladeControl