Package com.softwareag.entirex.aci
Class RPCService
java.lang.Object
com.softwareag.entirex.aci.BrokerService
com.softwareag.entirex.aci.RPCService
- Direct Known Subclasses:
XMLRPCService
This abstract subclass of BrokerService represents a Broker service used
by EntireX RPC.
The client stub and server stub generated by the Java Wrapper are
subclasses of RPCService.
You should not call the methods of the superclass BrokerService directly.
You should not call the methods of the superclass BrokerService directly.
- Since:
- EntireX 5.2.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
RELIABLE_AUTO_COMMIT = 1static final int
RELIABLE_CLIENT_COMMIT = 2static final int
RELIABLE_OFF = 0Fields inherited from class com.softwareag.entirex.aci.BrokerService
DEFAULT_WAITTIME
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Closes the running RPC conversation.final void
Closes the running RPC conversation.protected final Conversation
Returns the Conversation object.Gets the messageID of the RPC response.Returns the current value of the library name used by the RPC.final String
Gets the message id for reliable RPC.Gets the messageID of the RPC request.final boolean
Returns the current setting for logon to Natural Security for Natural RPC servers.Returns the current value of the RPC subprogram name.final int
Gets the mode for reliable RPC.final String
Gets the RPC password (used with NATURAL logon).final String
Returns the user ID which is used by the RPCs.final String
getStatusOfMessage
(String messageID) Gets the status of the message identified by the message id for reliable RPC.protected void
User exit method called at the beginning of a generated method.protected void
onException
(String progname, BrokerException exception) User exit method called when an exception which is an instance ofBrokerException
is thrown in the generated method.protected void
User exit method called at the end of a generated method.protected boolean
onRetry
(String progname, BrokerException exception) User exit method called when an exception which is an instance ofBrokerException
is thrown in the generated method.ping()
Sends an RPC PING command to the service and returns the response string.final void
Commit a transaction (unit of work) for reliable RPC.final void
Roll back a transaction (unit of work) for reliable RPC.final void
Dynamically assigns the instance of a Broker object.final void
setConversation
(Conversation conversation) Enables conversational RPC.final void
setLibraryName
(String libName) Changes the library name used by the RPC.final void
setNaturalLogon
(boolean logon) Enables or disables logon to Natural Security for Natural RPC servers.final void
setReliable
(int mode) Sets reliable RPC mode.final void
setRPCPassword
(String password1) Changes the password used for an RPC.final void
setRPCUserId
(String userId1) Changes the user ID used for an RPC call.final void
setServerAddress
(String serverAddress) Dynamically assigns the server address.Methods inherited from class com.softwareag.entirex.aci.BrokerService
cancelallConversations, deregister, deregisterImmediate, endallConversations, getBroker, getCharacterEncoding, getCharset, getDefaultWaittime, getMaxReceiveLen, getServerClass, getServerName, getServiceName, isGeneric, receive, receive, receiveAny, receiveAttachInfo, receiveOld, register, registerAttach, replyError, send, sendReceive, sendReceive, setCharacterEncoding, setDefaultWaittime, setMaxReceiveLen, toString
-
Field Details
-
RELIABLE_OFF
public static final int RELIABLE_OFFRELIABLE_OFF = 0- See Also:
-
RELIABLE_AUTO_COMMIT
public static final int RELIABLE_AUTO_COMMITRELIABLE_AUTO_COMMIT = 1- See Also:
-
RELIABLE_CLIENT_COMMIT
public static final int RELIABLE_CLIENT_COMMITRELIABLE_CLIENT_COMMIT = 2- See Also:
-
-
Method Details
-
setRPCUserId
Changes the user ID used for an RPC call. Default is the user ID specified in the Broker constructor. An empty user ID is ignored.- Parameters:
userId1
- The new user ID.- Since:
- 5.2.1.7
-
getRPCUserId
Returns the user ID which is used by the RPCs.- Returns:
- user ID as string.
- Since:
- 5.2.1.7
-
setRPCPassword
Changes the password used for an RPC. Default is the password specified in the Brokerlogon
method. At the moment this is only used by Natural RPC servers running with Natural Security.- Parameters:
password1
- The new Password.- Since:
- 5.2.1.7
-
getRPCPassword
Gets the RPC password (used with NATURAL logon).- Returns:
- the RPC password.
-
setBroker
Dynamically assigns the instance of a Broker object. The method cannot be called during a conversational RPC sequence. Can be used by Java Wrapper Customization classes.- Parameters:
broker
- A Broker instance.- Throws:
BrokerException
- A BrokerException.- Since:
- 5.3.1.2
-
setServerAddress
Dynamically assigns the server address. The method cannot be called during a conversational RPC sequence. Can be used by Java Wrapper Customization classes.- Parameters:
serverAddress
- The server address (class/name/service).- Throws:
BrokerException
- if called in a conversational RPC sequence.- Since:
- 5.3.1.2
-
setLibraryName
Changes the library name used by the RPC.- Parameters:
libName
- The new library name (maximum 8 characters).
-
getLibraryName
Returns the current value of the library name used by the RPC.- Returns:
- The current library name as a string.
-
getProgramName
Returns the current value of the RPC subprogram name.- Returns:
- The current subprogram name as a String.
-
setNaturalLogon
public final void setNaturalLogon(boolean logon) Enables or disables logon to Natural Security for Natural RPC servers.- Parameters:
logon
-true
to enable,false
to disable.
-
getNaturalLogon
public final boolean getNaturalLogon()Returns the current setting for logon to Natural Security for Natural RPC servers.- Returns:
true
if enabled,false
if disabled.
-
setConversation
Enables conversational RPC. All RPCs going through this instance of the RPCService object will use the Conversation object passed as parameter.The same instance of a Conversation object can be passed to different instances of an RPCService object. They will all run in the same conversation.
- Parameters:
conversation
- A non-null Conversation object.- Throws:
IllegalArgumentException
- Thrown if no conversation is specified.IllegalStateException
- if this service is already used for reliable RPC.
-
getConversation
Returns the Conversation object.- Returns:
- Conversation object or null;
-
closeConversation
Closes the running RPC conversation. The RPC server receives a "backout" notification.- Throws:
BrokerException
- A BrokerException.
-
closeConversationCommit
Closes the running RPC conversation. The RPC server receives a "commit" notification.- Throws:
BrokerException
- A BrokerException.
-
reliableCommit
Commit a transaction (unit of work) for reliable RPC.- Throws:
BrokerException
- if the broker call to commit the messages fails.- Since:
- 8.0
-
reliableRollback
Roll back a transaction (unit of work) for reliable RPC.- Throws:
BrokerException
- if the broker call to commit the messages fails.- Since:
- 8.0
-
getMessageID
Gets the message id for reliable RPC. The message id is the UnitofWork id. The message id changes afterreliableCommit()
orreliableRollback()
inRELIABLE_CLIENT_COMMIT
mode and after sending a message inRELIABLE_AUTO_COMMIT
mode.- Returns:
- the message id.
- Since:
- 8.0
-
getStatusOfMessage
Gets the status of the message identified by the message id for reliable RPC. The message id is the UnitofWork id. Due to Broker settings the status may be not available after processing the message.- Parameters:
messageID
- the message id obtained by a previous call ofgetMessageID()
.- Returns:
- the status of the message.
- Throws:
BrokerException
- if the Broker call fails.- Since:
- 8.0
-
onEnter
User exit method called at the beginning of a generated method. This method has a default implementation and can be overwritten in the Java Wrapper Customization class.- Parameters:
progname
- The RPC program name.- Throws:
BrokerException
- A BrokerException.- Since:
- 5.3.1.2
-
onLeave
User exit method called at the end of a generated method. This method is only called when no exception is thrown. This method has a default implementation and can be overwritten in the Java Wrapper Customization class.- Parameters:
progname
- The RPC program name.sendLength
- length of send bufferreceiveLength
- length of receive buffer- Throws:
BrokerException
- A BrokerException.- Since:
- 5.3.1.2
-
onException
User exit method called when an exception which is an instance ofBrokerException
is thrown in the generated method. After calling this method the exception is thrown again. There is no need to throw the exception in the implementation of this method. This method has a default implementation and can be overriden in the Java Wrapper Customization class.- Parameters:
progname
- The RPC program name.exception
- reference to the exception, which is thrown in the generated method.- Throws:
BrokerException
- A BrokerException.- Since:
- 5.3.1.2
-
onRetry
User exit method called when an exception which is an instance ofBrokerException
is thrown in the generated method. This method is only called when the exception is thrown during the processing of the RPC. If this method returnsfalse
, the exception will be thrown again and theonException
method is called. If this method returnstrue
, the RPC will be executed once again. If the second RPC fails,onException
will be called immediately. This method has a default implementation and can be overridden in the Java Wrapper Customization class.- Parameters:
progname
- The RPC program name.exception
- reference to the exception which is thrown in the generated method.- Returns:
- false as a default implementation.
- Throws:
BrokerException
- A BrokerException.- Since:
- 5.3.1.2
-
ping
Sends an RPC PING command to the service and returns the response string.- Returns:
- the response string to the PING command.
- Throws:
BrokerException
- if a Broker error occurs.- Since:
- 7.1.1.24
-
getReliable
public final int getReliable()Gets the mode for reliable RPC. Allowed values areRELIABLE_OFF
,RELIABLE_AUTO_COMMIT
,RELIABLE_CLIENT_COMMIT
.- Returns:
- the mode for reliable RPC
- Since:
- 8.0
-
setReliable
public final void setReliable(int mode) Sets reliable RPC mode. Allowed values areRELIABLE_OFF
,RELIABLE_AUTO_COMMIT
,RELIABLE_CLIENT_COMMIT
.- Parameters:
mode
- the reliable RPC mode to set- Throws:
IllegalStateException
- if this service is already used for reliable RPC.- Since:
- 8.0
-
getMessageIDOfRequest
Gets the messageID of the RPC request.- Returns:
- the messageID of the RPC request.
- Since:
- 10.5
-
getCorrelationIDOfReply
Gets the messageID of the RPC response.- Returns:
- the messageID of the RPC response.
- Since:
- 10.5
-