Class JndiCloser


  • public final class JndiCloser
    extends java.lang.Object
    Helper class for closing JNDI resources. This class is separate from Closer because JNDI is not in Android.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void close​(javax.naming.Context context)
      Closes the specified Context.
      static boolean closeSilently​(javax.naming.Context context)
      Closes the specified Context, ignoring any exceptions thrown by the close operation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • close

        public static void close​(javax.naming.Context context)
                          throws javax.naming.NamingException
        Closes the specified Context.
        Parameters:
        context - the JNDI Context to close, may be null
        Throws:
        javax.naming.NamingException - if a problem occurred closing the specified JNDI Context
      • closeSilently

        public static boolean closeSilently​(javax.naming.Context context)
        Closes the specified Context, ignoring any exceptions thrown by the close operation.
        Parameters:
        context - the JNDI Context to close, may be null