Package org.globus.gram
Class CallbackHandler
java.lang.Object
org.globus.net.BaseServer
org.globus.gram.CallbackHandler
- All Implemented Interfaces:
Runnable
The
Server
class acts as a basic multi-threaded HTTPS
server.- Version:
- $Revision: 1.31 $
-
Field Summary
FieldsFields inherited from class org.globus.net.BaseServer
_server, accept, authorization, credentials, deactivator, gssMode, SO_TIMEOUT, timeout, url
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a GRAM callback handler with default user credentials.CallbackHandler
(GSSCredential cred, int port) Construct a GRAM callback handler with specifed credentials and given port. -
Method Summary
Modifier and TypeMethodDescriptionprotected GramJob
int
Returns number of registered jobsgetURL()
Returns url of this serverprotected void
handleConnection
(Socket socket) This method needs to be implemented by subclasses.private void
init()
void
registerJob
(GramJob job) Registers gram job to listen for status updatesvoid
unregisterJob
(GramJob job) Unregisters gram job from listening to status updatesMethods inherited from class org.globus.net.BaseServer
getCredentials, getHost, getHostname, getPort, getProtocol, getTimeout, initialize, registerDefaultDeactivator, run, setAuthorization, setGssMode, setTimeout, shutdown, start, unregisterDefaultDeactivator, wrapSocket
-
Field Details
-
_jobs
Registered jobs
-
-
Constructor Details
-
CallbackHandler
Construct a GRAM callback handler with default user credentials. Port will be dynamically assigned.- Throws:
IOException
-
CallbackHandler
Construct a GRAM callback handler with specifed credentials and given port.- Parameters:
cred
- credentials to use. if null default user credentials will be usedport
- server port to listen on. if set to 0 the port will be dynamically assigned- Throws:
IOException
-
-
Method Details
-
init
private void init() -
registerJob
Registers gram job to listen for status updates- Parameters:
job
- gram job
-
unregisterJob
Unregisters gram job from listening to status updates- Parameters:
job
- gram job
-
getJob
-
getRegisteredJobsSize
public int getRegisteredJobsSize()Returns number of registered jobs- Returns:
- int number of jobs
-
getURL
Description copied from class:BaseServer
Returns url of this server- Overrides:
getURL
in classBaseServer
- Returns:
- url of this server
-
handleConnection
Description copied from class:BaseServer
This method needs to be implemented by subclasses. Optimmaly, it should be a non-blocking call starting a separate thread to handle the client. Note that to start an SSL handshake, you need to call socket.getInput(Output) stream().- Specified by:
handleConnection
in classBaseServer
-