FileDocCategorySizeDatePackage
Versioned.javaAPI DocJBoss 4.2.13134Fri Jul 13 21:02:32 BST 2007org.jboss.aspects.versioned

Versioned

public class Versioned extends Object
This interceptor handles chooses an object to invoke on based on the transaction
author
Bill Burke
version
$Revision: 57186 $

Fields Summary
public static final String
VERSIONED
public static final String
VERSIONED_OBJECT
public static final String
READONLY
static DistributedVersionManager
localManager
Constructors Summary
Methods Summary
public static synchronized DistributedVersionManagergetLocalVersionManager()

         
   
      if (localManager == null)
      {
         LocalSynchronizationManager synchManager = new LocalSynchronizationManager(null);
         localManager = new DistributedVersionManager(1000, synchManager);
         synchManager.versionManager = localManager;
         
      }
      return localManager;
   
public static voidmakePerFieldVersioned(java.lang.Object target)

      if (!(target instanceof Advised)) throw new IllegalArgumentException("Cannot do per field versioning with a non-Advised object");
      Advised advised = (Advised)target;
      getLocalVersionManager().makeVersioned(advised);
   
public static java.lang.ObjectmakeVersioned(java.lang.Object target)


       
       
   
      if (target instanceof ClassProxy) throw new IllegalStateException("A ClassProxy is not allowed to be Versioned.  You must have a concrete object");
      ClassProxy proxy = ClassProxyFactory.newInstance(target.getClass());
      VersionedObject versioned = new VersionedObject(target);
      proxy._getInstanceAdvisor().getMetaData().addMetaData(VERSIONED, VERSIONED_OBJECT, versioned, PayloadKey.TRANSIENT);
      proxy._getInstanceAdvisor().appendInterceptor(VersionedObjectInterceptorFactory.getInstance());
      proxy._getInstanceAdvisor().appendInterceptor(new VersionedObjectForwardingInterceptor());
      return proxy;