org.crsh.util
Class Safe

java.lang.Object
  extended by org.crsh.util.Safe

public class Safe
extends Object


Constructor Summary
Safe()
           
 
Method Summary
static Exception close(Closeable closeable)
          Close the closeable and catch any exception thrown.
static Exception close(Connection connection)
          Close the connection and catch any exception thrown.
static Exception close(Context context)
          Close the context and catch any exception thrown.
static Exception close(ResultSet rs)
          Close the result set and catch any exception thrown.
static Exception close(Socket socket)
          Close the socket and catch any exception thrown.
static Exception close(Statement statement)
          Close the statement and catch any exception thrown.
static boolean equals(Object o1, Object o2)
           
static Exception flush(Flushable flushable)
          Flush the flushable and catch any exception thrown.
static boolean notEquals(Object o1, Object o2)
           
static
<T extends Throwable>
void
rethrow(Class<T> throwableClass, Throwable cause)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Safe

public Safe()
Method Detail

close

public static Exception close(Socket socket)
Close the socket and catch any exception thrown.

Parameters:
socket - the socket to close
Returns:
any Exception thrown during the close operation

close

public static Exception close(Closeable closeable)
Close the closeable and catch any exception thrown.

Parameters:
closeable - the closeable to close
Returns:
any Exception thrown during the close operation

close

public static Exception close(Connection connection)
Close the connection and catch any exception thrown.

Parameters:
connection - the socket to close
Returns:
any Exception thrown during the close operation

close

public static Exception close(Statement statement)
Close the statement and catch any exception thrown.

Parameters:
statement - the statement to close
Returns:
any Exception thrown during the close operation

close

public static Exception close(ResultSet rs)
Close the result set and catch any exception thrown.

Parameters:
rs - the result set to close
Returns:
any Exception thrown during the close operation

close

public static Exception close(Context context)
Close the context and catch any exception thrown.

Parameters:
context - the context to close
Returns:
any Exception thrown during the close operation

rethrow

public static <T extends Throwable> void rethrow(Class<T> throwableClass,
                                                 Throwable cause)
                    throws T extends Throwable
Throws:
T extends Throwable

equals

public static boolean equals(Object o1,
                             Object o2)

notEquals

public static boolean notEquals(Object o1,
                                Object o2)

flush

public static Exception flush(Flushable flushable)
Flush the flushable and catch any exception thrown.

Parameters:
flushable - the flushable to flush
Returns:
any Exception thrown during the flush operation


Copyright © 2013 eXo Platform SAS. All Rights Reserved.