1 package org.apache.ojb.broker.core.proxy; 2 3 17 18 import java.io.Serializable ; 19 20 import org.apache.ojb.broker.Identity; 21 import org.apache.ojb.broker.PBKey; 22 import org.apache.ojb.broker.PersistenceBrokerException; 23 24 30 public abstract class VirtualProxy implements OJBProxy,Serializable 31 { 32 static final long serialVersionUID = -3999451313262635171L; 33 34 37 private IndirectionHandler indirectionHandler = null; 38 39 42 public VirtualProxy() 43 {} 44 45 51 public VirtualProxy(PBKey key, Identity oid) 52 { 53 indirectionHandler = AbstractProxyFactory.getProxyFactory().createIndirectionHandler(key, oid); 54 } 55 56 63 64 public VirtualProxy(IndirectionHandler handler) 65 { 66 indirectionHandler = handler; 67 } 68 69 75 public static IndirectionHandler getIndirectionHandler(VirtualProxy proxy) 76 { 77 return proxy.indirectionHandler; 78 } 79 80 85 public boolean alreadyMaterialized() 86 { 87 return indirectionHandler.alreadyMaterialized(); 88 } 89 90 91 96 public Object getRealSubject() throws PersistenceBrokerException 97 { 98 return indirectionHandler.getRealSubject(); 99 } 100 101 106 public IndirectionHandler getIndirectionHandler() 107 { 108 return indirectionHandler; 109 } 110 111 116 Identity getIdentity() 117 { 118 return indirectionHandler.getIdentity(); 119 } 120 121 public Object writeReplace() 122 { 123 return this; 124 } 125 126 127 } 128 | Popular Tags |