|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.ioc.internal.services.JustInTimeObjectCreator<T>
public class JustInTimeObjectCreator<T>
Invoked from a fabricated service delegate to get or realize (instantiate and configure) the service implementation. This includes synchronization logic, to prevent multiple threads from attempting to realize the same service at the same time (a service should be realized only once). The additional interfaces implemented by this class support eager loading of services (at application startup), and orderly shutdown of proxies.
Constructor Summary | |
---|---|
JustInTimeObjectCreator(ServiceActivityTracker tracker,
ObjectCreator<T> creator,
String serviceId)
|
Method Summary | |
---|---|
T |
createObject()
Checks to see if the proxy has been shutdown, then invokes ObjectCreator.createObject() if it has not
already done so. |
void |
eagerLoadService()
Invokes createObject() to force the creation of the underlying service. |
void |
run()
Invoked when the Registry is shutdown; deletes the instantiated object (if it exists) and replaces the ObjectCreator with one that throws an IllegalStateException. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JustInTimeObjectCreator(ServiceActivityTracker tracker, ObjectCreator<T> creator, String serviceId)
Method Detail |
---|
public T createObject()
ObjectCreator.createObject()
if it has not
already done so.
createObject
in interface ObjectCreator<T>
IllegalStateException
- if the registry has been shutdownpublic void eagerLoadService()
createObject()
to force the creation of the underlying service.
eagerLoadService
in interface EagerLoadServiceProxy
public void run()
run
in interface Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |