Package org.jboss.msc.service
Class TimingServiceListener
- java.lang.Object
-
- org.jboss.msc.service.AbstractServiceListener<Object>
-
- org.jboss.msc.service.TimingServiceListener
-
- All Implemented Interfaces:
ServiceListener<Object>
@Deprecated public final class TimingServiceListener extends AbstractServiceListener<Object> implements ServiceListener<Object>
Deprecated.UseLifecycleContext.getElapsedTime()
insteadA service listener which times service start. The timing starts from the moment the listener is created and ends when the last service is batched and the services are all started.- Author:
- David M. Lloyd
-
-
Constructor Summary
Constructors Constructor Description TimingServiceListener()
Deprecated.Construct a new instance.TimingServiceListener(Runnable finishedTask)
Deprecated.Construct a new instance which calls the given task when the timing is done.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
finishBatch()
Deprecated.Call when all services in this timing group have been added.boolean
finished()
Deprecated.Determine whether all services have finished.long
getElapsedTime()
Deprecated.Get the elapsed time in milliseconds.int
getRemainingCount()
Deprecated.Get the number of remaining services to start.int
getTotalCount()
Deprecated.Get the total number of services being tracked.void
listenerAdded(ServiceController<? extends Object> serviceController)
Deprecated.The listener has been added to a controller.void
transition(ServiceController<? extends Object> controller, ServiceController.Transition transition)
Deprecated.The service has transitioned to a new sub-state.-
Methods inherited from class org.jboss.msc.service.AbstractServiceListener
dependencyFailed, dependencyFailureCleared, immediateDependencyAvailable, immediateDependencyUnavailable, serviceRemoveRequestCleared, serviceRemoveRequested, transitiveDependencyAvailable, transitiveDependencyUnavailable
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.msc.service.ServiceListener
dependencyFailed, dependencyFailureCleared, immediateDependencyAvailable, immediateDependencyUnavailable, serviceRemoveRequestCleared, serviceRemoveRequested, transitiveDependencyAvailable, transitiveDependencyUnavailable
-
-
-
-
Constructor Detail
-
TimingServiceListener
public TimingServiceListener()
Deprecated.Construct a new instance.
-
TimingServiceListener
public TimingServiceListener(Runnable finishedTask)
Deprecated.Construct a new instance which calls the given task when the timing is done.- Parameters:
finishedTask
- the finish task
-
-
Method Detail
-
listenerAdded
public void listenerAdded(ServiceController<? extends Object> serviceController)
Deprecated.The listener has been added to a controller.- Specified by:
listenerAdded
in interfaceServiceListener<Object>
- Overrides:
listenerAdded
in classAbstractServiceListener<Object>
- Parameters:
serviceController
- the controller that this listener was added to
-
transition
public void transition(ServiceController<? extends Object> controller, ServiceController.Transition transition)
Deprecated.Description copied from class:AbstractServiceListener
The service has transitioned to a new sub-state.- Specified by:
transition
in interfaceServiceListener<Object>
- Overrides:
transition
in classAbstractServiceListener<Object>
- Parameters:
controller
- the controllertransition
- the transition that occurred
-
finishBatch
public void finishBatch()
Deprecated.Call when all services in this timing group have been added.
-
finished
public boolean finished()
Deprecated.Determine whether all services have finished.- Returns:
true
if all services have finished
-
getRemainingCount
public int getRemainingCount()
Deprecated.Get the number of remaining services to start.- Returns:
- the remaining count
-
getTotalCount
public int getTotalCount()
Deprecated.Get the total number of services being tracked.- Returns:
- the total count
-
getElapsedTime
public long getElapsedTime()
Deprecated.Get the elapsed time in milliseconds.- Returns:
- the elapsed time, or -1 if not finished yet
-
-