public class MClientRequest extends MOperation
MServerRequest
, and passes it to the appropriate method.Modifier and Type | Field and Description |
---|---|
protected MException |
m_exception |
protected boolean |
m_isTimedout |
protected MClientReply |
m_reply |
protected MRpcClient |
m_rpcClient |
m_operationInstance, m_trackingInfo, m_userClosure
m_app, m_classDescription, m_operationClassName, m_operationDescription, m_operationName
OPERATION_CLOSURE_TAG, OPERATION_EXCEPTIONDATA_TAG, OPERATION_EXCEPTIONNAME_TAG, OPERATION_HASEXCEPTION_TAG, OPERATION_REQUEST_TAG, OPERATION_RETURNVALUE_TAG, OPERATION_USERCLOSURE_TAG
Constructor and Description |
---|
MClientRequest(MApp app,
java.lang.String operationClassName,
java.lang.String operationName,
java.lang.String clientName)
Construct an
MClientRequest object. |
Modifier and Type | Method and Description |
---|---|
void |
asyncInvoke(MOperationReplyListener listener)
Use the default timeout to invoke the operation.
|
void |
asyncInvoke(MOperationReplyListener listener,
long timeout)
Invoke the operation with a specified timeout.
|
java.util.Enumeration |
get()
Enumerate over the list of parameter values.
|
java.util.Enumeration |
getKeys()
Enumerate over the list of parameter names.
|
MClientReply |
getReply()
Return the reply to this request.
|
void |
onewayInvoke()
Invoke the operation expecting no reply.
|
void |
syncInvoke()
Invoke the operation.
|
void |
syncInvoke(int timeout)
Invoke the operation.
|
protected boolean |
validateParameter(java.lang.String attributeName) |
get, getClosure, getTrackingInfo, isNullData, set, setClosure, setNullData, setTrackingInfo
getClassDescription, getOperationDescription, retrieveClasssDescription, retrieveOperationDescription
protected MRpcClient m_rpcClient
protected MClientReply m_reply
protected MException m_exception
protected boolean m_isTimedout
public MClientRequest(MApp app, java.lang.String operationClassName, java.lang.String operationName, java.lang.String clientName) throws MException
MClientRequest
object.
app
- The associated MApp
instance.operationClassName
- Name of the operation class description to be used by this client request.operationName
- Name of the operation on which this client request is performing.clientName
- Name of the client that sends this request. The name must
correspond to an RPC client defined in configuration.MException
- if the class repository object specified by classDescriptionName
cannot be found.MException
- when the operation class cannot be found.public void onewayInvoke() throws MException, MOperationBusyException, MTimeoutException, MInvalidInputException
Note If there is at least one server embedded within this same process matching the TIBCO Rendezvous subject name of the client object (wildcard characters are not supported), the request is delivered to one of these servers. Otherwise, the request is sent out on the wire.
MException
- when errors occur due to problems such as missing class
description or failure to marshall/unmarshall data.MOperationBusyException
- on attempt to have more than one outstanding
request sent through the same instance of MClientRequest
. This
exception is only used for remote exception.MInvalidInputException
- on missing or mismatched required parameters.MRestrictedMethodException
- on attempt to invoke one-way operation.MTimeoutException
public void syncInvoke(int timeout) throws MException, MOperationBusyException, MInvalidInputException
If at least one server is embedded within this same process matching the TIBCO Rendezvous subject name of the client object (wildcard characters are not supported), the request is delivered to one of these servers. Otherwise, the request is sent out on the wire.
timeout
- Timeout in milliseconds. If this timeout passes and no reply has
been received, the message is considered unsuccessful and an error is signaled.MException
- when errors occur due to problems such as missing class
description or failure to marshall/unmarshall data.MOperationBusyException
- on attempt to have more than one outstanding
request sent through the same instance of MClientRequest
. This
exception is only used for remote exception.MInvalidInputException
- on missing or mismatched required parameters.MRestrictedMethodException
- on attempt to invoke one-way operation.public void syncInvoke() throws MException, MOperationBusyException, MInvalidInputException
MException
- when errors occur due to problems such as missing class
description or failure to marshall/unmarshall data.MOperationBusyException
- on attempt to have more than one outstanding
request sent through the same instance of MClientRequest
. This
exception is only used for remote exception.MInvalidInputException
- on missing or mismatched required parameters.syncInvoke(int)
public void asyncInvoke(MOperationReplyListener listener, long timeout) throws MException, MOperationBusyException, MInvalidInputException
A reply is sent back asynchronously to the callback object.
Note If there is at least one server embedded within this same process matching the TIBCO Rendezvous subject name of the client object (wildcard characters are not supported), the request is delivered to one of these servers. Otherwise, the request is sent out on the wire.
listener
- Callback class. The reply is delivered here.timeout
- Amount of time this request waits until it calls the callback. This is in milliseconds.MException
- when errors occur due to problems such as missing class description
or failure to marshall/unmarshall data.MOperationBusyException
- on attempt to have more than one outstanding
request sent through the same instance of MClientRequest
. This exception is
only used for remote exception. MClientReply.hasException()
is still required
to check whether there a remote exception occurred.MInvalidInputException
- on missing or mismatched required parameters.MRestrictedMethodException
- on attempt to invoke one-way operation.public void asyncInvoke(MOperationReplyListener listener) throws MException, MOperationBusyException, MInvalidInputException
Note If there is at least one server embedded within this same process matching the TIBCO Rendezvous subject name of the client object (wildcard characters are not supported), the request is delivered to one of these servers. Otherwise, the request is sent out on the wire.
listener
- Callback class. The reply is delivered here.MOperationBusyException
- on attempt to have more than one outstanding
request sent through the same instance of MClientRequest
. This exception is
only used for remote exception. MClientReply.hasException()
is still required
to check whether there a remote exception occurred.MInvalidInputException
- on missing or mismatched required parameters.MRestrictedMethodException
- on attempt to invoke one-way operation.MException
asyncInvoke(MOperationReplyListener, long)
public MClientReply getReply() throws MException, MTimeoutException
MException
- when errors occur due to problems such as missing
class description or failure to marshall/unmarshall data.MTimeoutException
- if the request timed out before the reply arrived.protected boolean validateParameter(java.lang.String attributeName) throws MException
validateParameter
in class MOperation
MException
public java.util.Enumeration getKeys()
MOperation
Enumeration.nextElement()
can be cast to String
.getKeys
in class MOperation
public java.util.Enumeration get()
MOperation
get
in class MOperation