public abstract class StreamBaseDevice extends GenericBaseDevice implements BaseDevice
| Modifier and Type | Field and Description |
|---|---|
static int |
CONNECT_TIMEOUT |
protected IoSession |
session |
connectionListeners| Constructor and Description |
|---|
StreamBaseDevice(java.net.SocketAddress address) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect() |
void |
dispose() |
boolean |
isConnected() |
void |
sessionClosed(IoSession session) |
void |
sessionCreated(IoSession session) |
void |
sessionIdle(IoSession session,
IdleStatus status) |
void |
sessionOpened(IoSession session) |
protected void |
setTimeout(long timeout) |
protected abstract void |
setupConnector(SocketConnector connector) |
protected void |
writeMessage(java.lang.Object message)
Write a message to the outbound connection or fail if there is not open
connection at the moment
|
protected void |
writeMessageIgnore(java.lang.Object message)
Write a message to the outbound connection or ignore it if there is no
open connection at the moment
|
addConnectionListener, fireConnected, fireConnectionFailed, fireDisconnected, removeConnectionListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddConnectionListener, removeConnectionListenerpublic static final int CONNECT_TIMEOUT
protected IoSession session
protected abstract void setupConnector(SocketConnector connector)
public boolean isConnected()
isConnected in interface BaseDevicepublic void connect()
connect in interface BaseDevicepublic void dispose()
dispose in interface BaseDevicepublic void sessionCreated(IoSession session)
throws java.lang.Exception
java.lang.Exceptionprotected void setTimeout(long timeout)
public void sessionOpened(IoSession session)
throws java.lang.Exception
java.lang.Exceptionpublic void sessionIdle(IoSession session,
IdleStatus status)
throws java.lang.Exception
java.lang.Exceptionpublic void sessionClosed(IoSession session)
throws java.lang.Exception
java.lang.Exceptionprotected void writeMessage(java.lang.Object message)
throws NotConnectedException
message - the message to wrtiteNotConnectedException - thrown if there is no connection at the momentprotected void writeMessageIgnore(java.lang.Object message)
message - the message to write
Copyright (c) IBH SYSTEMS GmbH and others 2010, 2013.
All rights reserved. This program and the accompanying materials
are made available under the terms of the
Eclipse Public License v1.0