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:
-
IterableLifecycleSmartLifecycle
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier 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.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
public 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:
-
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
Returns anIteratorover theLifecycleobjects contained by this composite. -
remove
public 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:
-
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.- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle- Returns:
- a boolean value indicating whether any
Lifecycleobject contained by this composite is running. - See Also:
-
Lifecycle.isRunning()
-
start
public void start()Starts allLifecycleobjects contained by this composite.- Specified by:
startin interfaceorg.springframework.context.Lifecycle- See Also:
-
stop
public void stop()Stops allLifecycleobjects contained by this composite.- Specified by:
stopin interfaceorg.springframework.context.Lifecycle- See Also:
-