org.wamblee.general
Class LookupProxyFactory<T>

java.lang.Object
  extended by org.wamblee.general.LookupProxyFactory<T>

public class LookupProxyFactory<T>
extends Object

Proxy factory that can provide contextual references to objects retrieved through a lookup mechanism. The returned proxies are serializable.

Author:
Erik Brakkee

Nested Class Summary
static interface LookupProxyFactory.Lookup
          Interface to lookup the object to delegate to.
static class LookupProxyFactory.LookupException
          Exception thrown in case an object cannot be retrieved from JNDI.
 
Constructor Summary
LookupProxyFactory(Class<T> aClass, LookupProxyFactory.Lookup aLookup)
          Constructs the factory.
 
Method Summary
 T getProxy()
          Gets the proxy that delegates to the thread-specific instance set by #set(Object) When at runtime the proxy cannot find lookup the object in JNDI, it throws LookupProxyFactory.LookupException.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LookupProxyFactory

public LookupProxyFactory(Class<T> aClass,
                          LookupProxyFactory.Lookup aLookup)
Constructs the factory.

Parameters:
aClass - Interface class of the service to proxy.
aJndi - JNDI name of the object to lookup.
Method Detail

getProxy

public T getProxy()
Gets the proxy that delegates to the thread-specific instance set by #set(Object) When at runtime the proxy cannot find lookup the object in JNDI, it throws LookupProxyFactory.LookupException.

Returns:
Proxy.


Copyright © 2011. All Rights Reserved.