public static void safeClose(final Closeable closeable) { if (closeable != null) try { closeable.close(); } catch (Throwable t) { ROOT_LOGGER.failedToCloseResource(t, closeable); } }
public static void safeClose(final ServerSocket serverSocket) { if (serverSocket != null) try { serverSocket.close(); } catch (IOException e) { ROOT_LOGGER.failedToCloseServerSocket(e, serverSocket); } }
socket.close(); } catch (IOException e) { CLIENT_LOGGER.failedToCloseSocket(e); CLIENT_LOGGER.failedToAcceptConnection(e); CLIENT_LOGGER.failedToAcceptConnection(e);
private void safeHandleConnection(final Socket socket) { boolean ok = false; try { final ConnectionImpl connection = new ConnectionImpl(socket, MessageHandler.NULL, readExecutor, callback); connection.setMessageHandler(connectionHandler.handleConnected(connection)); final Thread thread = threadFactory.newThread(connection.getReadTask()); if (thread == null) { throw MESSAGES.threadCreationRefused(); } thread.setName("Read thread for " + socket.getRemoteSocketAddress()); thread.start(); ok = true; } catch (IOException e) { CLIENT_LOGGER.failedToHandleIncomingConnection(e); } finally { if (! ok) { try { socket.close(); } catch (IOException e) { CLIENT_LOGGER.failedToCloseSocket(e); } } } }
void safeHandleFinished() { try { messageHandler.handleFinished(this); } catch (IOException e) { CONNECTION_LOGGER.failedToHandleSocketFinished(e); } }
public static void safeFinish(final Unmarshaller unmarshaller) { if (unmarshaller != null) try { unmarshaller.finish(); } catch (IOException e) { ROOT_LOGGER.failedToFinishUnmarshaller(e, unmarshaller); } }
public static void safeFinish(final Marshaller marshaller) { if (marshaller != null) try { marshaller.finish(); } catch (IOException e) { ROOT_LOGGER.failedToFinishMarshaller(e, marshaller); } }
void safeHandleShutdown() { try { messageHandler.handleShutdown(this); } catch (IOException e) { CONNECTION_LOGGER.failedToHandleSocketShutdown(e); } }
void safeHandlerFailure(IOException e) { try { messageHandler.handleFailure(this, e); } catch (IOException e1) { CONNECTION_LOGGER.failedToHandleSocketFailure(e); } }
public static void safeClose(final XMLStreamWriter writer) { if (writer != null) try { writer.close(); } catch (Throwable t) { ROOT_LOGGER.failedToCloseResource(t, writer); } } }
public static void safeClose(final Socket socket) { if (socket != null) try { socket.close(); } catch (Throwable t) { ROOT_LOGGER.failedToCloseResource(t, socket); } }