Package org.apache.shiro.util
Class LifecycleUtils
- java.lang.Object
-
- org.apache.shiro.util.LifecycleUtils
-
public abstract class LifecycleUtils extends Object
Utility class to help callInitializable.init()andDestroyable.destroy()methods cleanly on any object.- Since:
- 0.2
-
-
Constructor Summary
Constructors Constructor Description LifecycleUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voiddestroy(Object o)static voiddestroy(Collection c)Callsdestroyfor each object in the collection.static voiddestroy(Destroyable d)static voidinit(Object o)static voidinit(Collection c)Callsinitfor each object in the collection.static voidinit(Initializable initializable)
-
-
-
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
Callsinitfor each object in the collection. If the collection isnullor empty, this method returns quietly.- Parameters:
c- the collection containing objects toinit.- 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)
Callsdestroyfor each object in the collection. If the collection isnullor empty, this method returns quietly.- Parameters:
c- the collection of objects to destroy.- Since:
- 0.9
-
-