public class StompConnection extends Object implements RemotingConnection
Modifier and Type | Method and Description |
---|---|
void |
addCloseListener(CloseListener listener)
add a CloseListener.
|
void |
addFailureListener(FailureListener listener)
add a failure listener.
|
void |
bufferReceived(Object connectionID,
HornetQBuffer buffer)
called by the remoting connection when a buffer is received.
|
boolean |
checkDataReceived()
returns true if any data has been received since the last time this method was called.
|
HornetQBuffer |
createBuffer(int size)
creates a new HornetQBuffer of the specified size.
|
void |
destroy()
destroys this connection.
|
void |
disconnect(boolean criticalError)
Disconnect the connection, closing all channels
|
boolean |
enableMessageID() |
void |
fail(HornetQException me)
called when the underlying connection fails.
|
void |
flush()
flush all outstanding data from the connection.
|
String |
getClientID() |
long |
getCreationTime()
Returns the creation time of the Remoting connection
|
StompDecoder |
getDecoder() |
List<FailureListener> |
getFailureListeners()
return all the failure listeners
|
Object |
getID()
returns the unique id of the Remoting Connection
|
String |
getLogin() |
String |
getPasscode() |
String |
getRemoteAddress()
returns a string representation of the remote address of this connection
|
Connection |
getTransportConnection()
return the underlying Connection.
|
boolean |
isClient()
returns whether or not the Remoting Connection is a client
|
boolean |
isDestroyed()
returns true if this Remoting Connection has been destroyed.
|
boolean |
isValid() |
boolean |
removeCloseListener(CloseListener listener)
remove a Close Listener
|
List<CloseListener> |
removeCloseListeners() |
boolean |
removeFailureListener(FailureListener listener)
remove the failure listener
|
List<FailureListener> |
removeFailureListeners() |
void |
setClientID(String clientID) |
void |
setCloseListeners(List<CloseListener> listeners) |
void |
setDataReceived() |
void |
setFailureListeners(List<FailureListener> listeners)
set the failure listeners.
|
void |
setLogin(String login) |
void |
setPasscode(String passcode) |
void |
setValid(boolean valid) |
public StompDecoder getDecoder()
public void addFailureListener(FailureListener listener)
RemotingConnection
addFailureListener
in interface RemotingConnection
listener
- the listenerpublic boolean removeFailureListener(FailureListener listener)
RemotingConnection
removeFailureListener
in interface RemotingConnection
listener
- the lister to removepublic void addCloseListener(CloseListener listener)
RemotingConnection
addCloseListener
in interface RemotingConnection
listener
- the listener to addpublic boolean removeCloseListener(CloseListener listener)
RemotingConnection
removeCloseListener
in interface RemotingConnection
listener
- the listener to removepublic List<CloseListener> removeCloseListeners()
removeCloseListeners
in interface RemotingConnection
public List<FailureListener> removeFailureListeners()
removeFailureListeners
in interface RemotingConnection
public void setCloseListeners(List<CloseListener> listeners)
setCloseListeners
in interface RemotingConnection
public void setFailureListeners(List<FailureListener> listeners)
RemotingConnection
setFailureListeners
in interface RemotingConnection
listeners
- the listeners to add.public void setDataReceived()
public boolean checkDataReceived()
RemotingConnection
checkDataReceived
in interface RemotingConnection
public HornetQBuffer createBuffer(int size)
RemotingConnection
createBuffer
in interface RemotingConnection
size
- the size of buffer requiredpublic void destroy()
RemotingConnection
destroy
in interface RemotingConnection
public void disconnect(boolean criticalError)
RemotingConnection
disconnect
in interface RemotingConnection
public void fail(HornetQException me)
RemotingConnection
fail
in interface RemotingConnection
me
- the exception that caused the failurepublic void flush()
RemotingConnection
flush
in interface RemotingConnection
public List<FailureListener> getFailureListeners()
RemotingConnection
getFailureListeners
in interface RemotingConnection
public Object getID()
RemotingConnection
getID
in interface RemotingConnection
public String getRemoteAddress()
RemotingConnection
getRemoteAddress
in interface RemotingConnection
public long getCreationTime()
RemotingConnection
getCreationTime
in interface RemotingConnection
public Connection getTransportConnection()
RemotingConnection
getTransportConnection
in interface RemotingConnection
public boolean isClient()
RemotingConnection
isClient
in interface RemotingConnection
public boolean isDestroyed()
RemotingConnection
isDestroyed
in interface RemotingConnection
public void bufferReceived(Object connectionID, HornetQBuffer buffer)
BufferHandler
bufferReceived
in interface BufferHandler
connectionID
- the connection the buffer was received onbuffer
- the buffer to decodepublic void setLogin(String login)
public String getLogin()
public void setPasscode(String passcode)
public String getPasscode()
public void setClientID(String clientID)
public String getClientID()
public boolean isValid()
public void setValid(boolean valid)
public boolean enableMessageID()
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.