Class CompositeLifecycle
java.lang.Object
org.springframework.data.gemfire.support.CompositeLifecycle
- All Implemented Interfaces:
Iterable<Lifecycle>
,Lifecycle
,Phased
,SmartLifecycle
A Spring
Lifecycle
that implements the Composite software design pattern composing 1 or more
Lifecycle
components as a single, logical, composite Lifecycle
object.- Since:
- 2.2.0
- Author:
- John Blum
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Adds aLifecycle
object to this composite.boolean
isEmpty()
Returns a boolean value indicating whether this composite contains anyLifecycle
objects.boolean
Determines whether anyLifecycle
object contained by this composite is running.iterator()
boolean
Removes the givenLifecycle
object from this composite.int
size()
Returns the number ofLifecycle
objects contained by this composite.void
start()
Starts allLifecycle
objects contained by this composite.void
stop()
Stops allLifecycle
objects contained by this composite.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isAutoStartup, stop
-
Constructor Details
-
CompositeLifecycle
public CompositeLifecycle()
-
-
Method Details
-
add
Adds aLifecycle
object to this composite. -
isEmpty
public boolean isEmpty()Returns a boolean value indicating whether this composite contains anyLifecycle
objects.- Returns:
- a boolean value indicating whether this composite contains any
Lifecycle
objects.
-
iterator
-
remove
Removes the givenLifecycle
object from this composite. -
size
public int size()Returns the number ofLifecycle
objects contained by this composite.- Returns:
- an integer value specifying the number of
Lifecycle
objects contained by this composite.
-
isRunning
public boolean isRunning()Determines whether anyLifecycle
object contained by this composite is running. -
start
public void start()Starts allLifecycle
objects contained by this composite. -
stop
public void stop()Stops allLifecycle
objects contained by this composite.
-