Package org.ow2.clif.scenario.util
Class SynchroBladeInsert
- java.lang.Object
-
- org.ow2.clif.server.lib.SynchronizerImpl
-
- org.ow2.clif.scenario.util.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
-
-
Field Summary
-
Fields inherited from interface org.ow2.clif.server.api.BladeControl
BLADE_CONTROL, BLADE_INSERT_CONTROL
-
Fields inherited from interface org.ow2.clif.server.api.Synchronizer
SYNCHRONIZER
-
-
Constructor Summary
Constructors Constructor Description SynchroBladeInsert()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindFc(java.lang.String clientItfName, java.lang.Object serverItf)voidchangeParameter(java.lang.String parameter, java.io.Serializable value)Sets the parameterparameterof this blade with the valuevalue.java.util.Map<java.lang.String,java.io.Serializable>getCurrentParameters()Returns aMapwhich maps the defined parameters to their values.java.lang.StringgetId()voidinit(java.io.Serializable testId)Initialize the activityvoidjoin()Waits until the end of the activityjava.lang.String[]listFc()java.lang.ObjectlookupFc(java.lang.String itfName)protected voidnewLock(java.lang.String lockName)Raise an alarm on each first lock notifyvoidresume()Resume the activity (if suspended)voidrun()Timer to manage the execution duration.voidsetArgument(java.lang.String argument)Binds this Insert component in the CLIF/Fractal registry using the provided domain name.voidsetId(java.lang.String id)Sets a unique identifier string to this bladevoidstart()Initial start of the activityvoidstop()Final stop of the activityvoidsuspend()Suspend the activityvoidunbindFc(java.lang.String clientItfName)-
Methods inherited from class org.ow2.clif.server.lib.SynchronizerImpl
clear, getCount, getRendezVous, notify, reset, setRendezVous, toString, wait, wait, wait, wasNotified, wasNotified
-
-
-
-
Method Detail
-
changeParameter
public void changeParameter(java.lang.String parameter, java.io.Serializable value)Description copied from interface:BladeControlSets the parameterparameterof this blade with the valuevalue. 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:
changeParameterin interfaceBladeControl
-
getCurrentParameters
public java.util.Map<java.lang.String,java.io.Serializable> getCurrentParameters()
Description copied from interface:BladeControlReturns aMapwhich maps the defined parameters to their values.- Specified by:
getCurrentParametersin interfaceBladeControl
-
getId
public java.lang.String getId()
- Specified by:
getIdin interfaceBladeControl- Returns:
- the blade unique identifier
-
setArgument
public void setArgument(java.lang.String argument) throws ClifExceptionBinds this Insert component in the CLIF/Fractal registry using the provided domain name. Any previous name binding is overridden.- Specified by:
setArgumentin interfaceBladeControl- Parameters:
argument- the synchronization domain name.- Throws:
ClifException
-
setId
public void setId(java.lang.String id)
Description copied from interface:BladeControlSets a unique identifier string to this blade- Specified by:
setIdin interfaceBladeControl
-
init
public void init(java.io.Serializable testId)
Description copied from interface:ActivityControlInitialize the activity- Specified by:
initin interfaceActivityControl- Parameters:
testId- an arbitrary initialization name
-
start
public void start()
Description copied from interface:ActivityControlInitial start of the activity- Specified by:
startin interfaceActivityControl
-
stop
public void stop()
Description copied from interface:ActivityControlFinal stop of the activity- Specified by:
stopin interfaceActivityControl
-
suspend
public void suspend()
Description copied from interface:ActivityControlSuspend the activity- Specified by:
suspendin interfaceActivityControl
-
resume
public void resume()
Description copied from interface:ActivityControlResume the activity (if suspended)- Specified by:
resumein interfaceActivityControl
-
join
public void join()
Description copied from interface:ActivityControlWaits until the end of the activity- Specified by:
joinin interfaceActivityControl
-
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:
bindFcin interfaceorg.objectweb.fractal.api.control.BindingController- Throws:
org.objectweb.fractal.api.NoSuchInterfaceExceptionorg.objectweb.fractal.api.control.IllegalBindingExceptionorg.objectweb.fractal.api.control.IllegalLifeCycleException
-
listFc
public java.lang.String[] listFc()
- Specified by:
listFcin interfaceorg.objectweb.fractal.api.control.BindingController
-
lookupFc
public java.lang.Object lookupFc(java.lang.String itfName) throws org.objectweb.fractal.api.NoSuchInterfaceException- Specified by:
lookupFcin interfaceorg.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:
unbindFcin interfaceorg.objectweb.fractal.api.control.BindingController- Throws:
org.objectweb.fractal.api.NoSuchInterfaceExceptionorg.objectweb.fractal.api.control.IllegalBindingExceptionorg.objectweb.fractal.api.control.IllegalLifeCycleException
-
run
public void run()
Timer to manage the execution duration. The duration excludes the blade suspension periods.- Specified by:
runin interfacejava.lang.Runnable
-
newLock
protected void newLock(java.lang.String lockName)
Raise an alarm on each first lock notify- Overrides:
newLockin classSynchronizerImpl- Parameters:
lockName- the name of the new lock
-
-