|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--galaxy.server.Environment
The class encapsulates the environment of the current execution context. This includes methods for dispatching frames to a Hub (with and without support for continuation) and methods for sending replies to a Hub.
Constructor Summary | |
Environment()
Creates an empty environment. |
|
Environment(GFrame frame,
GalaxyInputStream in,
GalaxyOutputStream out)
Creates an environmens for use by handshake code (i.e., not associated with a server or dispatch function). |
|
Environment(GFrame frame,
Server server)
Creates an environment for use by a server when processing calls to its dispatch functions. |
Method Summary | |
void |
deleteServerProperties(java.lang.String[] keys)
Deletes the specified server properties. |
void |
deleteSessionProperties(java.lang.String[] keys)
Deletes the specified session properties. |
void |
destroyToken()
Sends a "destroy token" reply. |
GFrame |
dispatchFrame(GFrame frame)
Dispatches a frame to the Hub. |
GFrame |
dispatchFrameToProvider(GFrame frame,
java.lang.String providerID)
Dispatches a frame to the Hub. |
boolean |
dispatchFrameToProviderWithContinuation(GFrame frame,
Continuation continuation,
java.lang.Object continuationState,
java.lang.String providerID)
Dispatches a frame to the Hub, and tells the Hub that the reply does not have to be sent immediately. |
boolean |
dispatchFrameWithContinuation(GFrame frame,
Continuation continuation,
java.lang.Object continuationState)
Dispatches a frame to the Hub, and tells the Hub that the reply does not have to be sent immediately. |
void |
error(java.lang.String description)
Sends an error reply. |
void |
error(java.lang.String description,
int errno)
Sends an error reply. |
GFrame |
getHubOpaqueData()
Returns the opaque Hub data associated with this environment. |
GalaxyInputStream |
getInputStream()
Returns the input stream associated with this environment. |
java.lang.String |
getMsgName()
Returns the message name associated with this environment. |
GalaxyMessage |
getNextMessage()
Returns the next message on the queue of unprocessed messages encountered during calls to dispatchFrame . |
java.lang.String |
getOpName()
Returns the operation name associated with this environment. |
java.lang.String |
getOriginatingProvider()
Returns the id of the originating server associated with the message that created this environment. |
GalaxyOutputStream |
getOutputStream()
Returns the output stream associated with this environment. |
GFrame |
getServerProperties(java.lang.String[] keys)
Gets the specified server properties. |
java.lang.String |
getSessionId()
Returns the session id associated with this environment. |
GFrame |
getSessionProperties(java.lang.String[] keys)
Gets the specified session properties. |
int |
getTidx()
Returns the token index associated with this environment. |
double |
getTokenTimestamp()
Returns the timestamp associated with this environment. |
void |
inheritTokenTimestamp()
Inherits the current token timestamp and sends that timestamp with all new messages. |
void |
modifyServerProperties(GFrame props,
java.lang.String[] keys)
Modifies the specified server properties. |
void |
modifySessionProperties(GFrame props,
java.lang.String[] keys)
Modifies the specified session properties. |
void |
postponeReply()
Sends a "postpone" reply. |
void |
reply(GFrame frame)
Sends a normal reply. |
void |
setServerProperties(GFrame props)
Sets the specified server properties. |
void |
setSessionId(java.lang.String sessionId,
int lockInfo)
Sets the session id and informs the Hub. |
void |
setSessionProperties(GFrame props)
Sets the specified session properties. |
void |
updateSessionId(java.lang.String sessionId)
Sets the session id local to this environment. |
void |
writeFrame(GFrame frame)
Writes a new frame to the Hub. |
void |
writeFrameToProvider(GFrame frame,
java.lang.String providerID)
Writes a new frame to the Hub. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Environment(GFrame frame, GalaxyInputStream in, GalaxyOutputStream out)
frame
- GFrame
of the current execution contextin
- input stream associated with the current execution contextout
- output stream associated with the current execution contextpublic Environment(GFrame frame, Server server)
frame
- GFrame
of the current execution contextserver
- Server
that created this environmentpublic Environment()
Method Detail |
public int getTidx()
public GFrame getHubOpaqueData()
public java.lang.String getSessionId()
public java.lang.String getOpName()
public java.lang.String getMsgName()
public GalaxyInputStream getInputStream()
public GalaxyOutputStream getOutputStream()
public double getTokenTimestamp()
public void inheritTokenTimestamp()
public java.lang.String getOriginatingProvider()
public GalaxyMessage getNextMessage()
dispatchFrame
.public GFrame dispatchFrame(GFrame frame) throws DispatchError
frame
- the frame to dispatchDispatchError
- exception if it reads an error
back from the Hubpublic GFrame dispatchFrameToProvider(GFrame frame, java.lang.String providerID) throws DispatchError
frame
- the frame to dispatchproviderID
- the id of the target service provider. If null, it
is ignored.DispatchError
- exception if it reads an error
back from the Hubpublic void writeFrame(GFrame frame) throws java.io.IOException
dispatchFrame
. The session ID (if it is set) of the
current call environment is added to incoming frame before it is
written to the Hub.frame
- the frame to writeIOException
- exception if there is an error writing
to the Hubpublic void writeFrameToProvider(GFrame frame, java.lang.String providerID) throws java.io.IOException
dispatchFrame
. The session ID (if it is set) of the
current call environment is added to incoming frame before it is
written to the Hub.frame
- the frame to writeproviderID
- the id of the targer service provider. If null, it
is ignored.IOException
- exception if there is an error writing
to the Hubpublic boolean dispatchFrameWithContinuation(GFrame frame, Continuation continuation, java.lang.Object continuationState)
frame
- the frame to dispatchcontinuation
- defines the action to take once the reply to this
dispatch arrives at the servercontinuationState
- state information used to process the replypublic boolean dispatchFrameToProviderWithContinuation(GFrame frame, Continuation continuation, java.lang.Object continuationState, java.lang.String providerID)
frame
- the frame to dispatchcontinuation
- defines the action to take once the reply to this
dispatch arrives at the servercontinuationState
- state information used to process the replyproviderID
- the id of the target service provider. If null, it
is ignored.public void postponeReply() throws java.io.IOException
public void destroyToken() throws java.io.IOException
public void error(java.lang.String description) throws java.io.IOException
description
- textual error message (error number is set to
galaxy.lang.ErrorMessage.GAL_APPLICATION_ERROR)public void error(java.lang.String description, int errno) throws java.io.IOException
description
- textual error messageerrno
- error number as defined in galaxy.lang.ErrorMessagepublic void reply(GFrame frame) throws java.io.IOException
frame
- the frame to send in the replypublic GFrame getSessionProperties(java.lang.String[] keys) throws DispatchError
keys
- the keys of the properties to getpublic void setSessionProperties(GFrame props) throws java.io.IOException
props
- the properties to setIOException
- exception if there is an error writing
to the Hubpublic void deleteSessionProperties(java.lang.String[] keys) throws java.io.IOException
keys
- the keys of the properties to deleteIOException
- exception if there is an error writing
to the Hubpublic void modifySessionProperties(GFrame props, java.lang.String[] keys) throws java.io.IOException
props
- the properties to setkeys
- the keys of the properties to deleteIOException
- exception if there is an error writing
to the Hubpublic GFrame getServerProperties(java.lang.String[] keys) throws DispatchError
keys
- the keys of the properties to getpublic void setServerProperties(GFrame props) throws java.io.IOException
props
- the properties to setIOException
- exception if there is an error writing
to the Hubpublic void deleteServerProperties(java.lang.String[] keys) throws java.io.IOException
keys
- the keys of the properties to deleteIOException
- exception if there is an error writing
to the Hubpublic void modifyServerProperties(GFrame props, java.lang.String[] keys) throws java.io.IOException
props
- the properties to setkeys
- the keys of the properties to deleteIOException
- exception if there is an error writing
to the Hubpublic void updateSessionId(java.lang.String sessionId)
sessionId
- the new session idpublic void setSessionId(java.lang.String sessionId, int lockInfo) throws java.io.IOException
sessionId
- the new session idlockInfo
- the locking information (OR'ed combination of
GFrame server/session lock values)IOException
- exception if there is an error writing
to the Hub
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |