|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.camel.util.ServiceHelper
public final class ServiceHelper
A collection of helper methods for working with Service
objects.
Method Summary | |
---|---|
static Set<Service> |
getChildServices(Service service)
Gathers all child services by navigating the service to recursively gather all child services. |
static Set<Service> |
getChildServices(Service service,
boolean includeErrorHandler)
Gathers all child services by navigating the service to recursively gather all child services. |
static boolean |
isStarted(Object value)
Is the given service starting or already started? |
static boolean |
isStopped(Object value)
Is the given service stopping or already stopped? |
static boolean |
isSuspended(Object value)
Is the given service suspending or already suspended? |
static boolean |
resumeService(Service service)
Resumes the given service . |
static void |
resumeServices(Collection<?> services)
Resumes each element of the given services if services itself is
not null , otherwise this method would return immediately. |
static void |
startService(Object value)
Starts the given value if it's a Service or a collection of it. |
static void |
startService(Service service)
Starts the given service . |
static void |
startServices(Collection<?> services)
Starts each element of the given services if services itself is
not null , otherwise this method would return immediately. |
static void |
startServices(Object... services)
Starts each element of the given services if services itself is
not null , otherwise this method would return immediately. |
static void |
stopAndShutdownService(Object value)
Stops and shutdowns the given service , rethrowing the first exception caught. |
static void |
stopAndShutdownServices(Collection<?> services)
Stops and shutdowns each element of the given services if services
itself is not null , otherwise this method would return immediately. |
static void |
stopAndShutdownServices(Object... services)
Stops and shutdowns each element of the given services if services itself is
not null , otherwise this method would return immediately. |
static void |
stopService(Object value)
Stops the given value , rethrowing the first exception caught. |
static void |
stopServices(Collection<?> services)
Stops each element of the given services if services itself is
not null , otherwise this method would return immediately. |
static void |
stopServices(Object... services)
Stops each element of the given services if services itself is
not null , otherwise this method would return immediately. |
static boolean |
suspendService(Service service)
Suspends the given service . |
static void |
suspendServices(Collection<?> services)
Suspends each element of the given services if services itself is
not null , otherwise this method would return immediately. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void startService(Object value) throws Exception
value
if it's a Service
or a collection of it.
Calling this method has no effect if value
is null
.
Exception
startService(Service)
,
startServices(Collection)
public static void startService(Service service) throws Exception
service
.
Calling this method has no effect if service
is null
.
Exception
Service.start()
public static void startServices(Object... services) throws Exception
services
if services
itself is
not null
, otherwise this method would return immediately.
Exception
startServices(Collection)
public static void startServices(Collection<?> services) throws Exception
services
if services
itself is
not null
, otherwise this method would return immediately.
Exception
startService(Object)
public static void stopServices(Object... services) throws Exception
services
if services
itself is
not null
, otherwise this method would return immediately.
If there's any exception being thrown while stopping the elements one after the
other this method would rethrow the first such exception being thrown.
Exception
stopServices(Collection)
public static void stopService(Object value) throws Exception
value
, rethrowing the first exception caught.
Calling this method has no effect if value
is null
.
Exception
Service.stop()
,
stopServices(Collection)
public static void stopServices(Collection<?> services) throws Exception
services
if services
itself is
not null
, otherwise this method would return immediately.
If there's any exception being thrown while stopping the elements one after the
other this method would rethrow the first such exception being thrown.
Exception
stopService(Object)
public static void stopAndShutdownServices(Object... services) throws Exception
services
if services
itself is
not null
, otherwise this method would return immediately.
If there's any exception being thrown while stopping/shutting down the elements one after
the other this method would rethrow the first such exception being thrown.
Exception
stopAndShutdownServices(Collection)
public static void stopAndShutdownService(Object value) throws Exception
service
, rethrowing the first exception caught.
Calling this method has no effect if value
is null
.
Exception
stopService(Object)
,
ShutdownableService.shutdown()
public static void stopAndShutdownServices(Collection<?> services) throws Exception
services
if services
itself is not null
, otherwise this method would return immediately.
If there's any exception being thrown while stopping/shutting down the elements one after
the other this method would rethrow the first such exception being thrown.
Exception
stopService(Object)
,
ShutdownableService.shutdown()
public static void resumeServices(Collection<?> services) throws Exception
services
if services
itself is
not null
, otherwise this method would return immediately.
If there's any exception being thrown while resuming the elements one after the
other this method would rethrow the first such exception being thrown.
Exception
resumeService(Service)
public static boolean resumeService(Service service) throws Exception
service
.
If service
is a SuspendableService
then
it's SuspendableService.resume()
is called but
only if service
is already suspended
.
If service
is not a
SuspendableService
then it's
Service.start()
is called.
Calling this method has no effect if service
is null
.
service
- the service
startService(Service)
was called, false
otherwise.
Exception
- is thrown if error occurredstartService(Service)
public static void suspendServices(Collection<?> services) throws Exception
services
if services
itself is
not null
, otherwise this method would return immediately.
If there's any exception being thrown while suspending the elements one after the
other this method would rethrow the first such exception being thrown.
Exception
suspendService(Service)
public static boolean suspendService(Service service) throws Exception
service
.
If service
is a SuspendableService
then
it's SuspendableService.suspend()
is called but
only if service
is not already
suspended
.
If service
is not a
SuspendableService
then it's
Service.stop()
is called.
Calling this method has no effect if service
is null
.
service
- the service
stopService(Object)
was called, false
otherwise.
Exception
- is thrown if error occurredstopService(Object)
public static boolean isStopped(Object value)
StatefulService.isStopping()
,
StatefulService.isStopped()
public static boolean isStarted(Object value)
StatefulService.isStarting()
,
StatefulService.isStarted()
public static boolean isSuspended(Object value)
StatefulService.isSuspending()
,
SuspendableService.isSuspended()
public static Set<Service> getChildServices(Service service)
service
- the service
public static Set<Service> getChildServices(Service service, boolean includeErrorHandler)
service
- the serviceincludeErrorHandler
- whether to include error handlers
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |