org.apache.ojb.broker.util
Class ProxyHelper

java.lang.Object
  extended byorg.apache.ojb.broker.util.ProxyHelper

public class ProxyHelper
extends java.lang.Object

ProxyHelper used to get the real thing behind a proxy

Version:
$Id: ProxyHelper.java,v 1.22 2004/02/08 13:19:47 tomdz Exp $
Author:
Jakob Braeuchi

Constructor Summary
ProxyHelper()
           
 
Method Summary
static ManageableCollection createCollectionProxy(PersistenceBroker broker, Query query, java.lang.Class collectionClass)
          Create a Collection Proxy for a given query
static IndirectionHandler getIndirectionHandler(java.lang.Object obj)
           
static java.lang.Class getRealClass(java.lang.Object objectOrProxy)
          Get the real Class
static java.lang.Object getRealObject(java.lang.Object objectOrProxy)
          Get the real Object
static java.lang.Object getRealObjectIfMaterialized(java.lang.Object objectOrProxy)
          Get the real Object for already materialized Handler
static boolean isMaterialized(java.lang.Object object)
           
static boolean isNormalOjbProxy(java.lang.Object proxyOrObject)
          Determines whether the given object is an OJB proxy.
static boolean isProxy(java.lang.Object proxyOrObject)
          Returns true if the given object is a Proxy or a VirtualProxy instance.
static boolean isVirtualOjbProxy(java.lang.Object proxyOrObject)
          Determines whether the given object is an OJB virtual proxy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyHelper

public ProxyHelper()
Method Detail

getRealObject

public static final java.lang.Object getRealObject(java.lang.Object objectOrProxy)
Get the real Object

Parameters:
objectOrProxy -
Returns:
Object

getRealObjectIfMaterialized

public static final java.lang.Object getRealObjectIfMaterialized(java.lang.Object objectOrProxy)
Get the real Object for already materialized Handler

Parameters:
objectOrProxy -
Returns:
Object or null if the Handel is not materialized

getRealClass

public static final java.lang.Class getRealClass(java.lang.Object objectOrProxy)
Get the real Class

Parameters:
objectOrProxy -
Returns:
Class

createCollectionProxy

public static final ManageableCollection createCollectionProxy(PersistenceBroker broker,
                                                               Query query,
                                                               java.lang.Class collectionClass)
Create a Collection Proxy for a given query

Parameters:
broker -
query -
collectionClass - the class to build the proxy for
Returns:
the CollectionProxy

isNormalOjbProxy

public static boolean isNormalOjbProxy(java.lang.Object proxyOrObject)
Determines whether the given object is an OJB proxy.

Returns:
true if the object is an OJB proxy

isVirtualOjbProxy

public static boolean isVirtualOjbProxy(java.lang.Object proxyOrObject)
Determines whether the given object is an OJB virtual proxy.

Returns:
true if the object is an OJB virtual proxy

isProxy

public static boolean isProxy(java.lang.Object proxyOrObject)
Returns true if the given object is a Proxy or a VirtualProxy instance.


getIndirectionHandler

public static IndirectionHandler getIndirectionHandler(java.lang.Object obj)

isMaterialized

public static boolean isMaterialized(java.lang.Object object)


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14