public interface ResourceLifecycleManagement
Modifier and Type | Method and Description |
---|---|
void |
disposeAllResources()
Dispose all the resources.
|
void |
disposeResource(Object resource)
Dispose the specified resource.
|
void |
disposeResourcesAndReset()
Dispose all the resources and reset this
ResourceLifecycleManagement , for example clearing any thread
local state |
boolean |
isActive()
Returns true if resource lifecycle management is turned on or forced to be turned on.
|
boolean |
isAlwaysActive()
Returns true if resource lifecycle management is forced to be turned on.
|
void |
registerResource(Object resource)
Registers a disposable resource.
|
void |
setActive(boolean active)
Turns on or off the resource lifecycle management.
|
void |
setAlwaysActive(boolean alwaysActive)
Forces to turn on or off the resource lifecycle management.
|
void |
unregisterResource(Object resource)
Unregisters the disposable resource.
|
Object |
visitResources(ResourceVisitor visitor)
Traverses all the resource, calling the visitor's visit method at each one.
|
boolean isActive()
void setActive(boolean active)
active
- boolean isAlwaysActive()
void setAlwaysActive(boolean alwaysActive)
alwaysActive
- void registerResource(Object resource)
resource
- void unregisterResource(Object resource)
resource
- void disposeResource(Object resource)
resource
- void disposeAllResources()
void disposeResourcesAndReset()
ResourceLifecycleManagement
, for example clearing any thread
local stateObject visitResources(ResourceVisitor visitor)
visitor
- The visitor to call back toCopyright © 2008–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.