public class JustInTimeObjectCreator<T> extends Object implements ObjectCreator<T>, EagerLoadServiceProxy, Runnable
Constructor and Description |
---|
JustInTimeObjectCreator(ServiceActivityTracker tracker,
ObjectCreator<T> creator,
String serviceId) |
Modifier and Type | Method and Description |
---|---|
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.
|
public JustInTimeObjectCreator(ServiceActivityTracker tracker, ObjectCreator<T> creator, String serviceId)
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
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.