Spring Data for VMware GemFire
Class CompositeLifecycle
java.lang.Object
org.springframework.data.gemfire.support.CompositeLifecycle
- All Implemented Interfaces:
- Iterable<org.springframework.context.Lifecycle>,- org.springframework.context.Lifecycle,- org.springframework.context.Phased,- org.springframework.context.SmartLifecycle
public final class CompositeLifecycle
extends Object
implements Iterable<org.springframework.context.Lifecycle>, org.springframework.context.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
- See Also:
- 
- Iterable
- Lifecycle
- SmartLifecycle
 
- 
Field SummaryFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanadd(org.springframework.context.Lifecycle lifecycleComponent) Adds 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<org.springframework.context.Lifecycle>iterator()Returns anIteratorover theLifecycleobjects contained by this composite.booleanremove(org.springframework.context.Lifecycle lifecycleComponent) Removes 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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.IterableforEach, spliteratorMethods inherited from interface org.springframework.context.SmartLifecyclegetPhase, isAutoStartup, stop
- 
Constructor Details- 
CompositeLifecyclepublic CompositeLifecycle()
 
- 
- 
Method Details- 
addpublic boolean add(@NonNull org.springframework.context.Lifecycle lifecycleComponent) Adds aLifecycleobject to this composite.- Parameters:
- lifecycleComponent-- Lifecycleobject to add to this composite.
- Returns:
- a boolean value if the Lifecycleobject is not null and was successfully added to this composite.
- See Also:
 
- 
isEmptypublic boolean isEmpty()Returns a boolean value indicating whether this composite contains anyLifecycleobjects.- Returns:
- a boolean value indicating whether this composite contains any Lifecycleobjects.
 
- 
iteratorReturns anIteratorover theLifecycleobjects contained by this composite.
- 
removepublic boolean remove(@Nullable org.springframework.context.Lifecycle lifecycleComponent) Removes the givenLifecycleobject from this composite.- Parameters:
- lifecycleComponent-- Lifecycleobject to remove.
- Returns:
- a boolean if the Lifecycleobject was part of this composite and was able to be removed successfully.
- See Also:
 
- 
sizepublic int size()Returns the number ofLifecycleobjects contained by this composite.- Returns:
- an integer value specifying the number of Lifecycleobjects contained by this composite.
 
- 
isRunningpublic boolean isRunning()Determines whether anyLifecycleobject contained by this composite is running.- Specified by:
- isRunningin interface- org.springframework.context.Lifecycle
- Returns:
- a boolean value indicating whether any Lifecycleobject contained by this composite is running.
- See Also:
- 
- Lifecycle.isRunning()
 
 
- 
startpublic void start()Starts allLifecycleobjects contained by this composite.- Specified by:
- startin interface- org.springframework.context.Lifecycle
- See Also:
 
- 
stoppublic void stop()Stops allLifecycleobjects contained by this composite.- Specified by:
- stopin interface- org.springframework.context.Lifecycle
- See Also:
 
 
- 
