org.apache.shiro.util
Class LifecycleUtils

java.lang.Object
  extended by org.apache.shiro.util.LifecycleUtils

public abstract class LifecycleUtils
extends Object

Utility class to help call Initializable.init() and Destroyable.destroy() methods cleanly on any object.

Since:
0.2

Constructor Summary
LifecycleUtils()
           
 
Method Summary
static void destroy(Collection c)
          Calls destroy for each object in the collection.
static void destroy(Destroyable d)
           
static void destroy(Object o)
           
static void init(Collection c)
          Calls init for each object in the collection.
static void init(Initializable initializable)
           
static void init(Object o)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LifecycleUtils

public LifecycleUtils()
Method Detail

init

public static void init(Object o)
                 throws ShiroException
Throws:
ShiroException

init

public static void init(Initializable initializable)
                 throws ShiroException
Throws:
ShiroException

init

public static void init(Collection c)
                 throws ShiroException
Calls init for each object in the collection. If the collection is null or empty, this method returns quietly.

Parameters:
c - the collection containing objects to init.
Throws:
ShiroException - if unable to initialize one or more instances.
Since:
0.9

destroy

public static void destroy(Object o)

destroy

public static void destroy(Destroyable d)

destroy

public static void destroy(Collection c)
Calls destroy for each object in the collection. If the collection is null or empty, this method returns quietly.

Parameters:
c - the collection of objects to destroy.
Since:
0.9


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.