public abstract class SessionHandlerBase extends Object implements SessionHandlerInterface
Implementation of a session handler that uses a Java socket to listen for incoming session requests.
Modifier and Type | Field and Description |
---|---|
static int |
ListenBacklog |
Constructor and Description |
---|
SessionHandlerBase(String name,
String protocol,
NetworkServer server,
InetAddress addr,
int port)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
clearShutdown()
Clear the shutdown flag
|
abstract void |
closeSessionHandler(NetworkServer server)
Close the session handler
|
InetAddress |
getBindAddress()
Return the network address that the server should bind to
|
String |
getHandlerName()
Return the session handler name
|
int |
getListenBacklog()
Return the socket listen backlog limit
|
protected int |
getNextSessionId()
Get the next available session id
|
int |
getPort()
Return the port that the server should bind to
|
String |
getProtocolName()
Return the short protocol name
|
NetworkServer |
getServer()
Return the server
|
boolean |
hasBindAddress()
Check if the server should bind to a specific network address
|
boolean |
hasDebug()
Determine if debug output is enabled
|
protected boolean |
hasShutdown()
Determine if the shutdown flag has been set
|
abstract void |
initializeSessionHandler(NetworkServer server)
Initialize the session handler
|
void |
setDebug(boolean dbg)
Enable/disable debug output
|
protected void |
setPort(int port)
Set the local port that the session handler is using
|
protected void |
setShutdown(boolean shut)
Set/clear the shutdown flag
|
String |
toString()
Return the session handler details as a string
|
public static final int ListenBacklog
public SessionHandlerBase(String name, String protocol, NetworkServer server, InetAddress addr, int port)
name
- Stringprotocol
- Stringserver
- NetworkServeraddr
- InetAddressport
- intpublic final NetworkServer getServer()
public final String getHandlerName()
getHandlerName
in interface SessionHandlerInterface
public final String getProtocolName()
public final boolean hasBindAddress()
public final InetAddress getBindAddress()
public final int getPort()
public final int getListenBacklog()
public final boolean hasDebug()
protected final void clearShutdown()
protected final boolean hasShutdown()
protected int getNextSessionId()
public final void setDebug(boolean dbg)
dbg
- booleanprotected final void setPort(int port)
port
- intprotected final void setShutdown(boolean shut)
shut
- booleanpublic abstract void initializeSessionHandler(NetworkServer server) throws IOException
initializeSessionHandler
in interface SessionHandlerInterface
server
- NetworkServerIOException
public abstract void closeSessionHandler(NetworkServer server)
closeSessionHandler
in interface SessionHandlerInterface
server
- NetworkServerCopyright © 2005–2018 Alfresco Software. All rights reserved.