org.sonatype.sisu.goodies.lifecycle
Class LifecycleShutdownManager

java.lang.Object
  extended by org.sonatype.sisu.goodies.common.ComponentSupport
      extended by org.sonatype.sisu.goodies.lifecycle.LifecycleShutdownManager
All Implemented Interfaces:
LifecycleContainer

public class LifecycleShutdownManager
extends ComponentSupport
implements LifecycleContainer

Manages a shutdown hook to trigger Lifecycle.stop() on all registered components.

Since:
1.0

Field Summary
 
Fields inherited from class org.sonatype.sisu.goodies.common.ComponentSupport
log
 
Constructor Summary
LifecycleShutdownManager()
           
 
Method Summary
 LifecycleShutdownManager add(LifecycleAware... components)
           
<T extends LifecycleAware>
T
add(T component)
           
 void clear()
           
 LifecycleShutdownManager remove(LifecycleAware... components)
           
<T extends LifecycleAware>
T
remove(T component)
           
 
Methods inherited from class org.sonatype.sisu.goodies.common.ComponentSupport
createLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LifecycleShutdownManager

public LifecycleShutdownManager()
Method Detail

add

public <T extends LifecycleAware> T add(T component)
Specified by:
add in interface LifecycleContainer

add

public LifecycleShutdownManager add(LifecycleAware... components)
Specified by:
add in interface LifecycleContainer

remove

public <T extends LifecycleAware> T remove(T component)
Specified by:
remove in interface LifecycleContainer

remove

public LifecycleShutdownManager remove(LifecycleAware... components)
Specified by:
remove in interface LifecycleContainer

clear

public void clear()
Specified by:
clear in interface LifecycleContainer


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.