org.objectweb.jac.aspects.synchronization
Class SynchronizationAC

java.lang.Object
  |
  +--org.objectweb.jac.core.AspectComponent
        |
        +--org.objectweb.jac.aspects.synchronization.SynchronizationAC
All Implemented Interfaces:
BaseProgramListener, Serializable, SynchronizationConf

public class SynchronizationAC
extends AspectComponent
implements SynchronizationConf

This aspect component allows the programmer to synchronize a set of methods on different objects or classes in a centralized way (do not use the synchronized java keyword anymore).

The monitor implementation to provide synchronization is implemented by a semaphore.

See Also:
Semaphore, Serialized Form

Nested Class Summary
static class SynchronizationAC.SynchronizationWrapper
          This inner wrapper implements the methods synchronization with a semaphore.
 
Field Summary
 
Fields inherited from class org.objectweb.jac.core.AspectComponent
application, blockKeywords, cr, currentConfigMethod, currentImports, firstCall, NOT_SHARED, SHARED, startWeavingCCount, startWeavingCount, startWeavingMethod, startWeavingType, systemListener, wrappers
 
Fields inherited from interface org.objectweb.jac.core.BaseProgramListener
FOUND_OBJECT
 
Constructor Summary
SynchronizationAC()
           
 
Method Summary
 void synchronize(String classes, String methods, String objects)
          This configuration method sets methods to be synchronized.
 
Methods inherited from class org.objectweb.jac.core.AspectComponent
addWrapper, afterApplicationStarted, afterRunningWrapper, afterWrap, afterWrappeeInit, attr, attrdef, beforeConfiguration, beforeReload, beforeRunningWrapper, beforeWrappeeInit, configure, defines, defineTimer, doRegister, doUnregister, error, getAC, getApplication, getBlockKeywords, getConfigurationMethods, getConfigurationMethodsName, getConfigurationMethodsName, getDefaultConfigs, getName, getNameCounters, getWrappers, init, isConfigurationMethod, isSystemListener, onExit, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, pointcut, setApplication, setAttribute, setAttribute, setAttribute, setSystemListener, simulateUsingNewInstance, unweave, unwrapAll, updateNameCounters, warning, weave, whenClone, whenCloseDisplay, whenConfigured, whenDeleted, whenDeserialized, whenFree, whenGetObjects, whenNameObject, whenObjectMiss, whenReload, whenRemoteInstantiation, whenSerialized, whenTopologyChanged, whenUsingNewClass, whenUsingNewInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SynchronizationAC

public SynchronizationAC()
Method Detail

synchronize

public void synchronize(String classes,
                        String methods,
                        String objects)
Description copied from interface: SynchronizationConf
This configuration method sets methods to be synchronized.

Two synchronized methods cannot execute at the same time on the same object.

Specified by:
synchronize in interface SynchronizationConf
Parameters:
classes - the classes the methods belong to
methods - the methods to synchronize
objects - the instances of the classes to be synchronized