public abstract class BaseServer extends Object implements Runnable
setTimeout()
function.Modifier and Type | Field and Description |
---|---|
protected ServerSocket |
_server |
protected boolean |
accept |
protected Authorization |
authorization |
protected GSSCredential |
credentials |
protected org.globus.net.AbstractServerDeactivator |
deactivator
A handler for the deactivation framework.
|
protected Integer |
gssMode |
static int |
SO_TIMEOUT
Socket timeout in milliseconds.
|
protected int |
timeout |
protected String |
url |
Constructor and Description |
---|
BaseServer() |
BaseServer(boolean secure,
int port) |
BaseServer(GSSCredential cred,
int port) |
BaseServer(int port) |
Modifier and Type | Method and Description |
---|---|
GSSCredential |
getCredentials() |
String |
getHost()
Returns hostname of this server.
|
String |
getHostname()
Returns hostname of this server
|
int |
getPort()
Returns port of this server
|
String |
getProtocol() |
int |
getTimeout() |
String |
getURL()
Returns url of this server
|
protected abstract void |
handleConnection(Socket socket)
This method needs to be implemented by subclasses.
|
protected void |
initialize()
This method should be called by all subclasses.
|
void |
registerDefaultDeactivator()
Registers a default deactivation handler.
|
void |
run() |
void |
setAuthorization(Authorization auth) |
void |
setGssMode(Integer mode) |
void |
setTimeout(int timeout)
Sets timeout for the created sockets.
|
void |
shutdown()
Stops the server but does
not stop all the client threads
|
protected void |
start()
Starts the server.
|
void |
unregisterDefaultDeactivator()
Unregisters a default deactivation handler.
|
protected Socket |
wrapSocket(Socket socket) |
public static final int SO_TIMEOUT
protected boolean accept
protected ServerSocket _server
protected String url
protected GSSCredential credentials
protected Authorization authorization
protected Integer gssMode
protected int timeout
protected org.globus.net.AbstractServerDeactivator deactivator
public BaseServer() throws IOException
IOException
public BaseServer(int port) throws IOException
IOException
public BaseServer(GSSCredential cred, int port) throws IOException
IOException
public BaseServer(boolean secure, int port) throws IOException
IOException
protected void initialize()
protected void start()
public void setTimeout(int timeout)
public int getTimeout()
public void shutdown()
public GSSCredential getCredentials()
public String getProtocol()
public String getURL()
public int getPort()
public String getHostname()
public String getHost()
protected Socket wrapSocket(Socket socket) throws GSSException
GSSException
public void setGssMode(Integer mode)
public void setAuthorization(Authorization auth)
protected abstract void handleConnection(Socket socket)
public void registerDefaultDeactivator()
public void unregisterDefaultDeactivator()
Copyright © 2016. All rights reserved.