org.objectweb.jac.aspects.integrity
Class RoleWrapper

java.lang.Object
  |
  +--org.objectweb.jac.core.Wrapper
        |
        +--org.objectweb.jac.aspects.integrity.RoleWrapper
All Implemented Interfaces:
Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable

public class RoleWrapper
extends Wrapper

Wrapper for updating opposite roles.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
RoleWrapper(AspectComponent ac)
           
 
Method Summary
 Object construct(ConstructorInvocation invocation)
           
static void disableRoleUpdate(FieldItem role)
          Disable opposite role updating
protected  void doUpdate(Interaction interaction)
           
static void enableRoleUpdate(FieldItem role)
           
 Object initAutoCreatedObject(Interaction interaction)
          Initializes the opposite role of an object auto created on an adder or reference setter if there's an attribute GuiAC.AUTOCREATE_REASON in the context, whose value is an Interaction.
 Object invoke(MethodInvocation invocation)
           
 Object updateOppositeRole(Interaction interaction)
          Tells the integrity aspect to update the opposite roles of the declared associations.
 
Methods inherited from class org.objectweb.jac.core.Wrapper
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RoleWrapper

public RoleWrapper(AspectComponent ac)
Method Detail

updateOppositeRole

public Object updateOppositeRole(Interaction interaction)
Tells the integrity aspect to update the opposite roles of the declared associations.


doUpdate

protected void doUpdate(Interaction interaction)

initAutoCreatedObject

public Object initAutoCreatedObject(Interaction interaction)
Initializes the opposite role of an object auto created on an adder or reference setter if there's an attribute GuiAC.AUTOCREATE_REASON in the context, whose value is an Interaction.


disableRoleUpdate

public static void disableRoleUpdate(FieldItem role)
Disable opposite role updating

Parameters:
role - role for which opposite role updating must be disabled

enableRoleUpdate

public static void enableRoleUpdate(FieldItem role)

invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Overrides:
invoke in class Wrapper
Throwable

construct

public Object construct(ConstructorInvocation invocation)
                 throws Throwable
Specified by:
construct in interface ConstructorInterceptor
Overrides:
construct in class Wrapper
Throwable