public interface IProxyTargetLocator extends IClusterable
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(); } }
LazyInitProxyFactory.createProxy(Class, IProxyTargetLocator)
Modifier and Type | Method and Description |
---|---|
Object |
locateProxyTarget()
Returns the object that will be used as target object for a lazy init proxy.
|
Object locateProxyTarget()
Copyright © 2006–2022 Apache Software Foundation. All rights reserved.