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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds aLifecycleobject to this composite.booleanisEmpty()Returns a boolean value indicating whether this composite contains anyLifecycleobjects.booleanDetermines whether anyLifecycleobject contained by this composite is running.iterator()booleanRemoves the givenLifecycleobject from this composite.intsize()Returns the number ofLifecycleobjects contained by this composite.voidstart()Starts allLifecycleobjects contained by this composite.voidstop()Stops allLifecycleobjects contained by this composite.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.springframework.context.SmartLifecycle
getPhase, isAutoStartup, stop
-
Constructor Details
-
CompositeLifecycle
public CompositeLifecycle()
-
-
Method Details
-
add
Adds aLifecycleobject to this composite. -
isEmpty
public boolean isEmpty()Returns a boolean value indicating whether this composite contains anyLifecycleobjects.- Returns:
- a boolean value indicating whether this composite contains any
Lifecycleobjects.
-
iterator
-
remove
Removes the givenLifecycleobject from this composite. -
size
public int size()Returns the number ofLifecycleobjects contained by this composite.- Returns:
- an integer value specifying the number of
Lifecycleobjects contained by this composite.
-
isRunning
public boolean isRunning()Determines whether anyLifecycleobject contained by this composite is running. -
start
public void start()Starts allLifecycleobjects contained by this composite. -
stop
public void stop()Stops allLifecycleobjects contained by this composite.
-