Context implements the OMG pseudo interface Context. A context is intended to represent information about the client which is inconvenient to pass via parameters.An IDL operation can specify that it is to be provided with the client's mapping for particular identifiers (properties)it does this by listing these identifiers following the operation declaration in a
context clause. An IDL operation that specifies a context clause is mapped to a Java method which takes an extra input parameter of type IE.Iona.Orbix.CORBA.Context, at the end of the parameter list. A client can optionally maintain one or more Context objects, which provide a mapping from identifiers (string names) to string values. A Context object contains a list of properties; each property consists of a name and a string value associated with that name and can be passed to a method that takes a Context parameter.
Contexts can be arranged in a hierarchy by specifying parent-child relationships among them. Then, a child passed to an operation also includes the identifiers of its parent(s). The called operation can decide whether to use just the context actually passed, or the hierarchy above it.
// Pseudo IDL
pseudo interface Context {
readonly attribute Identifier context_name;
readonly attribute Context parent;
Status create_child(
in Identifier child_ctx-_name, out Context child_ctx);
Status set_one value(
in Identifier propname, in any propvalue);
Status set_values(in NVList values);
Status delete_values(in Identifier propname);
Status get_values(in Identifier start_scope,
in Flags op_flags,
in Identifier pattern,
out NVList values);
};
// Java
package IE.Iona.Orbix2.CORBA;
public class Context {
// Constructors
public Context();
public Context(String name);
public Context(Context parent);
public Context(String name, Context parent);
// Methods
public int create_child(String ctx_name,
IE.Iona.Orbix2.CORBA.ContextHolder hctx);
public int delete_values(String prop_name)
throws SystemException;
public int get_values(String start_scope,
Flags op_flags, String prop_name,
IE.Iona.Orbix2.CORBA.NVListHolder hvalues);
public int set_one_value(String prop_name,
IE.Iona.Orbix2.CORBA.Any value);
public int set_values(NVList values);
public String toString();
public java.lang.Object clone();
public boolean equals(java.lang.Object _obj);
// Object Methods
public static Context IT_create();
public static Context IT_create(String name);
public static Context IT_create(Context parent);
public static Context IT_create(String name,
Context parent);
public static Context _nil();
// Data Accessor Methods
public String context_name();
public Context parent();
public int get_count();
public int get_count_all();
}
CORBA.ContextIteratorCORBA.NVListCORBA.Flags
public Context();
CORBA.Context.create_child()
CORBA.Context.IT_create()
Other Context constructors.
public Context(String name);
|
The name of the context.
|
CORBA.Context.create_child()
CORBA.Context.IT_create()
Other Context constructors.
public Context(Context parent);
|
The parent context.
|
CORBA.Context.create_child()
CORBA.Context.IT_create()
Other Context constructors.
public Context(String name, Context parent);
|
The name of the context.
|
|
The parent context.
|
CORBA.Context.create_child()
CORBA.Context.IT_create()
Other Context constructors.
public static Context _nil();
Context object.
public String context_name();
Context object.
CORBA.Context.create_child()
public int create_child(String ctx_name,
IE.Iona.Orbix2.CORBA.ContextHolder hctx);
CORBA.Context.get_values()) will look in parent contexts if necessary to find matching property names.
1 if successful; returns 0 otherwise.
CORBA.Context.get_values()
public int delete_values(String prop_name)
throws SystemException;
Context object on which the invocation is made.
|
The property name to be deleted. If prop_name has a trailing `*', then all matching properties will be deleted.
|
1 (true) if successful; returns 0 (false) otherwise. An exception is raised if no matching property is found.
public int get_count();
CORBA.Context.get_count_all()
public int get_count_all();
CORBA.Context.get_count()
public int get_values(String start_scope,
Flags op_flags, String prop_name,
IE.Iona.Orbix2.CORBA.NVListHolder hvalues);
1 if matching properties are found; returns 0 otherwise.
public static Context IT_create(); public static Context IT_create(String name); public static Context IT_create(Context parent); public static Context IT_create(String name, Context parent);
Context pseudo object, OrbixWeb provides the IT_create() method to initialise an object reference for a Context.Use of this method is recommended in preference to Java
new to ensure portablility across future OrbixWeb versions.
CORBA.Context.create_child()
Context constructors.
public Context parent();
Context object.
CORBA.Context.create_child()
public int set_one_value(String prop_name,
IE.Iona.Orbix2.CORBA.Any value);
value member is of type Any, the type of the Any must be a string.
|
The name of the property to add.
|
|
The value of the property to add.
|
1 if successful; returns 0 otherwise.
CORBA.Context.set_values()
public int set_values(NVList values);
1 if successful; returns 0 otherwise.
CORBA.Context.set_one_value()