Class SynchroBladeInsert

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

    public class SynchroBladeInsert
    extends SynchronizerImpl
    implements org.objectweb.fractal.api.control.BindingController, BladeControl, java.lang.Runnable
    Implementation of a centralized synchronization BladeInsert component to provide synchronization support among distributed scenarios. Each instance provides synchronization service for a given "domain", whose name must be given as first blade argument. This domain name is used to bind this insert in the CLIF registry, prefixed by the value of attribute Synchronizer.SYNCHRONIZER. The execution duration in seconds must be given as second blade argument.
    Author:
    Bruno Dillenseger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bindFc​(java.lang.String clientItfName, java.lang.Object serverItf)  
      void changeParameter​(java.lang.String parameter, java.io.Serializable value)
      Sets the parameter parameter of this blade with the value value.
      java.util.Map<java.lang.String,​java.io.Serializable> getCurrentParameters()
      Returns a Map which maps the defined parameters to their values.
      java.lang.String getId()  
      void init​(java.io.Serializable testId)
      Initialize the activity
      void join()
      Waits until the end of the activity
      java.lang.String[] listFc()  
      java.lang.Object lookupFc​(java.lang.String itfName)  
      protected void newLock​(java.lang.String lockName)
      Raise an alarm on each first lock notify
      void resume()
      Resume the activity (if suspended)
      void run()
      Timer to manage the execution duration.
      void setArgument​(java.lang.String argument)
      Binds this Insert component in the CLIF/Fractal registry using the provided domain name.
      void setId​(java.lang.String id)
      Sets a unique identifier string to this blade
      void start()
      Initial start of the activity
      void stop()
      Final stop of the activity
      void suspend()
      Suspend the activity
      void unbindFc​(java.lang.String clientItfName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SynchroBladeInsert

        public SynchroBladeInsert()
    • Method Detail

      • changeParameter

        public void changeParameter​(java.lang.String parameter,
                                    java.io.Serializable value)
        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
      • 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
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface BladeControl
        Returns:
        the blade unique identifier
      • setArgument

        public void setArgument​(java.lang.String argument)
                         throws ClifException
        Binds this Insert component in the CLIF/Fractal registry using the provided domain name. Any previous name binding is overridden.
        Specified by:
        setArgument in interface BladeControl
        Parameters:
        argument - the synchronization domain name.
        Throws:
        ClifException
      • setId

        public void setId​(java.lang.String id)
        Description copied from interface: BladeControl
        Sets a unique identifier string to this blade
        Specified by:
        setId in interface BladeControl
      • init

        public void init​(java.io.Serializable testId)
        Description copied from interface: ActivityControl
        Initialize the activity
        Specified by:
        init in interface ActivityControl
        Parameters:
        testId - an arbitrary initialization name
      • bindFc

        public void bindFc​(java.lang.String clientItfName,
                           java.lang.Object serverItf)
                    throws org.objectweb.fractal.api.NoSuchInterfaceException,
                           org.objectweb.fractal.api.control.IllegalBindingException,
                           org.objectweb.fractal.api.control.IllegalLifeCycleException
        Specified by:
        bindFc in interface org.objectweb.fractal.api.control.BindingController
        Throws:
        org.objectweb.fractal.api.NoSuchInterfaceException
        org.objectweb.fractal.api.control.IllegalBindingException
        org.objectweb.fractal.api.control.IllegalLifeCycleException
      • listFc

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

        public java.lang.Object lookupFc​(java.lang.String itfName)
                                  throws org.objectweb.fractal.api.NoSuchInterfaceException
        Specified by:
        lookupFc in interface org.objectweb.fractal.api.control.BindingController
        Throws:
        org.objectweb.fractal.api.NoSuchInterfaceException
      • unbindFc

        public void unbindFc​(java.lang.String clientItfName)
                      throws org.objectweb.fractal.api.NoSuchInterfaceException,
                             org.objectweb.fractal.api.control.IllegalBindingException,
                             org.objectweb.fractal.api.control.IllegalLifeCycleException
        Specified by:
        unbindFc in interface org.objectweb.fractal.api.control.BindingController
        Throws:
        org.objectweb.fractal.api.NoSuchInterfaceException
        org.objectweb.fractal.api.control.IllegalBindingException
        org.objectweb.fractal.api.control.IllegalLifeCycleException
      • run

        public void run()
        Timer to manage the execution duration. The duration excludes the blade suspension periods.
        Specified by:
        run in interface java.lang.Runnable
      • newLock

        protected void newLock​(java.lang.String lockName)
        Raise an alarm on each first lock notify
        Overrides:
        newLock in class SynchronizerImpl
        Parameters:
        lockName - the name of the new lock