org.apache.ojb.broker.core.proxy
Class ProxyFactory

java.lang.Object
  extended byorg.apache.ojb.broker.core.proxy.ProxyFactory

public class ProxyFactory
extends java.lang.Object

Factory class for creating instances of the indirection handler used by OJB's proxies, and for the collection proxies.

Version:
$Id: ProxyFactory.java,v 1.1 2004/04/09 13:22:29 tomdz Exp $
Author:
Thomas Dudziak

Constructor Summary
ProxyFactory()
           
 
Method Summary
static ManageableCollection createCollectionProxy(PBKey brokerKey, Query query, java.lang.Class collectionClass)
          Create a Collection Proxy for a given query.
static IndirectionHandler createIndirectionHandler(PBKey brokerKey, Identity id)
          Creates a new indirection handler instance.
static java.lang.Class getCollectionProxyClass()
          Returns the collection proxy class.
static java.lang.Class getIndirectionHandlerClass()
          Returns the indirection handler class.
static java.lang.Class getListProxyClass()
          Returns the list proxy class.
static java.lang.Class getSetProxyClass()
          Returns the set proxy class.
static void setCollectionProxyClass(java.lang.Class collectionProxyClass)
          Dets the proxy class to use for generic collection classes implementing the Collection interface.
static void setIndirectionHandlerClass(java.lang.Class indirectionHandlerClass)
          Sets the indirection handler class.
static void setListProxyClass(java.lang.Class listProxyClass)
          Dets the proxy class to use for collection classes that implement the List interface.
static void setSetProxyClass(java.lang.Class setProxyClass)
          Dets the proxy class to use for collection classes that implement the Set interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyFactory

public ProxyFactory()
Method Detail

getIndirectionHandlerClass

public static java.lang.Class getIndirectionHandlerClass()
Returns the indirection handler class.

Returns:
The class for indirection handlers

setIndirectionHandlerClass

public static void setIndirectionHandlerClass(java.lang.Class indirectionHandlerClass)
Sets the indirection handler class.

Parameters:
indirectionHandlerClass - The class for indirection handlers

createIndirectionHandler

public static IndirectionHandler createIndirectionHandler(PBKey brokerKey,
                                                          Identity id)
Creates a new indirection handler instance.

Parameters:
brokerKey - The key of the persistence broker
id - The subject's ids
Returns:
The new instance

getListProxyClass

public static java.lang.Class getListProxyClass()
Returns the list proxy class.

Returns:
The class used for list proxies

setListProxyClass

public static void setListProxyClass(java.lang.Class listProxyClass)
Dets the proxy class to use for collection classes that implement the List interface. Notes that the proxy class must implement the List interface, and have a constructor of the signature (PBKey, Class, Query).

Parameters:
listProxyClass - The proxy class

getSetProxyClass

public static java.lang.Class getSetProxyClass()
Returns the set proxy class.

Returns:
The class used for set proxies

setSetProxyClass

public static void setSetProxyClass(java.lang.Class setProxyClass)
Dets the proxy class to use for collection classes that implement the Set interface.

Parameters:
setProxyClass - The proxy class

getCollectionProxyClass

public static java.lang.Class getCollectionProxyClass()
Returns the collection proxy class.

Returns:
The class used for collection proxies

setCollectionProxyClass

public static void setCollectionProxyClass(java.lang.Class collectionProxyClass)
Dets the proxy class to use for generic collection classes implementing the Collection interface.

Parameters:
collectionProxyClass - The proxy class

createCollectionProxy

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

Parameters:
brokerKey - The key of the persistence broker
query - The query
collectionClass - The class to build the proxy for
Returns:
The collection proxy


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2