|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.globus.net.BaseServer
public abstract class BaseServer
This class provides the basics for writing various servers.
Note: Sockets created by this server have a 5 minute default timeout.
The timeout can be changed using the setTimeout()
function.
Field Summary | |
---|---|
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 Summary | |
---|---|
BaseServer()
|
|
BaseServer(boolean secure,
int port)
|
|
BaseServer(GSSCredential cred,
int port)
|
|
BaseServer(int port)
|
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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
Method Detail |
---|
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()
public void run()
run
in interface Runnable
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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |