Previous | Table of Contents | Next |
When the callback model is used, the client supplies a reply handler when making the asynchronous invocation. The interface’s
operations and attributes are mapped to implied-IDL operations with names prefixed by “sendc_?. If this implied-IDL operation
name conflicts with existing operations on the interface or any of the interface’s base interfaces, “ami_? strings are inserted
between “sendc_? and the original operation name until the implied-IDL operation name is unique.
22.6.1.1 Implied-IDL for Operations
The signature of the implied-IDL for a given IDL operation is:
• void return type, followed by;
• An object reference to a type-specific ReplyHandler as described in Section 22.8, “Type-Specific ReplyHandler Mapping,? on page 22-21, with the parameter name ami_handler. If a nil ReplyHandler reference is specified when this operation is invoked, no response will be returned for this invocation. A system exception may be raised by the ORB during evaluation of the request, but once sendc returns, no further results of the operation will be made available. This is equivalent to setting the CORBA::INV_NO_RESPONSE flag when making a DII deferred request.
• Each of the in and inout arguments in the order that they appeared in the operation's declaration in IDL, all with a parameter attribute of in and with the type specifier and parameter name of the original argument.
• sendc_<opName> where opName is the name of the operation.
The async callback version takes the following arguments in order:
• out arguments are ignored (i.e., are not part of the async signature).
The implied-IDL operation signature has a context expression identical to the one from the original operation (if any is present).
22.6.1.2 Implied-IDL for Attributes
The signature of the implied-IDL for the callback model getter and setter operations corresponding to an interface’s attribute
is as follows.
• Setter operations are only generated for attributes that are not defined readonly
• void return type, followed by the operation name, which to distinguish between the getter and setter operations for the attribute is given by either:
• sendc_get_<attributeName> for reading the attribute value, where attributeName is the name of the attribute, or • sendc_set_<attributeName> for setting the attribute value, where attributeName is the name of the attribute that is not defined readonly.
The callback implied-IDL operations take the following arguments in order:
• An object reference of a type-specific ReplyHandler as described in Section 22.8, “Type-Specific ReplyHandler Mapping,? on page 22-21, with the parameter name ami_handler.
• The additional arguments for asynchronous implied-IDL operations for attributes are as follows:
• For the attribute’s generated get operation, there are no additional arguments. • For the attribute’s generated set operation, there is one additional argument, in <attrType> attr_<attributeName>, where attrType is the type of the attribute, and attributeName is the name of that attribute. The set operation is only generated for attributes that are not defined readonly.
22.6.1.3 Example
The following implied-IDL is generated from the interface definitions used in the running example:
// AMI implied-IDL including callback operations// for original example IDL defined in
Section 22.5
exception InvalidStock { string sym; };
interface AMI_StockManagerHandler;
interface StockManager {
// Original operation Declarationsattribute string stock_exchange_name;boolean add_stock(in string symbol, in double quote);void edit_stock(in string symbol, in double new_quote)
raises(InvalidStock); void remove_stock(in string symbol, out double quote)
raises(InvalidStock); boolean find_closest_symbol(inout string symbol); double get_quote(in string symbol) raises(InvalidStock);
// Async Callback operation Declarations void sendc_get_stock_exchange_name( in AMI_StockManagerHandler ami_handler);
void sendc_set_stock_exchange_name( in AMI_StockManagerHandler ami_handler, in string attr_stock_exchange_name);
void sendc_add_stock( in AMI_StockManagerHandler ami_handler, in string symbol, in double quote);
void sendc_edit_stock( in AMI_StockManagerHandler ami_handler, in string symbol, in double new_quote);
void sendc_remove_stock( in AMI_StockManagerHandler ami_handler, in string symbol);
void sendc_find_closest_symbol( in AMI_StockManagerHandler ami_handler, in string symbol);
void sendc_get_quote( in AMI_StockManagerHandler ami_handler, in string symbol);
};