public class LifecycleUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
disposeAllIfNeeded(Collection<? extends Object> objects,
org.slf4j.Logger logger)
For each item in the
objects collection, it invokes Disposable.dispose()
if it implements the Disposable interface. |
static void |
disposeIfNeeded(Object object,
org.slf4j.Logger logger)
|
static void |
initialiseIfNeeded(Collection<? extends Object> objects)
For each item in the
objects collection, it invokes Initialisable.initialise()
if it implements the Initialisable interface. |
static void |
initialiseIfNeeded(Object object)
|
static void |
initialiseIfNeeded(Object object,
MuleContext muleContext)
The same as
initialiseIfNeeded(Object), only that before checking
for object being Initialisable, it also checks if it implements
MuleContextAware, in which case it will invoke MuleContextAware.setMuleContext(MuleContext)
with the given muleContext |
static void |
startIfNeeded(Collection<? extends Object> objects)
For each item in the
objects collection, it invokes the the Startable.start()
if it implements the Startable interface. |
static void |
startIfNeeded(Object object)
|
static void |
stopIfNeeded(Collection<? extends Object> objects)
For each item in the
objects collection, it invokes the Stoppable.stop()
if it implements the Stoppable interface. |
static void |
stopIfNeeded(Object object)
|
public static void initialiseIfNeeded(Object object) throws InitialisationException
object - the object you're trying to initialiseInitialisationExceptionpublic static void initialiseIfNeeded(Object object, MuleContext muleContext) throws InitialisationException
initialiseIfNeeded(Object), only that before checking
for object being Initialisable, it also checks if it implements
MuleContextAware, in which case it will invoke MuleContextAware.setMuleContext(MuleContext)
with the given muleContextobject - the object you're trying to initialisemuleContext - a MuleContextInitialisationExceptionpublic static void initialiseIfNeeded(Collection<? extends Object> objects) throws InitialisationException
objects collection, it invokes Initialisable.initialise()
if it implements the Initialisable interface.objects - the list of objects to be initialisedInitialisationExceptionpublic static void startIfNeeded(Object object) throws MuleException
object - the object you're trying to startMuleExceptionpublic static void startIfNeeded(Collection<? extends Object> objects) throws MuleException
objects collection, it invokes the the Startable.start()
if it implements the Startable interface.objects - the list of objects to be startedMuleExceptionpublic static void stopIfNeeded(Collection<? extends Object> objects) throws MuleException
objects collection, it invokes the Stoppable.stop()
if it implements the Stoppable interface.objects - the list of objects to be stoppedMuleExceptionpublic static void stopIfNeeded(Object object) throws MuleException
object - the object you're trying to stopMuleExceptionpublic static void disposeIfNeeded(Object object, org.slf4j.Logger logger)
Disposable.dispose() on object if it implements the
Disposable interface. If the dispose operation fails, then the exception
will be silently logged using the provided loggerobject - the object you're trying to disposepublic static void disposeAllIfNeeded(Collection<? extends Object> objects, org.slf4j.Logger logger)
objects collection, it invokes Disposable.dispose()
if it implements the Disposable interface.
Per each dispose operation that fails, the exception will be silently logged using the
provided loggerobjects - the list of objects to be stoppedMuleExceptionCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.