[Enterprise Extensions only]

IDL operation declarations: "context" expression

For an overview of IDL operation declarations, see IDL operation declarations.

The optional context expression (context-expr) in an operation declaration indicates which elements of the caller's context the operation's implementation can consult. A context expression is specified as follows:

context ( identifier1, identifier2, ... )

where each identifier is a string literal made up of alphanumeric characters, periods, underscores and asterisks. The first character must be alphabetic, and an asterisk can only appear as the last character, where it serves as a wildcard matching any characters. If convenient, identifiers can consist of period-separated valid identifier names, but that form is optional.

The Context is a special object that is specified by the CORBA standard. It contains a property list: a set of property-name/string-value pairs that the caller can use to store information about its environment that operations can find useful. It is used in much the same way as environment variables. It is passed as an additional parameter to operations that are defined as context-sensitive in IDL.

The context expression of an operation declaration in IDL specifies which property names the operation uses. If these properties are present in the Context object supplied by the caller, they will be passed to the object implementation, which can access them through the interface of the Context object.

The argument that is passed to the operation having a context expression is a Context object, not the names of the properties. The caller must create a Context object and use the interface of the Context object to set the context properties. The caller then passes the Context object in the operation invocation. The CORBA standard allows properties in addition to those in the context expression to be passed in the Context object.