org.ops4j.pax.wicket.util.proxy
Interface IProxyTargetLocator

All Superinterfaces:
org.apache.wicket.IClusterable, Serializable

public interface IProxyTargetLocator
extends org.apache.wicket.IClusterable

Represents a service locator for lazy init proxies. When the first method invocation occurs on the lazy init proxy this locator will be used to retrieve the proxy target object that will receive the method invocation.

Generally implementations should be small when serialized because the main purpose of lazy init proxies is to be stored in session when the wicket pages are serialized, and when deserialized to be able to lookup the dependency again. The smaller the implementation of IProxyTargetLocator the less the drain on session size.

A small implementation may use a static lookup to retrieve the target object.

Example:

 class UserServiceLocator implements IProxyTargetLocator {
     Object locateProxyObject() {
         MyApplication app = (MyApplication) Application.get();
         return app.getUserService();
     }
 }
 

Author:
Igor Vaynberg (ivaynberg)
See Also:
LazyInitProxyFactory.createProxy(Class, IProxyTargetLocator)

Method Summary
 Class getParent()
          Returns the parent holding the responsibility for the serialisation.
 Object locateProxyTarget()
          Returns the object that will be used as target object for a lazy init proxy.
 

Method Detail

locateProxyTarget

Object locateProxyTarget()
Returns the object that will be used as target object for a lazy init proxy.

Returns:
retrieved object

getParent

Class getParent()
Returns the parent holding the responsibility for the serialisation.



Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.