1 22 package org.jboss.aspects.versioned; 23 import java.lang.ref.WeakReference ; 24 25 import org.jboss.aop.InstanceAdvised; 26 import org.jboss.util.id.GUID; 27 28 public class VersionReference implements java.io.Serializable 29 { 30 private static final long serialVersionUID = 1567486678025136095L; 31 32 private GUID guid; 33 private transient WeakReference advisedRef; 34 35 public VersionReference() {} 36 37 public VersionReference(GUID guid) 38 { 39 this(guid, null); 40 } 41 public VersionReference(GUID guid, InstanceAdvised obj) 42 { 43 System.out.println("VERSION REFERENCE CREATION: " + guid); 44 this.guid = guid; 45 set(obj); 46 } 47 public void set(InstanceAdvised obj) { this.advisedRef = new WeakReference (obj); } 48 public InstanceAdvised get() 49 { 50 if (advisedRef != null) 51 { 52 return (InstanceAdvised)advisedRef.get(); 53 } 54 return null; 55 } 56 public GUID getGUID() { return guid; } 57 } 58 | Popular Tags |