public abstract class AbstractSelfDisconnectTransport extends AbstractObserverTransport
Modifier and Type | Field and Description |
---|---|
protected AtomicInteger |
connectCount |
protected TransportType |
transportType |
listenerObservers, log
Constructor and Description |
---|
AbstractSelfDisconnectTransport(TransportType transportType) |
Modifier and Type | Method and Description |
---|---|
protected int |
addConnectRef() |
void |
connect(StreamListener listener)
Connect to stream.
|
abstract void |
connectImpl() |
void |
disconnect(StreamListener listener)
Disconnect to stream.
|
abstract void |
disconnectImpl() |
void |
dispose()
Dispose the transport.
|
int |
getTotalConnectRefs() |
boolean |
isConnect()
Check if stream is connected.
|
protected int |
releaseConnectRef() |
removeMessageStreamListener, setMessageStreamListener
protected AtomicInteger connectCount
protected TransportType transportType
public AbstractSelfDisconnectTransport(TransportType transportType)
protected int addConnectRef()
protected int releaseConnectRef()
public int getTotalConnectRefs()
public void connect(StreamListener listener) throws IOException
StreamTransport
connect
in interface StreamTransport
connect
in class AbstractObserverTransport
listener
- the listenerIOException
- if error occurredpublic void disconnect(StreamListener listener) throws IOException
StreamTransport
disconnect
in interface StreamTransport
disconnect
in class AbstractObserverTransport
listener
- the listenerIOException
- if error occurredpublic abstract void connectImpl() throws IOException
IOException
public abstract void disconnectImpl() throws IOException
IOException
public void dispose() throws IOException
StreamTransport
This methods disconnect from stream and cleans all subscribed listeners.
dispose
in interface StreamTransport
dispose
in class AbstractObserverTransport
IOException
- if error occurredpublic boolean isConnect()
StreamTransport
Copyright © 2000-2017 EPAM Systems. All Rights Reserved.