public class EmbeddedHandle extends java.lang.Object implements HandleInterface
EmbeddedServiceHandle
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_QUEUE_NAME |
protected java.lang.String |
handleId |
protected boolean |
isRegistered |
protected Fifo<java.lang.String> |
queue |
protected com.ibm.staf.STAFHandle |
stafHandle |
Constructor and Description |
---|
EmbeddedHandle(java.lang.String handleId)
Create and Register our STAFHandle subclass with STAF *and* our non-STAF handlers.
|
Modifier and Type | Method and Description |
---|---|
com.ibm.staf.STAFResult |
acceptQueueMessage(java.lang.String message)
Receive a queue message into our (non-STAF) FIFO queue.
|
void |
clearQueue() |
int |
getHandle() |
com.ibm.staf.STAFResult |
getQueueMessage(int timeout) |
void |
register()
Subclasses call this to invoke the overridden registerHandle function and set the isRegistered flag.
|
protected void |
registerHandle()
Override in subclasses.
|
com.ibm.staf.STAFResult |
sendQueueMessage(java.lang.String handler,
java.lang.String message)
Send a queue message to the FIFO queue of the specified (non-STAF) handler (handle/service).
|
void |
setHandleId(java.lang.String handleId)
If used, must be called before registering.
|
java.lang.String |
submit(java.lang.String handler,
java.lang.String request)
Send a submit request to a registered (non-STAF) service Handle.
|
java.lang.String |
submit(java.lang.String machine,
java.lang.String handler,
java.lang.String request)
Tries to use a registered (non-STAF) Handler first before resorting to the super (STAF) submit.
|
com.ibm.staf.STAFResult |
submit2(java.lang.String handler,
java.lang.String request)
Send a submit2 request to a registered (non-STAF) service Handle.
|
com.ibm.staf.STAFResult |
submit2(java.lang.String machine,
java.lang.String handler,
java.lang.String request)
Tries to use a registered (non-STAF) Handler first before resorting to the super (STAF) submit2.
|
void |
unRegister()
Unregisters the Handle from both our registered (non-STAF) handlers and STAF, if applicable.
|
public static final java.lang.String DEFAULT_QUEUE_NAME
protected java.lang.String handleId
protected Fifo<java.lang.String> queue
protected boolean isRegistered
protected com.ibm.staf.STAFHandle stafHandle
public EmbeddedHandle(java.lang.String handleId) throws com.ibm.staf.STAFException
handleId
- com.ibm.staf.STAFException
public void setHandleId(java.lang.String handleId)
setHandleId
in interface HandleInterface
public void register() throws com.ibm.staf.STAFException
register
in interface HandleInterface
com.ibm.staf.STAFException
protected void registerHandle() throws com.ibm.staf.STAFException
com.ibm.staf.STAFException
public java.lang.String submit(java.lang.String handler, java.lang.String request) throws com.ibm.staf.STAFException
com.ibm.staf.STAFException
- if the service is not registered.org.safs.staf.embedded.HandleInterface#submit(java.lang.String, java.lang.String)
public com.ibm.staf.STAFResult submit2(java.lang.String handler, java.lang.String request) throws com.ibm.staf.STAFException
com.ibm.staf.STAFException
- if the service is not registered.org.safs.staf.embedded.HandleInterface#submit2(java.lang.String, java.lang.String)
public com.ibm.staf.STAFResult acceptQueueMessage(java.lang.String message)
acceptQueueMessage
in interface HandleInterface
HandleInterface.acceptQueueMessage(java.lang.String)
public com.ibm.staf.STAFResult sendQueueMessage(java.lang.String handler, java.lang.String message) throws com.ibm.staf.STAFException
sendQueueMessage
in interface HandleInterface
handler
- -- destination handle name for the message.message
- -- the message to send.com.ibm.staf.STAFException
HandleInterface.sendQueueMessage(java.lang.String, java.lang.String)
public com.ibm.staf.STAFResult getQueueMessage(int timeout)
getQueueMessage
in interface HandleInterface
public java.lang.String submit(java.lang.String machine, java.lang.String handler, java.lang.String request) throws com.ibm.staf.STAFException
submit
in interface HandleInterface
com.ibm.staf.STAFException
STAFHandle.submit(java.lang.String, java.lang.String, java.lang.String)
public com.ibm.staf.STAFResult submit2(java.lang.String machine, java.lang.String handler, java.lang.String request)
submit2
in interface HandleInterface
STAFHandle.submit2(java.lang.String, java.lang.String, java.lang.String)
public void unRegister()
unRegister
in interface HandleInterface
STAFHandle.unRegister()
public int getHandle()
getHandle
in interface HandleInterface
public void clearQueue()
Copyright © SAS Institute. All Rights Reserved.