@Override public void run() { try { FilteredObjectInputStream in = new FilteredObjectInputStream(socket.getInputStream()); while (isOpen()) { Message msg = (Message) in.readObject(); handle(msg); } } catch (EOFException eof) { // Remote side has closed the connection, just cleanup. try { close(); } catch (Exception unused) { // no-op. } } catch (Exception e) { if (!closed) { LOG.log(Level.WARNING, "Error in inbound message handling.", e); try { close(); } catch (Exception unused) { // no-op. } } } }
@Override public void run() { try { ObjectInputStream in = new ObjectInputStream(socket.getInputStream()); while (!closed) { Message msg = (Message) in.readObject(); handle(msg); } } catch (EOFException eof) { // Remote side has closed the connection, just cleanup. try { close(); } catch (Exception unused) { // no-op. } } catch (Exception e) { if (!closed) { LOG.log(Level.WARNING, "Error in inbound message handling.", e); try { close(); } catch (Exception unused) { // no-op. } } } }
@Override public void close() throws IOException { if (!isOpen()) { return; } synchronized (clients) { clients.remove(this); } super.close(); }
@Override public synchronized void close() throws IOException { if (isOpen()) { closed = true; socket.close(); } }
@Override public void stop() { CommandBuilderUtils.checkState(connection != null, "Application is still not connected."); try { connection.send(new LauncherProtocol.Stop()); } catch (IOException ioe) { throw new RuntimeException(ioe); } }
@Override public void close() throws IOException { if (!isOpen()) { return; } synchronized (clients) { clients.remove(this); } super.close(); }
@Override public void run() { try { FilteredObjectInputStream in = new FilteredObjectInputStream(socket.getInputStream()); while (!closed) { Message msg = (Message) in.readObject(); handle(msg); } } catch (EOFException eof) { // Remote side has closed the connection, just cleanup. try { close(); } catch (Exception unused) { // no-op. } } catch (Exception e) { if (!closed) { LOG.log(Level.WARNING, "Error in inbound message handling.", e); try { close(); } catch (Exception unused) { // no-op. } } } }
@Override public synchronized void close() throws IOException { if (isOpen()) { closed = true; socket.close(); } }
@Override public void stop() { CommandBuilderUtils.checkState(connection != null, "Application is still not connected."); try { connection.send(new LauncherProtocol.Stop()); } catch (IOException ioe) { throw new RuntimeException(ioe); } }
@Override public void run() { try { FilteredObjectInputStream in = new FilteredObjectInputStream(socket.getInputStream()); while (isOpen()) { Message msg = (Message) in.readObject(); handle(msg); } } catch (EOFException eof) { // Remote side has closed the connection, just cleanup. try { close(); } catch (Exception unused) { // no-op. } } catch (Exception e) { if (!closed) { LOG.log(Level.WARNING, "Error in inbound message handling.", e); try { close(); } catch (Exception unused) { // no-op. } } } }
protected synchronized void send(Message msg) throws IOException { try { CommandBuilderUtils.checkState(!closed, "Disconnected."); out.writeObject(msg); out.flush(); } catch (IOException ioe) { if (!closed) { LOG.log(Level.WARNING, "Error when sending message.", ioe); try { close(); } catch (Exception unused) { // no-op. } } throw ioe; } }
protected synchronized void send(Message msg) throws IOException { try { CommandBuilderUtils.checkState(!closed, "Disconnected."); out.writeObject(msg); out.flush(); } catch (IOException ioe) { if (!closed) { LOG.log(Level.WARNING, "Error when sending message.", ioe); try { close(); } catch (Exception unused) { // no-op. } } throw ioe; } }
protected synchronized void send(Message msg) throws IOException { try { CommandBuilderUtils.checkState(!closed, "Disconnected."); out.writeObject(msg); out.flush(); } catch (IOException ioe) { if (!closed) { LOG.log(Level.WARNING, "Error when sending message.", ioe); try { close(); } catch (Exception unused) { // no-op. } } throw ioe; } }
protected synchronized void send(Message msg) throws IOException { try { CommandBuilderUtils.checkState(!closed, "Disconnected."); out.writeObject(msg); out.flush(); } catch (IOException ioe) { if (!closed) { LOG.log(Level.WARNING, "Error when sending message.", ioe); try { close(); } catch (Exception unused) { // no-op. } } throw ioe; } }
@Override public synchronized void disconnect() { if (!disposed) { disposed = true; if (connection != null) { try { connection.close(); } catch (IOException ioe) { // no-op. } } server.unregister(this); if (redirector != null) { redirector.stop(); } } }
@Override public synchronized void disconnect() { if (!disposed) { disposed = true; if (connection != null) { try { connection.close(); } catch (IOException ioe) { // no-op. } } server.unregister(this); if (redirector != null) { redirector.stop(); } } }
@Override public void close() throws IOException { synchronized (clients) { clients.remove(this); } super.close(); if (handle != null) { if (!handle.getState().isFinal()) { LOG.log(Level.WARNING, "Lost connection to spark application."); handle.setState(SparkAppHandle.State.LOST); } handle.disconnect(); } }
@Override public void close() throws IOException { synchronized (clients) { clients.remove(this); } super.close(); if (handle != null) { if (!handle.getState().isFinal()) { LOG.log(Level.WARNING, "Lost connection to spark application."); handle.setState(SparkAppHandle.State.LOST); } handle.disconnect(); } }