T - the type of servicepublic class DisposableReference<T> extends Object
| Constructor and Description |
|---|
DisposableReference(T instance,
ServiceDestroyer<T> destroyer)
Create reference to instance together with a destroyer that will be applied to instance if it is being disposed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Dispose the referenced instance (if available) and set reference to null.
|
T |
get()
Retrieve the referenced instance and set reference to null.
|
public DisposableReference(T instance, ServiceDestroyer<T> destroyer)
instance - the service instancedestroyer - the service destroyerpublic T get()
public void dispose()
Copyright © 2016 JBoss by Red Hat. All Rights Reserved.