T
- the callback parameter typepublic final class MultipleRemoveListener<T> extends AbstractServiceListener<Object>
Modifier and Type | Class and Description |
---|---|
static interface |
MultipleRemoveListener.Callback<T>
A generalized callback for when all services are removed.
|
Modifier and Type | Method and Description |
---|---|
static MultipleRemoveListener<LifecycleContext> |
create(LifecycleContext lifecycleContext)
Construct a new instance which calls the lifecycle
complete() method when done. |
static <T> MultipleRemoveListener<T> |
create(MultipleRemoveListener.Callback<T> callback,
T attachment)
Construct a new instance.
|
static MultipleRemoveListener<Runnable> |
create(Runnable task)
Construct a new instance.
|
void |
done()
Called when this listener has been added to all relevant services.
|
void |
listenerAdded(ServiceController<?> controller)
The listener has been added to a controller.
|
void |
transition(ServiceController<? extends Object> controller,
ServiceController.Transition transition)
The service has transitioned to a new sub-state.
|
dependencyFailed, dependencyFailureCleared, immediateDependencyAvailable, immediateDependencyUnavailable, serviceRemoveRequestCleared, serviceRemoveRequested, transitiveDependencyAvailable, transitiveDependencyUnavailable
public static <T> MultipleRemoveListener<T> create(MultipleRemoveListener.Callback<T> callback, T attachment)
T
- the type of the attachmentcallback
- the callback to invokeattachment
- the attachment to pass to the callbackpublic static MultipleRemoveListener<Runnable> create(Runnable task)
task
- the task to call upon completionpublic static MultipleRemoveListener<LifecycleContext> create(LifecycleContext lifecycleContext)
complete()
method when done.lifecycleContext
- the context to notifypublic void listenerAdded(ServiceController<?> controller)
listenerAdded
in interface ServiceListener<Object>
listenerAdded
in class AbstractServiceListener<Object>
controller
- the controller that this listener was added topublic void transition(ServiceController<? extends Object> controller, ServiceController.Transition transition)
AbstractServiceListener
transition
in interface ServiceListener<Object>
transition
in class AbstractServiceListener<Object>
controller
- the controllertransition
- the transition that occurredpublic void done()
Copyright © 2017 JBoss by Red Hat. All rights reserved.