org.kuali.rice.core.ojb
Class ContextClassLoaderSetProxy

java.lang.Object
  extended by org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl
      extended by org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl
          extended by org.kuali.rice.core.ojb.ContextClassLoaderSetProxy
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable, java.util.Collection, java.util.Set, org.apache.ojb.broker.core.proxy.CollectionProxy, org.apache.ojb.broker.ManageableCollection

public class ContextClassLoaderSetProxy
extends org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl

Sets up the context classloader properly for OJB proxies. The sequence of events in the super class is as follows:

 public synchronized Collection getData()
 {
    if (!isLoaded())
    {
      beforeLoading();
      setData(loadData());
      afterLoading();
    }
    return _data;
 }
 
Therefore, since there is no try-catch-finally in conjunction with this call, we need to handle exceptions thrown from loadData and unbind the classloader appropriately.

See Also:
Serialized Form

Constructor Summary
ContextClassLoaderSetProxy(org.apache.ojb.broker.PBKey aKey, java.lang.Class aCollClass, org.apache.ojb.broker.query.Query aQuery)
           
ContextClassLoaderSetProxy(org.apache.ojb.broker.PBKey aKey, org.apache.ojb.broker.query.Query aQuery)
           
 
Method Summary
protected  void afterLoading()
           
protected  void beforeLoading()
           
protected  java.util.Collection loadData()
           
 
Methods inherited from class org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl
getSetData
 
Methods inherited from class org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl
add, addAll, addListener, afterStore, clear, contains, containsAll, getBroker, getBrokerKey, getCollectionClass, getData, getProfileKey, getQuery, isEmpty, isLoaded, iterator, loadProfileIfNeeded, loadSize, ojbAdd, ojbAddAll, ojbIterator, releaseBroker, remove, removeAll, removeListener, retainAll, setBrokerKey, setCollectionClass, setData, setProfileKey, setQuery, setSize, size, toArray, toArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 

Constructor Detail

ContextClassLoaderSetProxy

public ContextClassLoaderSetProxy(org.apache.ojb.broker.PBKey aKey,
                                  java.lang.Class aCollClass,
                                  org.apache.ojb.broker.query.Query aQuery)

ContextClassLoaderSetProxy

public ContextClassLoaderSetProxy(org.apache.ojb.broker.PBKey aKey,
                                  org.apache.ojb.broker.query.Query aQuery)
Method Detail

beforeLoading

protected void beforeLoading()
Overrides:
beforeLoading in class org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl

loadData

protected java.util.Collection loadData()
                                 throws org.apache.ojb.broker.PersistenceBrokerException
Overrides:
loadData in class org.apache.ojb.broker.core.proxy.SetProxyDefaultImpl
Throws:
org.apache.ojb.broker.PersistenceBrokerException

afterLoading

protected void afterLoading()
Overrides:
afterLoading in class org.apache.ojb.broker.core.proxy.CollectionProxyDefaultImpl


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.