Package com.swiftmq.swiftlet.net
Class Connection
- java.lang.Object
-
- com.swiftmq.swiftlet.net.Connection
-
public abstract class Connection extends java.lang.Object
An abstract connection.- Author:
- IIT GmbH, Bremen/Germany, Copyright (c) 2000-2002, All Rights Reserved
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
dnsResolve
-
Constructor Summary
Constructors Modifier Constructor Description protected
Connection(boolean dnsResolve)
Constructs the Connection
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
Closes this connection.long
getConnectTime()
Returns the connect time.abstract java.lang.String
getHostname()
Returns the host name with which this connection is established to.InboundHandler
getInboundHandler()
Returns the connection inbound handler.java.util.concurrent.atomic.AtomicBoolean
getInputActiveIndicator()
abstract java.io.InputStream
getInputStream()
Returns the connection input stream.ConnectionMetaData
getMetaData()
Returns the connection meta dataabstract java.io.OutputStream
getOutputStream()
Returns the connection output stream.ProtocolInputHandler
getProtocolInputHandler()
ProtocolOutputHandler
getProtocolOutputHandler()
java.lang.Object
getUserObject()
Returns the user objectboolean
isClosed()
Returns whether this connection is closed.boolean
isMarkedForClose()
Returns whether this connection is marked for close.void
setConnectionListener(ConnectionListener connectionListener)
Set the connection listener.void
setInboundHandler(InboundHandler inboundHandler)
Set the connection inbound handler.void
setMarkedForClose()
Mark this connection for close.void
setMetaData(ConnectionMetaData metaData)
Set the connection meta data Internal use only.void
setProtocolInputHandler(ProtocolInputHandler protocolInputHandler)
void
setProtocolOutputHandler(ProtocolOutputHandler protocolOutputHandler)
void
setUserObject(java.lang.Object userObject)
Set a user object.
-
-
-
Method Detail
-
setConnectionListener
public void setConnectionListener(ConnectionListener connectionListener)
Set the connection listener. Internal use only.- Parameters:
connectionListener
- connection listener.
-
getMetaData
public ConnectionMetaData getMetaData()
Returns the connection meta data
-
setMetaData
public void setMetaData(ConnectionMetaData metaData)
Set the connection meta data Internal use only.- Parameters:
metaData
- meta data.
-
getUserObject
public java.lang.Object getUserObject()
Returns the user object- Returns:
- user object.
-
setUserObject
public void setUserObject(java.lang.Object userObject)
Set a user object. Can be used to assign user (Swiftlet) specific data to this connection.- Parameters:
userObject
- user object.
-
getProtocolInputHandler
public ProtocolInputHandler getProtocolInputHandler()
-
setProtocolInputHandler
public void setProtocolInputHandler(ProtocolInputHandler protocolInputHandler)
-
getProtocolOutputHandler
public ProtocolOutputHandler getProtocolOutputHandler()
-
setProtocolOutputHandler
public void setProtocolOutputHandler(ProtocolOutputHandler protocolOutputHandler)
-
getInputActiveIndicator
public java.util.concurrent.atomic.AtomicBoolean getInputActiveIndicator()
-
getHostname
public abstract java.lang.String getHostname()
Returns the host name with which this connection is established to.- Returns:
- host name (null for multicast connections).
-
getInboundHandler
public InboundHandler getInboundHandler()
Returns the connection inbound handler.- Returns:
- inbound handler.
-
setInboundHandler
public void setInboundHandler(InboundHandler inboundHandler)
Set the connection inbound handler. Internal use only.- Parameters:
inboundHandler
- inbound handler.
-
getInputStream
public abstract java.io.InputStream getInputStream()
Returns the connection input stream.- Returns:
- input stream.
-
getOutputStream
public abstract java.io.OutputStream getOutputStream()
Returns the connection output stream.- Returns:
- output stream.
-
getConnectTime
public long getConnectTime()
Returns the connect time.- Returns:
- connect time.
-
setMarkedForClose
public void setMarkedForClose()
Mark this connection for close. Internal use only.
-
isMarkedForClose
public boolean isMarkedForClose()
Returns whether this connection is marked for close.- Returns:
- true/false.
-
isClosed
public boolean isClosed()
Returns whether this connection is closed.- Returns:
- true/false.
-
close
public void close()
Closes this connection. Internal use only.
-
-