public static class ContainerServices.ComponentReleaseCallback
extends java.lang.Object
ContainerServices.releaseComponent(String, ComponentReleaseCallback).
Users may override the methods they need in their subclasses of ComponentReleaseCallback.
Note that awaitComponentRelease(long, TimeUnit) is not a callback method
but should make it easier to synchronize user code execution with component release.
An instance of ComponentReleaseCallback can be used for only one component release call.
| Constructor and Description |
|---|
ComponentReleaseCallback() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitComponentRelease(long timeout,
java.util.concurrent.TimeUnit unit)
This is not a callback method but a convenience method to "park" the calling thread
until
The component has been released, or
the given timeout has struck, or
component release failed with an exception.
|
void |
componentReleased(AcsJComponentDeactivationUncleanEx deactivationUncleanEx)
Called when the component reference has been successfully released.
|
void |
errorCommunicationFailure(java.lang.Throwable thr)
Called when a CORBA or other communication error occurred.
|
void |
errorComponentReleaseFailed(AcsJComponentDeactivationFailedEx deactivationFailureEx)
Called when the target component deactivation failed.
|
void |
errorNoPermission(java.lang.String reason)
Called when the client cannot legally release the component, e.g.
|
public void errorCommunicationFailure(java.lang.Throwable thr)
public void errorNoPermission(java.lang.String reason)
public void componentReleased(AcsJComponentDeactivationUncleanEx deactivationUncleanEx)
deactivationUncleanEx - If the component was deactivated with problems, this exception will be forwarded; otherwise null for clean deactivation.public void errorComponentReleaseFailed(AcsJComponentDeactivationFailedEx deactivationFailureEx)
deactivationFailureEx - to provide details about the failure.public final boolean awaitComponentRelease(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
ComponentReleaseCallback,
but can simply call awaitComponentRelease.
The client may in addition override the callback methods though.timeout - The maximum time to wait for the component release to succeed.unit - The unit of timeout.true if the component was released properly, false if the call returns because of a timeout.
See CountDownLatch.await(long, TimeUnit).java.lang.InterruptedException