Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public interface TcpConnection
- {
- /**
- * Connected.
- *
- * @throws NGException the NG exception
- */
- public void connected() throws NGException;
- /**
- * This method will send the received data from the InputStream of the connection.
- *
- * @param data the received data
- * @throws NGException the NG exception
- */
- public void received( byte[] data ) throws NGException;
- /**
- * Usable for the protocol to send data to the device.
- *
- * @param data the data to send to the device ( Will be converted to byte[] with getBytes() )
- * @throws NGException the NG exception
- */
- public void send( String data ) throws NGException;
- /**
- * Usable for the protocol to send data to the device.
- *
- * @param data the data to send to the device ( Will be send as is )
- * @throws NGException the NG exception
- */
- public void send( byte[] data ) throws NGException;
- /**
- * This method will inform the protocol that the connection got closed.
- *
- * @throws PilotNGException the NG exception
- */
- public void closed() throws NGException;
- }
- /** The callback. */
- private TcpConnection callback;
- private void disconnect()
- {
- connection.disconnect();
- if ( !getStatus( jndiName ).equals( ConnectionStatus.FAILURE ) )
- {
- setStatus( ConnectionStatus.CLOSED );
- }
- /* TODO: Tell driver connection is closed! */
- callback.closed();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement