classTheActivationImplDef
: publicImplementationDef
ActivationImplDef
class is used by object implementations that defer the instantiation of an object until the first client request arrives. This class embeds an interface and object name for a particular ORB object as well an object of class Activator
. When an object of this class is passed to the BOA::obj_is_ready
method, the activate
and deactivate
methods used by the BOA
are overridden by the Activator
object's methods. To use ActivationImplDef
, you must provide an Activator
class along with the implementation for its methods.
See also the BOA class and the
ImplementationDef
class.
Include File
The corba.h file should be included when you use this class.
IDL Definition
interface ActivationImplDef: ImplementationDef
{
Attribute Activator activator_obj;
}; Methods
ActivationImplDef
(const char *interface_name
,
const char *object_name
,
const ReferenceData& id
,
Activator_ptr act
)
ActivationImplDef
for a particular C++ class that will implement an ORB object.
Destructor for this object.
~ActivationImplDef
()Activator_ptr
This method returns a pointer to the activator_obj
();Activator
object associated with this object.
void Activator_ptr
This method sets the activator_obj
(Activator_ptr val
);Activator
object to be used by this object.
Parameter | Description |
val | A pointer to an Activator object to be used by this object. |
static ActivationImplDef_ptr
Duplicates the _duplicate
(ActivationImplDef_ptr obj
);ActivationImplDef
object pointed to by the parameter.
Parameter | Description |
obj | Pointer to the object to be duplicated. |
static ActivationImplDef_ptr
This method attempts to narrow the _narrow
(ImplementationDef_ptr ptr
);ImplementationDef_ptr
that is passed in to an ActivationImplDef_ptr
. If the supplied pointer does not point to an object of ActivationImplDef
, a NULL value is returned. Otherwise, an ActivationImplDef
pointer is returned.
Parameter | Description |
ptr |
A pointer to ImplementationDef object.
|
static ActivationImplDef_ptr
This method returns a NULL pointer cast to an ActivationImplDef_ptr.
_nil
(); Any
class
This class is used to represent any IDL type so that any value can be passed in a type-safe manner. Objects of this class have a pointer to a Any
TypeCode
that defines the object's type and a pointer to the value associated with the object. Methods are provide to construct, copy, and destroy an object as well as initialize and query the object's type and value. In addition, streaming operators are provided to read and write the object to a stream.
Include File
Include any.h
when you use this structure.
BOA
class
The BOA
BOA
class represents the Basic Object Adaptor and provides methods for creating and manipulating objects and object references. Object servers use the BOA to activate and deactivate object implementations.
Include File
Include corba.h
when you use this class.
Methods
static BOA_ptr
ORB::BOA_init
(int& argc
,
char *const *argv
,
const char *boa_identifier
= "PMC_BOA")
BOA
and specifies optional networking parameters. The argc
and argv
parameters are usually the same parameters passed to the object implementation process when it is started.
void
This method changes the implementation definition associated with the specified object. You should use this method with caution. The implementation name should not be changed and you must ensure that the new implementation definition specifies the same type of object as the original definition. If the change_implementation
(Object_ptr obj
, ImplementationDef_ptr impl
)ImplementationDef_ptr
does not point to a CreationImplDef
pointer, this method will fail.
Object_ptr
This method creates an ORB object and returns a reference to the newly created object. Once the object reference is created, the client application can invoke methods on object reference. create
(const ReferenceData& ref_id
,
InterfaceDef_ptr intf_def
,
ImplementationDef_ptr impl_def
)
Parameter | Description |
ref_id | This parameter is not used, but is provided for compliance with the CORBA specification. |
intf_def | This parameter is not used, but is provided for compliance with the CORBA specification. |
impl_def |
This pointer's true type is CreationImplDef and provides the interface name, object name, path name of the executable and activation policy, along with other parameters.
|
void
This method deactivates the implementation specified by the ImplementationDef_ptr. After this method is called, no client requests will be delivered to the object within this implementation until the objects and implementation are activated using the deactivate_impl
(ImplementationDef_ptr impl_def
)obj_is_ready
and impl_is_ready
methods.
void
This method notifies the deactivate_obj
(Object_ptr obj
)BOA
that the specified object is to be deactivated. After this method is invoked, the BOA
will not deliver any requests to the object until obj_is_ready
or impl_is_ready
is invoked.
Parameter | Description |
obj | A pointer to the object to be deactivated. |
void
This method unregisters the implementation of the specified object from the Object Activation Daemon. After this method is invoked, all references to this object will be invalid and any connections to this object implementation will be broken. If the object is allocated, the application must delete the object. dispose
(Object_ptr obj
)
Parameter | Description |
obj | Pointer to the object to be unregistered. |
static BOA_ptr
This static method duplicates the _duplicate
(BOA_ptr ptr
)BOA
pointer that is passed in as a parameter.
Parameter | Description |
ptr |
A BOA pointer.
|
ReferenceData
This method returns the reference data for the specified object. The reference data is set by the object implementation at activation time and is guaranteed to remain constant throughout the life of the object. Reference data is often used to distinguish between object implementations that have the same name. get_id
(Object_ptr obj
)
Parameter | Description |
obj | A pointer to the object whose reference data is to be returned. |
Principal_ptr
This method returns the Principal object associated with the specified object. get_principal
(Object_ptr obj
, Environment_ptr env
)
Parameter | Description |
obj | A pointer to the object whose implementation is to be changed. |
env | A pointer to the Environment object associated with this Principal. |
void
This method notifies the BOA that one or more objects in the server are ready to receive service requests.If all objects that the implementation is offering have been created through C++ instantiation and activated using the impl_is_ready
(ImplementationDef_ptr impl_def
=NULL)obj_is_ready
method, the ImplementationDef_ptr
should not be specified.
An object implementation may offer only one object and may want to defer the activation of that object until a client request is received. In these cases, the object implementation does not need to first invoke the obj_is_ready
method. Instead, it may simply invoke this method, passing the ActivationImplDef pointer for its single object.
Parameter | Description |
impl_def |
This pointer's true type is ActivationImplDef(const char *interface_name, const char *object_name, const ReferenceData& id, Activator_ptr act) and provides the interface name, object name, path name of the executable and activation policy, along with other parameters.
|
void
This method notifies the BOA that the specified object is ready for use by clients. obj_is_ready
(CORBA::Object_ptr obj
,
ImplementationDef_ptr impl_ptr
= NULL)
There are two different ways to use this method:
NULL
Object_ptr
and provide an pointer to an ActivationImplDef
object that has been initialized. For more information, see ActivationImplDef(const char *interface_name, const char *object_name, const ReferenceData& id, Activator_ptr act).
Parameter
Description
obj
A pointer to the object to be activated.
impl_ptr
A optional pointer to an ActivationImplDef object.
static BOA_ptr
_nil
()
NULL
BOA
pointer that can be used for initialization purposes.
static voidThis static method releases the specified BOA pointer. Once the object's reference count reaches zero, the object is automatically deleted.CORBA::release
(BOA_ptrboa
)
Parameter | Description |
boa |
A valid BOA pointer.
|
static RegistrationScope
This static method returns the registration scope of the BOA. The registration scope of an object can be local or global. Only objects with a global scope are registered with the osagent.
scope
()static void
This static method changes the registration scope of the scope
(RegistrationScope val
)BOA
to the specified value.
Parameter | Description |
val |
The new registration scope for the BOA , either SCOPE_LOCAL or SCOPE_GLOBAL .
|
ClientEventHandler
class
The ClientEventHandler
ClientEventHandler
class defines the interface for registering an event handler for client applications. Event handlers provide a set of methods that are invoked by the ORB when one of the following events occurs.
ClientEventHandler
and provide the implementation just for the event handling methods in which you are interested. Your implementation will be invoked by the ORB when a particular event occurs and can be used to implement logging or security features that you design. If you are not interested in handling a particular event, do not declare its method in your derived class.
After creating an event handler, your client application must register it using the
HandlerRegistry
class. You can register an event handler for a particular object or a global event handler for all objects.If both global and object-specific event handlers are registered and an event occurs on the object with its own event handler, the object-specific handler will take precedence over the global handler. See ImplEventHandler in this guide for information on creating event handlers for servers.
Include File
Include the corba.h
and pmcext.h
files when you use this class.
Methods
Parameter | Description |
CORBA::Object_ptr | A reference to the object that could not be bound. |
virtual void
You can choose to implement this method, which will be invoked by the ORB when a bind succeeds. If the event handler was registered for a particular object, it will only be invoked when a bind succeeds for that object. If the event handler is registered with a global scope, it will be called when any bind issued by the client succeeds. bind_succeeded
(CORBA::Object_ptr
, const ConnectionInfo&
)
virtual void
You can choose to implement this method, which will be invoked by the ORB when a rebind fails. If the event handler was registered for a particular object, it will only be invoked when a rebind fails for that object. If the event handler is registered with a global scope, it will be called when any rebind issued on behalf of the client fails. The rebind option must be enabled. rebind_failed
(CORBA::Object_ptr
)
Parameter | Description |
CORBA::Object_ptr | A reference to the object that could not be rebound. |
virtual void
You can choose to implement this method, which will be invoked by the ORB when a rebind succeeds. If the event handler was registered for a particular object, it will only be invoked when a rebind succeeds for that object. If the event handler is registered with a global scope, it will be called when any bind issued by the client succeeds. The rebind option must be enabled. rebind_succeeded
(CORBA::Object_ptr
, const ConnectionInfo
&)
virtual void
You can choose to implement this method, which will be invoked by the ORB whenever a connection to a server is lost. If the event handler was registered for a particular object, it will only be invoked when the connection is lost for that object. If the event handler is registered with a global scope, it will be called when any of the client's connections are lost. sever_aborted
(CORBA::Object_ptr
)
Parameter | Description |
CORBA::Object_ptr | A reference to the object whose connection was lost. |
Contained
class
The Contained
: public IRObject
Contained
class is used to derive all Interface Repository (IR) objects that are themselves contained within another IR object. This class provides methods for:
Container
that contains this object.
corba.h
when you use this class.
interface Contained: IRObject {
attribute RepositoryId id;
attribute Identifier name;
attribute VersionSpec version;
readonly attribute Container defined_in;
readonly attribute ScopedName absolute_name;
readonly attribute Repository containing_Repository;
struct Description {
DefinitionKind kind;
any value;
};
Description describe();
void move(
in Container new_Container,
in Identifier new_name,
in VersionSpec new_version
);
};
Repository
. If the object's defined_in attribute, set when the object is created, references a Repository
, then the absolute name is simply the object's name preceded by the string "::".
CORBA::Repository_ptr containing_repository
()
This method returns the Repository
that is eventually reached by recursively following the defined_in
attribute.
CORBA::Container_ptr defined_in
()
This method returns the Container
object in which this object resides.
CORBA::Contained::Description *describe
()
This method returns a structure that describes the interface, such as the type returned and its associated value.
voidThis method removes this object from its current container and adds it to the specified container. The newmove
(CORBA_Container_ptrnew_CORBA_container
,
const char *new_name
,
const CORBA_VersionSpec&version
)
Container
must be in the same repository as the original and capable of containing the object's type. Further, the new Container
must not already contain an object with the same name.The object's defined_in
and absolute_name
attributes are updated to reflect the new container. If this object is itself a Container
, all of it's contained object's are also updated.
Parameter | Description |
new_CORBA_container | The Container where the object is to be moved. |
new_name | The object's name. |
version | The container's version. |
char
This method returns the name of the object. The name uniquely identifies it within the scope of its container.
*name
()void
This method sets the name of the contained object. name
(const char * val
)
Parameter | Description |
name | The object's name. |
CORBA::VersionSpec
This method returns the object's version. The version distinguishes this object from other objects that have the same name.
version
()void
This method sets this object's version. version
(CORBA::VersionSpec& val
)
Parameter | Description |
val | The object's id. |
Container
class
The Container
: public IRObject
Container
class is used to create a containment hierarchy in the Interface Repository. A Container
object holds object definitions derived from the Contained
class. All object definitions derived from the Container
class, with the exception of the Repository
class, also inherit from the Contained
class.
The Container
provides methods to create all types of IDL types defined in orbtypes.h
, including InterfaceDef
, ModuleDef
and ConstantDef
classes. Each definition that is created will have its defined_in
attribute initialized to point to this object.
Include File
The corba.h file should be included when you use this class.
IDL Definition
interface Container: IRObject {
ContainedSeq contents(
in DefinitionKind limit_type,
in boolean exclude_inherited
);
Contained lookup(in ScopedName search_name);
ContainedSeq lookup_name(
in Identifier search_name,
in long levels_to_search,
in CORBA::DefinitionKind limit_type,
in boolean exclude_inherited
);
struct Description {
Contained Contained_object;
DefinitionKind kind;
any value;
};
typedef sequence<Description> DescriptionSeq;
DescriptionSeq describe_contents(
in DefinitionKind limit_type,
in boolean exclude_inherited,
in long max_returned_objs
); Methods
Repository
. All object definitions contained by modules in the Repository
are returned, followed by all object definitions contained within each of those modules.
AliasDef_ptr
This method creates an create_alias
(const char* id
,
const char* name
,
const CORBA_VersionSpec& version
,
IDLType_ptr original_type
)AliasDef
object in this Container
with the specified attributes and returns a pointer to the newly created object.
Parameter | Description |
id | The alias id. |
name | The alias name. |
version | The alias version. |
original_type | The type of the object for which this object is an alias. |
ConstantDef_ptr
This method creates a create_constant
(const char * id
,
const char * name
,
const CORBA_VersionSpec& version
,
IDLType_ptr type
,
const Any& value
)ConstantDef
object in this Container
with the specified attributes and returns a pointer to the newly created object.
Parameter | Description |
id | The constant's id. |
name | The constant's name. |
version | The constant's version. |
type | The type of the value specified below. |
value | The constant's value. |
EnumDef_ptr
This method creates an create_enum
(const char * id
,
const char * name
,
const CORBA_VersionSpec& version
,
const EnumMemberSeq& members
)EnumDef
object in this Container
with the specified attributes and returns a pointer to the newly created object.
Parameter | Description |
id | The enumeration's id. |
name | The enumeration's name. |
version | The enumeration's version. |
members | A list of the enumeration's fields. |
ExceptionDef_ptr
This method creates an create_exception
(const char * id
,
const char * name
,
const CORBA_VersionSpec& version
,
const EnumMemberSeq& members
)ExceptionDef
object in this Container
with the specified attributes and returns a pointer to the newly created object.
Parameter | Description |
id | The exception's id. |
name | The exception's name. |
version | The exception's version. |
members | A list of the types of the members of the exception, if any. |
InterfaceDef_ptr
This method creates a create_interface
(const char * id
,
const char * name
,
const CORBA_VersionSpec& version
,
const InterfaceDefSeq& base_interfaces
)InterfaceDef
object in this Container
with the specified attributes and returns a pointer to the newly created object.
Parameter | Description |
id | The interface's id. |
name | The interface's name. |
version | The interface's version. |
base_interfaces | A list of all interfaces that this interface inherits from. |
ModuleDef_ptr
This method creates a create_module
(const char * id
,
const char * name
,
const CORBA_VersionSpec& version
)ModuleDef
object in this Container
with the specified attributes and returns a pointer to the newly created object.
Parameter | Description |
id | The module's id. |
name | The module's name. |
version | The module's version. |
StructDef_ptr
This method creates a create_struct
(const char * id
,
const char * name
,
const CORBA_VersionSpec& version
,
const StructMemberSeq& members
)StructureDef
object in this Container
with the specified attributes and returns a pointer to the newly created object.
Parameter | Description |
id | The structure's id. |
name | The structure's name. |
version | The structure's version. |
members | The values for the structure's fields. |
UnionDef_ptr
This method creates a create_union
(const char * id
,
const char * name
,
const CORBA_VersionSpec& version
,
IDLType_ptr discriminator_type
,
const UnionMemberSeq& members
)UnionDef
object in this Container
with the specified attributes and returns a pointer to the newly created object.
DescriptionSeq *
This method returns a description for all definitions directly contained by or inherited into this container. describe_contents
(DefinitionKind limit_type
,
Boolean exclude_inherited
,
Long max_returned_objs
)
Contained_ptr
This method locates a definition relative to this container, given a scoped name. An absolute scoped name, one beginning with "::", may be specified to locate a definition within the enclosing repository. If no object is found, a lookup
(const char * search_name
)NULL
value is returned.
Parameter | Description |
search_name | The object's interface name. |
ContainedSeq *
This method locates an object by name within a particular object. The search can be constrained by the number of levels in the hierarchy to be searched, the type object, and whether inherited objects should be returned. lookup_name
(const char *search_name
,
Long levels_to_search
,
DefinitionKind limit_type
,
Boolean exclude_inherited
)
Context
class
The Context
Context
class represents information about a client application's environment that is passed to a server as an implicit parameter during static or dynamic method invocations. It can be used to communicate special information that needs to be associated with a request, but is not part of the formal method signature, that is, argument list.
The Context
class consists of a list of properties, stored as name/value pairs, and provides methods for setting and manipulating those properties. A Context contains an NVList and chains the name/value pairs together.
A Context_var
class is also available that provides simpler memory management semantics.
Include File
Include corba.h
when you use this class.
Methods
NULL
value is returned.
StatusThis method creates a childcreate_child
(const char *name
, Context_ptr&ctx
)
Context
for this object.
Parameter | Description |
name |
The name of the new Context object.
|
ctx |
A reference to the newly created child Context .
|
Status
This method deletes one or more properties from this object. The name may contain a trailing "*" wildcard character to delete all matching properties. A single asterisk can be specified to delete all properties. delete_value
(const char *name
)
Parameter | Description |
name | The name of the property, or properties, to be deleted. |
static Context_ptr
This method duplicates the specified object. _duplicate
(CORBA::Context_ptr ctx
)
Parameter | Description |
ctx | The object to be duplicated. |
CORBA::Status
This method returns the default per-process get_default_context
(CORBA::Context_ptr& ctx
)Context
maintained by ISB for C++. The default Context is often used in constructing DII requests. See Request for more information.
Parameter | Description |
ctx | The context. |
Status
This method searches the Context object hierarchy and retrieves one or more of the name/value pairs specified by the get_values
(const char *start_scope
,
Flags flags
,
const char *name
,
NVList_ptr& nvl
) constname
parameter. It then creates an NVList
object, places the name/value pairs in the NVList
and returns a reference to that object.
The start_scope parameter specifies the name of the context where the search is to begin. If the property is not found, the search continues up Context
object hierarchy until a match is found or until there are no more Context
objects to search.
static Boolean
This method checks the specified pointer and returns true if the pointer is CORBA::is_nil
(CORBA::Context_ptr ctx
)NULL
.
Parameter | Description |
ctx |
The object to be checked for a NULL value.
|
static Context_ptr
This method returns a _nil
()NULL
Context_ptr
suitable for initialization purposes.
Context_ptr
This method returns a pointer to the parent parent
()Context
. If there is no parent Context
, a NULL
value is returned.
static void
This static method releases the specified _release
(CORBA::Context_ptr ctx
)Context
object. Once the object's reference count reaches zero, the object is automatically deleted.
Parameter | Description |
ctx | The object to be released. |
static void
This method releases the specified object. CORBA::release
(CORBA::Context_ptr ctx
)
Parameter | Description |
ctx | The object to be released. |
Status
This method adds a property to this object, using the specified name and value. set_one_value
(const char *name
, const Any& val
)
Parameter | Description |
name | The property's name. |
val | The property's value. |
Status
This method adds one or more properties to this object, using the name/value pairs specified in the set_values
(NVList_ptr nvl
)NVList
. When you create the
NVList
object to be used as an input parameter to this method, the Flags
field must be set to zero and each Any
object added to the NVList
must set its TypeCode
to TC_string
.
Parameter | Description |
nvl | A list of name/value pairs to be added to this object. |
CreationImplDef
class
The CreationImplDef
: public ImplementationDef
CreationImplDef
class holds the all the information required to create an ORB object. This information is stored in the implementation repository when the object is registered with the regobj command or created using the BOA::create
method. This class can also be used with the BOA::change_implementation
method to alter an implementation definition that is already registered with the OAD. For more information, see "oad"
CreationImplDef
adds these data members to those of ImplementationDef class.
Include File
Include corba.h
when using this class.
IDL Definition
interface CreationImplDef: ImplementationDef
{
attribute string path_name;
attribute Policy activation_policy;
attribute StringSequence args;
attribute StringSequence env;
}; Methods
voidThis method sets this object's activation policy.activation_policy
(Policyp
)
Parameter | Description |
p | The activation policy to be set. |
StringSequence *
This method returns a list of the arguments that will be passed to the server when it is started.
args
() constvoid
This method sets the list of the arguments that will be passed to the server when it is started. args
(const StringSequence& val
)
Parameter | Description |
val | The list of arguments to be passed. |
This method creates a CreationImplDef
(const char * interface_name
,
const char
* object_name
,
const ReferenceData& id
,
const char * path_name
,
const StringSequence& args
,
const StringSequence& env
)CreationImplDef
object.
static void CreationImplDef_ptr
This method duplicates the specified object. _duplicate
(CreationImplDef_ptr obj
)
Parameter | Description |
obj | The object to be duplicated. |
StringSequence *
This method returns a list of the environment variables that will be set when the server is started.
env
() constvoid
This method sets the list of environment variables that will be passed to the server when it is started. env
(const StringSequence& val
)
Parameter | Description |
val | The list of environment variables to be set. |
static CreationImplDef_ptr
This method attempts to narrow the specified pointer to a _narrow
(ImplementationDef_ptr ptr
)CreationImplDef_ptr
. If the method succeeds, a valid CreationImplDef_ptr
is returned. Otherwise, a NULL
pointer is returned.
Parameter | Description |
ptr |
The pointer to be narrowed to type CreationImplDef_ptr .
|
static CreationImplDef_ptr
This method returns a _nil
()NULL
CreationImplDef_ptr
suitable for initialization purposes.
const char *
This method returns this object's path name.
path_name
() constvoid
This method set this object's path name. path_name
(const char *val
)
Parameter | Description |
val | The path name to be set. |
static void _
This method releases the specified object. Once the object's reference count reaches zero, the object will be deleted. release
(CreationImplDef_ptr obj
)
Parameter | Description |
obj | The object to be released. |
Environment
class
The Environment
Environment
class is used for reporting and accessing both system and user exceptions on platforms where C++ language exceptions are not supported. When an interface specifies that user exceptions may be raised by the object's methods, the Environment
class becomes an explicit parameter of that method. If an interface does not raise any exceptions, the Environment
class is an implicit parameter and is only used for reporting system exceptions. If an Environment
object is not passed from the client to a stub, the default, per-object Environment
is used.
Multithreaded applications have a global Environment
object for each thread that is created. Applications that are not multithreaded have just one global Environment
object.
Include File
Include corba.h
when you use this class.
Methods
Environment
to delete any Exception
object that it holds. If this object holds no exception, this method has no effect.
StatusThis method can be used to create a newORB::create_environment
(Environment_ptr&ptr
)
Environment
object.
NOTE: This method is provided for CORBA compliance. You may find it easier to use the constructor provided for this class or the C++new
operator.
Parameter Description ptr The pointer will be set to point to the newly created object.
static Environment& CORBA::current_environment
()
This static method returns a reference to the global Environment
object for the application process. In multithreaded applications, it returns the global Environment
object for this thread.
Environment
()
This method creates an Environment
object. This is equivalent to calling the ORB::create_environment
method.
~Environment
()
This method deletes this Environment
object. This is equivalent to calling the CORBA::release
method, passing a pointer to the object to be deleted.
voidThis method records theexception
(Exception *exp
)
Exception
object passed as an argument. The Exception
object must be dynamically allocated because this object will assume ownership of the Exception
object and will delete it when the Environment
itself is deleted. Passing a NULL pointer to this method is equivalent to invoking the clear
method on the Environment
.
Parameter | Description |
exp |
A pointer to a dynamically allocated Exception object to be recorded for this Environment .
|
Exception *
This method returns a pointer to the exception
() constException
currently recorded in this Environment
. Do not invoke delete
on the Exception
pointer returned by this call. If no Exception
has been recorded, a NULL
pointer will be returned.
static void
This method deletes the specified object, along with any CORBA::release
(Environment_ptr env
)Exception
object it holds.
Parameter | Description |
env | The object to be released. |
Exception
class
The Exception
Exception
class is the base class of the SystemException and user exception classes. For more information, see SystemException in this guide.
Include File
Include corba.h
when using this class.
HandlerRegistry
class
The HandlerRegistry
HandlerRegistry
class provides methods for registering both client and implementation-side event handlers with the ORB and the BOA. ISB for C++ provides two event handler classes, ClientEventHandler and ImplEventHandler, that define methods to be called by the ORB or BOA when certain events occur, such as a successful bind.
Event handlers can be registered with either a per-object scope or a global scope. If both a global event handler and an object event handler are registered, the per-object event handler will take precedence over the global handler for a particular object.
Event handlers are usually registered before any objects are bound or activated. If changes are made to a global event handler after an object is bound, the changes will not apply to event handling for that object.
To use the HandlerRegistry
, you first obtain a reference using the static method instance
.
Include File
Include the files pcmext.h
and corba.h
when using this class.
Methods
HandlerRegistry
.
voidThis method registers a global client-side event handler. The event handler will apply to any object used by the client. If a global event handler has already been registered, areg_global_client_handler
(PMC_EXT::ClientEventHandler_ptrhandler
)
HandlerExists
exception will be raised.
Parameter | Description |
handler |
A pointer to the ClientEventHandler to be registered.
|
void
This method registers a global implementation-side event handler. The event handler will apply to any object used by the implementation. If a global event handler has already been registered, a reg_global_impl_handler
(PMC_EXT::ImplEventHandler_ptr handler
)HandlerExists
exception will be raised.
Parameter | Description |
handler |
A pointer to the ImplEventHandler to be registered.
|
void
This method registers a client-side event handler for a particular object. The event handler will apply to any object used by the client. If an event handler has already been registered for this object, a reg_obj_client_handler
(CORBA::OBject_ptr obj,
PMC_EXT::ClientEventHandler_ptr handler
)HandlerExists
exception will be raised. An InvalidObject
exception will be raised if the object pointer is not valid.
Parameter | Description |
obj | A pointer to the object for which this handler is being registered. |
handler |
A pointer to the ClientEventHandler to be registered.
|
void
This method registers a implementation-side event handler for a particular object. The event handler will apply to any object used by this implementation. If an event handler has already been registered for this object, a reg_obj_impl_handler
(CORBA::OBject_ptr obj,
PMC_EXT::ImplEventHandler_ptr handler
)HandlerExists
exception will be raised. An InvalidObject
exception will be raised if the object pointer is not valid.
Parameter | Description |
obj | The object for which this event handler is to be registered. |
handler |
A pointer to the ImplEventHandler to be registered.
|
void
This method unregisters a global event handler for a client. If there is no global event handler currently registered, a unreg_glob_client_handler
()NoHandler
exception will be raised.
void
This method unregisters a global event handler for an object implementation. If there is no global event handler currently registered, a unreg_glob_impl_handler
()NoHandler
exception will be raised.
void
This method unregisters an client event handler for a particular object. If no event handler is currently registered for the specified object, a unreg_obj_client_handler
(CORBA::Object_ptr obj
)NoHandler
exception will be raised. An InvalidObject
exception will be raised if the object pointer is not valid.
Parameter | Description |
obj | The object whose event handler is to be removed. |
void
This method unregisters an implementation event handler for a particular object. If no event handler is currently registered for the specified object, a unreg_obj_impl_handler
(CORBA::Object_ptr obj
)NoHandler
exception will be raised. An InvalidObject
exception will be raised if the object pointer is not valid.
Parameter | Description |
obj | The object whose event handler is to be removed. |
IDLType
class
The IDLType
: public IRObject
IDLType
class provides an abstract interface that is inherited by all interface repository definitions that represent IDL types. This class provides a method for returning an object's Typecode
, which identifies the object's type. The IDLType
is unique; the Typecode
is not.
Include File
Include corba.h
when using this class.
IDL Definition
interface IDLType:IRObject {
readonly attribute TypeCode type;
}; Methods
class ImplementationDef
The ImplementationDef
is a class that contains most of the information needed to create or activate an object implementation.The
ActivationImplDef
class and the
CreationImplDef
class are both derived from this class.
Include File
Include corba.h
when using this class.
IDL Definition
module CORBA {
typedef sequence<string> StringSequence;
typedef sequence<octet> OctetSequence;
typedef OctetSequence ReferenceData;
interface ImplementationDef {
attribute string interface_name;
attribute string object_name;
attribute ReferenceData id;
};
enum Policy {
SHARED_SERVER,
UNSHARED_SERVER,
SERVER_PER_METHOD
}; Methods
Parameter | Description |
obj | The object whose definition is to be changed. |
impl | The new implementation definition. |
Caution: Changing the implementation definition of an object after it has been created may make it inaccessible to existing client applications.
static ImplementationDef_ptr
This static method duplicates the specified pointer and returns the duplicated pointer. _duplicate
(ImplementationDef_ptr obj
)
Parameter | Description |
obj | A pointer to the object to be duplicated. |
ReferenceData_ptr *
This method returns the id
() constReferenceData
associated with this object.
void
This method sets the reference data for this object. id
(const ReferenceData& *data
)
Parameter | Description |
data | The reference data for this object. |
const char *
This method returns the interface name associated with this object.
interface_name
() constvoid
This method sets the interface name for this object. interface_name
(const char *val
)
Parameter | Description |
val | The interface name for this object. |
static ImplementationDef_ptr
This static method returns a _nil
()NULL
ImplementationDef
pointer that can be used for initialization purposes.
const char *
This method returns the object name associated with this object.
object_name
() constvoid
This method sets the object name for this object. object_name
(const char *val
)
Parameter | Description |
val | The interface name for this object. |
static void
This static method releases the specified pointer. release
(ImplementationDef_ptr obj
)
Parameter | Description |
obj | The pointer to be released. |
ImplEventHandler
class
The ImplEventHandler
ImplEventHandler
class defines the interface for registering an event handler for object implementations. Event handlers provide a set of methods that are invoked by the BOA when one of the following events occurs.
ImplEventHandler
and provide the implementation just for the event handling methods in which you are interested. Your implementation will be invoked by the BOA when a particular event occurs and can be used to implement logging or security features that you design. If you are not interested in handling a particular event, do not declare its method in your derived class.
After creating an event handler, your object implementation must register it using the
HandlerRegistry
class. You can register an event handler for a particular object or a global event handler for all objects.If both global and object-specific event handlers are registered and an event occurs on the object with its own event handler, the object-specific handler will take precedence over the global handler. If a global event handler is modified, the modifications will not apply to those object that were bound before the handler was modified. For information on creating event handlers for client applications, see ClientEventHandler in this guide.
Include File
Include corba.h
and pmcext.h
when you use this class.
Methods
virtual void
You can choose to implement this method, which will be invoked by the BOA when client aborts. If the event handler was registered for a particular object, it will only be invoked when a client that was bound to that object aborts. If the event handler is registered with a global scope, it will be called when any aborts. client_aborted
(const ConnectionInfo
&, CORBA::Object_ptr
)
Parameter | Description |
ConnectionInfo | This structure contains the host name, port, and file descriptor. |
CORBA::Object_ptr | A pointer to the object the client has requested to be bound. |
virtual void
You can choose to implement this method, which will be invoked by the BOA before a client request for a method on an object is processed. After this method returns, the client's request is processed. If the event handler was registered for a particular object, it will only be invoked when a method is requested for that object. If the event handler is registered with a global scope, it will be called when an method is requested on any object. pre_method
(const ConnectionInfo
&, CORBA::Principal_ptr
,
const char *
, CORBA::Object_ptr
)
virtual void
You can choose to implement this method, which will be invoked by the BOA after an object method has been invoked but before the results are returned to the client. If the event handler was registered for a particular object, it will only be invoked after a method requested for that object has been processed. If the event handler is registered with a global scope, it will be called after any method is invoked on any object. pre_method
(const ConnectionInfo
&, CORBA::Principal_ptr
,
const char *
, CORBA::Object_ptr
)
virtual void
You can choose to implement this method, which will be invoked by the BOA when client requests to be unbound from an object. If the event handler was registered for a particular object, it will only be invoked when an unbind is requested for that object. If the event handler is registered with a global scope, it will be called when any unbind request is received. unbind
(const ConnectionInfo
&, CORBA::Object_ptr
)
InterfaceDef
class
The InterfaceDef
: public Container
, public Contained
, public IDLType
InterfaceDef
class is used to define an ORB object's interface that is stored in the interface repository.
For more information, see Container, Contained and IDLType in this guide.
Include File
Include corba.h
when you use this class.
IDL Definition
interface InterfaceDef: Container, Contained, IDLType {
typedef sequence<RepositoryId> RepositoryIdSeq;
typedef sequence<OperationDescription> OpDescriptionSeq;
typedef sequence<AttributeDescription> AttrDescriptionSeq;
attribute InterfaceDefSeq base_interfaces;
boolean is_a(in RepositoryId interface_id);
struct FullInterfaceDescription {
Identifier name;
RepositoryId id;
RepositoryId defined_in;
VersionSpec version;
OpDescriptionSeq operations;
AttrDescriptionSeq attributes;
RepositoryIdSeq base_interfaces;
TypeCode type;
};
FullInterfaceDescription describe_interface();
AttributeDef create_attribute(
in RepositoryId id,
in Identifier name,
in VersionSpec version,
in IDLType type,
in CORBA::AttributeMode mode
);
OperationDef create_operation(
in RepositoryId id,
in Identifier name,
in VersionSpec version,
in IDLType result,
in OperationMode mode,
in ParDescriptionSeq params,
in ExceptionDefSeq exceptions,
in ContextIdSeq contexts
);
};
struct InterfaceDescription {
Identifier name;
RepositoryId id;
RepositoryId defined_in;
VersionSpec version;
RepositoryIdSeq base_interfaces;
}; Methods
voidThis method sets the list of the interfaces from which this class inherits. An error is returned if the name attribute of any object contained by this interface conflicts with the name attribute of any object contained by any of the interfaces specified in the sequence.base_interfaces
(const InterfaceDefSeq&val
)
Parameter | Description |
val | The list of interfaces from which this interface inherits. |
AttributeDef_ptr
This method returns a pointer to a newly created AttributeDef that is contained this object. The create_attribute
(const char * id
,
const char * name
,
const VersionSpec& version
,
IDLType_ptr type
,
AttributeMode mode
)id
, name
, version
, type
and mode
are set to the specified values. An error is returned if an object with the specified id
already exists within the object repository or if an object with the specified name
already exists within this InterfaceDef
.
Parameter | Description |
id | The interface id to use. |
name | The interface name to use. |
version | The interface version to use. |
mode | The interface mode: readonly or normal. |
OperationDef_ptr
This method creates an create_operation
(const char *id
,
const char *name
,
IDLType_ptr result
,
OperationMode mode
,
const ParDescriptionSeq& params
,
const ExceptionDefSeq& exceptions
,
const ContextIdSeq& contexts
)OperationDef
that is contained by this object, using the specified parameters. The
defined_in
attribute of the OperationDef
is set to identify this InterfaceDef
.
InterfaceDef::FullInterfaceDescription *
This method returns a FullInterfaceDescription that describes this object's interface.
describe_interface
()Boolean
This method returns true if this interface is identical to or inherits from, directly or indirectly, from the specified interface. is_a
(const char * interface_id
)
Parameter | Description |
interface_id | The id of the interface to be checked against this interface. |
IRObject
class
The IRObject
IRObject
class offers the most generic interface for Interface Repository (IR) objects. The Container
class, IDLType, Contained, and others are derived from this class.
Include File
Include corba.h
when you use this class.
IDL Definition
interface IRObject {
readonly attribute DefinitionKind def_kind;
void destroy();
}; Methods
DefinitionKind
enumeration values: dk_Attribute, dk_Constant, dk_Exception, dk_Interface, dk_Module, dk_Operation, dk_Typedef, dk_Alias, dk_Struct, dk_Union, dk_Enum, dk_Primitive, dk_String, dk_Sequence, dk_Array, or dk_Repository.
void IRObject::destroy()
This method deletes this object. If this object is a Container
, all of its contents will also be deleted. If the object is currently contained by another object, it will be removed. The destroy
method cannot be invoked on a Repository
object or on a PrimitiveDef
object.
class NamedValue
The NamedValue
class is used to represent a name-value pair used as a parameter or return value in a Dynamic Invocation Interface request. Objects of this class are grouped into an NVList. The
Any
class is used to represent the value associated with this object. See also the
Request
class.
Include File
Include corba.h
when using this class.
Methods
ARG_IN
- This object represents an input parameter.
ARG_OUT
- This object represents an output parameter.
ARG_INOUT
- This object represents both an input and output parameter.
IN_COPY_VALUE
- This value can be specified in combination with the ARG_INOUT flag to specify that the ORB should make a copy of the parameter. This allows the ORB to release memory associated with this parameter without impacting the client application's memory.const char *
name
() const
Any *value
() const
This method returns the value portion of this object's name-value pair.
class NVList
The NVList
class is used to contain a list of
NamedValue
objects, and is used to pass parameters associated with a Dynamic Invocation Interface request. See also the
Request
class.
Include File
Include corba.h
when using this class.
Methods
NamedValue
object to this list, initializing only the flags. Neither the name or value attribute of the added object are initialized. A pointer is returned which can be used to initialize the name and value attributes of the NamedValue
.
Parameter | Description |
flags |
The flag indicating the intended use of the NamedValue object. It can be one of ARG_IN , ARG_OUT , or ARG_INOUT .
|
NamedValue_ptr
This method adds a add_item
(const char *name
, Flags flags
)NamedValue
object to this list, initializing both the flags and name attribute. A pointer is returned which can be used to initialize the value attribute of the NamedValue
.
Parameter | Description |
name | The name. |
flags |
The flag indicating the intended use of the NamedValue object. It can be one of ARG_IN , ARG_OUT , or ARG_INOUT .
|
NamedValue_ptr
This method adds a add_value
(const char *name
, const Any& val
, Flags flags
)NamedValue
object to this list, initializing the name, value and flags. A pointer to the NamedValue
object is returned.
Parameter | Description |
name | The name. |
val | The value. |
flags |
The flag indicating the intended use of the NamedValue object. It can be one of ARG_IN , ARG_OUT , or ARG_INOUT .
|
Long
This method returns the number of count
() constNamedValue
objects in this list.
static NVList_ptr
This static method duplicates the specified _duplicate
(NVlist_ptr ptr
)NVList_ptr
.
Parameter | Description |
ptr | The object to be duplicated. |
Status
This method releases all the memory associated with all output parameters.
free_out_memory
()static boolean
This method returns true if the specified CORBA::is_nil
(NVList_ptr obj
)NamedValue
pointer is NULL.
Parameter | Description |
obj | The object pointer to be checked. |
NamedValue_ptr
This method returns the item
(Long idx
)NamedValue
in the list with the specified index.
Parameter | Description |
idx |
The index of the desired NamedValue object. The index is zero-based.
|
static NamedValue_ptr
This static method returns a _nil
()NULL
NamedValue
pointer that can be used for initialization purposes.
void
This method releases this object.
_release
()static void
This static method releases the specified object. CORBA::release
(NVList_ptr obj
)
Parameter | Description |
obj | The object to be released. |
Status
This method deletes the NamedValue object from this list, located at the specified index. remove
(Long idx
)
Parameter | Description |
idx |
The index of the NamedValue object. The index is zero-based.
|
Object
class
All ORB objects are derived from the Object
Object
class, which provides methods for binding clients to objects and manipulating object references as well as querying and setting an object's state. The methods offered by the Object
class are implemented by the ORB.
Include File
Include corba.h
when using this class.
Methods
Object_ptr
and returns an pointer to the object. The object's reference count is increased by one.
Parameter | Description |
obj | The object pointer to be duplicated. |
Boolean
This method returns true if this object implements the interface associated with the repository id. Otherwise, false is returned. _is_a
(const char *repository_id
)
Parameter | Description |
logical_type_id | The repository identifier to check. |
Boolean
This method returns true if the specified object pointer points to this object. Otherwise, false is returned. _is_equivalent
(Object_ptr other_object
)
Parameter | Description |
other_object | Pointer to an object that is to be compared to this object. |
void
This method returns true if this object's reference value is NULL. If it is not NULL, false is returned.
CORBA::is_nil
() const
NOTE: This method should not be used to check the return value from the_narrow
method. Instead, compare it toNULL
.
Boolean _is_persistent
() const
This method returns true if this object is a persistent object. If this object is transient, false is returned.
static Object_ptr _nil
()
This static method returns a NULL pointer suitable for initialization purposes.
Boolean _non_existent
()
This method returns true if the object represented by this object reference no longer exists.
ULong _ref_count
() const
This method returns the current reference count for this object. This is a local operation.
void _release
()
This method releases this object and decrements its reference count. When an object's reference count reaches zero, the ORB will automatically delete the object.
static void CORBA::release
()
This method releases this object and decrements its reference count. When an object's reference count reaches zero, the ORB will automatically delete the object.
Object State MethodsStatusThis method creates a_create_request
(Context_ptrctx
,
const char *operation
,
NVList_ptrarg_list
,
NamedValue_ptrresult
,
Request_ptr&request
,
Flagsreq_flags
)
Request
for an object implementation that is suitable for invocation with the Dynamic Invocation Interface.
static const Principal_ptr
This method returns a pointer to the default _default_principal
()Principal
for this object.
static void
This static method sets the global, default _default_principal
(const Principal& principal
) static constPrincipal
for this object. For more information, see Principal.
Parameter | Description |
principal | The default, global Principal to use for this object. |
ImplementationDef_ptr
This method returns a pointer to this object's implementation definition. See ImplementationDef for more information._get_implementation
()
InterfaceDef_ptr
This method returns a pointer to this object's interface definition. See InterfaceDef for more information._get_interface
()
ULong
This method returns a hash value for this object. This value will not change for the lifetime of this object, however the value is not necessarily unique. If two objects return the different hash values, then they are not identical. The upper bound of the hash value may be specified. The lower bound is zero. _hash
(ULong maximum
)
Parameter | Description |
maximum | The upper bound of the hash value returned. |
const char *
This method returns this object's interface name.
_interface_name
() constBoolean
This method returns true if the object implementation resides on the same host as the client application.
_is_local
() constBoolean
This method returns true if the object implementation resides on a different host than the client application.
_is_remote
() constconst char *
This method returns the object name associated with this object.
_object_name
() constconst Principal_ptr
This method returns a pointer to the _principal
() constPrincipal
associated with this object. For more information, see Principal.
void
This method sets the _principal
(const Principal& principal
)Principal
for this object. For more information, see Principal.
Request_ptr
This method creates a _request
(Identifier operation
)Request
suitable for invoking methods on this objects. A pointer to the Request
object is returned. See Request for more information.
Parameter | Description |
operation | The name of the object method to be invoked. |
OperationDef
class
The OperationDef
: public Contained
OperationDef
class contains information about an interface operation that is stored in the Interface Repository. This class is derived from the Principal class. The inherited describe
method returns a OperationDescription
structure that provides complete information on the operation.
Include File
Include corba.h
when you use this class.
IDL Definition
interface OperationDef: Contained {
typedef sequence<ParameterDescription> ParDescriptionSeq;
typedef Identifier ContextIdentifier;
typedef sequence<ContextIdentifier> ContextIdSeq;
typedef sequence<ExceptionDef> ExceptionDefSeq;
typedef sequence<ExceptionDescription> ExcDescriptionSeq;
readonly attribute TypeCode result;
attribute IDLType result_def;
attribute ParDescriptionSeq params;
attribute CORBA::OperationMode mode;
attribute ContextIdSeq contexts;
attribute ExceptionDefSeq exceptions;
};
struct OperationDescription {
Identifier name;
RepositoryId id;
RepositoryId defined_in;
VersionSpec version;
TypeCode result;
OperationMode mode;
ContextIdSeq contexts;
ParDescriptionSeq parameters;
ExcDescriptionSeq exceptions;
}; Methods
voidThis method sets the list of the context identifiers that apply to this operation.context
(const ContextIdSeq&val
)
Parameter | Description |
val | The list of context identifiers. |
ExceptionDefSeq *
This method returns a list of the exception types that can be raised by this operation.
exceptions
()void
This method sets the list of exception types that may be raised by this operation. exceptions
(const ExceptionDefSeq& val
)
Parameter | Description |
val | The list of exceptions that this operation may raise. |
OperationMode
This method returns the mode of the operation represented by this mode
()OperationDef
. The mode may be normal or oneway. Operations that have a normal mode are synchronous and return a value to the client application. Oneway operations do not block and no response is sent from the object implementation to the client.
void
This method sets the mode of the operation. mode
(OperationMode val
)
Parameter | Description |
val | The desired mode of this operation, either OP_ONEWAY or OP_NORMAL. |
ParDescriptionSeq *
This method returns a pointer to a list of params
()ParameterDescription
structures that describe the parameters to this OperationDef
.
void
This method sets the list of the params
(const ParDescriptionSeq& val
)ParameterDescription
structures for this OperationDef
. The order of the structures is significant and should correspond to the order defined in the IDL definition for the operation.
Parameter | Description |
val |
The list of ParameterDescription structures.
|
TypeCode_ptr
This method returns a pointer to a result
()TypeCode
representing the type of the value returned by this Operation
. The TypeCode
is a read-only attribute.
IDLType_ptr
This method returns a pointer to the definition of the type returned by this result_def
()OperationDef
.
void
This method sets definition of the type returned by this result_def
(IDLType_ptr val
)OperationDef
.
Parameter | Description |
val | A pointer to the type definition to use. |
ORB
class
The ORB
ORB
class provides an interface to the Object Request Broker. It offers methods to both the client object that are independent of the particular Object
or Object Adaptor.
Include File
Include corba.h
when using this class.
Methods
static TypeCode_ptr
create_alias_tc
(const char *repository_id,
const char *type_name
,
TypeCode_ptr original_type
)
TypeCode
for the alias with the specified type and name.
static TypeCode_ptr
This static method dynamically creates a create_array_tc
(Ulong bound
, TypeCode_ptr element_type
)TypeCode
for an array.
Parameter | Description |
bound | The maximum number of array elements. |
element_type | The type of elements stored in this array. |
static TypeCode_ptr
This static method dynamically creates a create_enum_tc
(const char *repository_id,
const char *type_name
,
const EnumemberSeq& members
)TypeCode
for an enumeration with the specified type and members.
Status
This method creates an create_environment
(Enviranment_ptr& env
)Environment
object and returns a reference to the created object.
Parameter | Description |
env | The reference that will be set to point to the newly created Environment. |
static TypeCode_ptr
This static method dynamically creates a create_exception_tc
(const char *repository_id,
const char *type_name
,
const StructMemberSeq& members
)TypeCode
for an exception with the specified type and members.
static TypeCode_ptr
This static method dynamically creates a create_interface_tc
(const char *repository_id,
const char *type_name
)TypeCode
for the interface with the specified type.
Parameter | Description |
repository_id | The identifier generated by the IDL compiler or constructed dynamically. |
type_name | The name of the interface's type. |
Status
This method creates an NVList with the specified number of elements and returns a reference to the list. create_list
(Long num
, NVList_ptr& nvlist
)
Parameter | Description |
num | The number of elements in the list. |
nvlist | Initialized to point to the newly created list. |
Status
This method creates an argument list for the specified operation create_operation_list
(OperationDef_ptr op
, NVList& nvlist
)
Parameter | Description |
op | Pointer to the operation definition whose argument list is to be created. |
nvlist | A reference to the newly created argument list. |
static TypeCode_ptr
This static method dynamically creates a create_recursive_sequence_tc
(Ulong bound
,
Ulong offset
)TypeCode
for a recursive sequence. The result of this method can be used to create other types.
Parameter | Description |
bound | The maximum number of sequence elements. |
offset | The offset parameter determines which enclosing TypeCode describes the elements of this sequence. |
static TypeCode_ptr
This static method dynamically creates a create_sequence_tc
(Ulong bound
,
TypeCode_ptr element_type
)TypeCode
for a sequence.
Parameter | Description |
bound | The maximum number of sequence elements. |
element_type | The type of elements stored in this sequence. |
static TypeCode_ptr
This static method dynamically creates a create_struct_tc
(const char *repository_id,
const char *type_name
,
const StructMemberSeq& members
)TypeCode
for the structure with the specified type and members.
static TypeCode_ptr
This static method dynamically creates a create_union_tc
(const char *repository_id,
const char *type_name
,
TypeCode_ptr discriminator_type
,
const UnionMemberSeq& members
)TypeCode
for a union with the specified type, discriminator and members.
static TypeCode_ptr
This static method dynamically creates a create_string_tc
(Ulong bound
)TypeCode
for a string.
Parameter | Description |
bound | The maximum length of the string. |
static ORB_ptr
This static method duplicates the specified ORB pointer and returns a pointer to the duplicated ORB. _duplicate
(ORB_ptr ptr
)
Parameter | Description |
ptr | The ORB pointer to be duplicated. |
Status
This method returns a reference to the default get_default_context
(Context_ptr& ctx
)Context
for this process..
Parameter | Description |
ctx | Initialized to the default Context for this process. |
Status
This method blocks waiting for the response associated with a deferred request. You can use the ORB::poll_next_response method to determine if there is a response waiting to be received before calling this method. get_next_response
(RequestSeq*& req
)
Parameter | Description |
req | Set to point to the request that has been received. |
static ORB_ptr
This static method returns a _nil
()NULL ORB
pointer suitable for initialization purposes.
char *
This method converts the specified object reference to a string, a process referred to as "stringification" in the CORBA specification. Object references that have been converted to strings can be stored in files etc. This is an ORB method because different ORB implementations may have different conventions for representing object references as strings.
object_to_string
(Object_ptr obj
)
NOTE: The reference can be made persistent by saving it to a file; the object itself is not made persistent.
Parameter Description obj Pointer to an object that is to be converted to a string.
static ORB_ptrThis method initializes the ORB and is used by both clients and object implementations. It returns a pointer to the ORB that can be used to invoke ORB methods. The argc and argv parameters passed to the application's main function can be passed directly to this method. The arguments accepted by this method take the form of name-value pairs which allows them to be distinguished from other command line arguments.ORB_init
(int&argc
,
char *const *argv
,
const char *orb_id
= "Internet ORB")
Parameter | Description |
argc | The number of arguments passed. |
argv | The list of arguments passed. |
orb_id | Identifies the type of ORB. Currently "Internet ORB" is the only supported value. |
Boolean
This method returns true if a response to a deferred request has been received, otherwise false is returned. This call does not block.
poll_next_response
()static void
This static method releases the specified ORB pointer. Once the object's reference count reaches zero, the object is automatically deleted. CORBA::release
(ORB_ptr ptr
)
Parameter | Description |
prt | A pointer to the object to be released. |
Status
This method sends all the client request in the specified sequence as deferred requests. The ORB will not wait for any responses from the object implementation. The client application is responsible for retrieving the responses to each request using the send_multiple_requests_deferred
(const RequestSeq& req
)ORB::get_next_response
method.
Parameter | Description |
req | A sequence of deferred requests to be sent. |
Status
This method sends all the client requests in the specified sequence as oneway requests. The ORB does not wait for a response from any of the requests because oneway requests do not generate responses from the object implementation. send_multiple_requests_oneway
(const RequestSeq& req
)
Parameter | Description |
req | A sequence of oneway requests to be sent. |
Object_ptr
This method converts a string representing an object into an object pointer. The string must have been created using the string_to_object
(const char *str
)ORB::object_to_string
method.
Parameter | Description |
str | A pointer to a string representing an object. |
Principal
typedef OctetSequence
The Principal
Principal
is used to represent the client application on whose behalf a request is being made. An object implementation can accept or reject a bind request, based on the client's Principal
.
Include File
Include corba.h
when using this typedef.
Methods
The BOA class provides the get_principal method which returns a pointer to the Principal associated with an object. The Object class provides also provides methods for getting and setting the Principal.
Repository
class
The Repository
: public Container
Repository
class provides access to the interface repository and is derived from the Container
class.
Include File
Include corba.h
when using this class.
IDL Definition
interface CORBA_Repository: CORBA_Container {
Contained lookup_id(in RepositoryId search_id);
PrimitiveDef get_primitive(in CORBA::PrimitiveKind kind);
StringDef create_string(in unsigned long bound);
SequenceDef create_sequence(
in unsigned long bound,
in IDLType element_type
);
ArrayDef create_array(
in unsigned long length,
in IDLType element_type
);
}; Methods
ArrayDef
and returns a pointer to that object.
Parameter | Description |
length | The maximum number of elements in the array. This value must be greater than zero. |
element_type | The IDLType of the elements stored in the array. |
SequenceDef_ptr
This method creates a new create_sequence
(CORBA::ULong bound
,
IDLType_ptr element_type
)SequenceDef
object and returns a pointer to that object.
Parameter | Description |
bound | The maximum number of items in the sequence. This value must be greater than zero. |
element_type | A pointer to the IDLType of the items stored in the sequence. |
StringDef_ptr
This method creates a new create_string
(Ulong bound
)StringDef
object and returns a pointer to that object.
Parameter | Description |
bound | The maximum length of the string. This value must be greater than zero. |
PrimitiveDef_ptr
This method returns a reference to a PrimitiveKind. get_primitive
(PrimitiveKind kind
)
Parameter | Description |
kind | The reference returned to the |
Contained_ptr
This method searches for an object in the interface repository that matches the specified search id. If no match is found, a NULL value is returned. lookup_id
(const char * search_id
)
Parameter | Description |
search_id | The identifier to use for the search. |
Request
class
The Request
Request
class is used by client applications to invoke an operation on an ORB object using the Dynamic Invocation Interface. A single ORB object is associated with a given Request
object. The Request
specifies an operation to be performed on the ORB object, the arguments to be passed, the Context
and an Environment
object, if any. Methods are provided for invoking the request, receiving the response from the object implementation and retrieving the result of the operation.
The Object class provides the methods _create_request
and _request
for creating a Request
object.
Include File
Include corba.h
when you use this class.
Methods
NVList
object containing the arguments for this request. The pointer can be used to set or retrieve the argument values.
void
This method sets the ctx
(CORBA::Context_ptr ctx
)Context
to be used with this request.
Parameter | Description |
ctx | The Context object to be associated with this request. |
CORBA::Context_ptr
This method returns a pointer to the ctx
() constContext
associated with this request.
CORBA::Environment_ptr
This method returns a pointer to the env
()Environment
associated with this request.
CORBA::Status
This method is used after theget_response
() send_deferred
method has been invoked to retrieve a response from the object implementation. If there is no response available, this method blocks the client application until a response is received.
CORBA::Status
This method invokes this invoke
()Request
on the ORB object associated with this request. This method will block the client until a response is received from the object implementation. This Request
should be initialized with the target object, operation name, and arguments before this method is invoked.
const char*
This method returns the name of the operation that this request will represent.
operation
() constCORBA::Boolean
This nonblocking method is invoked after thepoll_response
() send_deferred
method to determine if a response has been received. This method returns true if a response has been received, otherwise false is returned.
CORBA::NamedValue_ptr
This method returns a pointer to a result
()NamedValue
object where the return value for the operation will be stored. The pointer can be used to retrieve the result value after the request has been processed by the object implementation.
CORBA::Status
Like thesend_deferred
() invoke
method, this method sends this Request
to the object implementation. Unlike the invoke
method, this method does not block waiting for a response. The client application can retrieve the response using the get_response
method.
CORBA::Status
This method invokes this send_oneway
()Request
as oneway operation. Oneway operations do not block and do not result in a response being sent from the object implementation to the client application.
CORBA::Object_ptr
This method returns a reference to the target object on which this request will operate.
target
() const SystemException
class
The SystemException
: public Exception
SystemException
class is used to report standard system errors encountered by the ORB or by the object implementation. This class is derived from the Exception
class, which provides methods for printing the name and details of the exception to an output stream.
SystemException
object include a completion status, that indicates if the operation that caused the exception was completed. SystemException
objects also have a minor code that can be set and retrieved.
Include File
Include corba.h
when you use this class.
Methods
COMPLETED_YES;
otherwise, it returns false.
voidThis method sets the completion status for this object.completed
(CompletionStatusstatus
)
Parameter | Description |
status | The completion status, one of COMPLETED_YES, COMPLETED_NO, or COMPLETED_MAYBE. |
ULong
This method returns this object's minor code.
minor
() constvoid
This method sets the minor code for this object. minor
(ULong val
)
Parameter | Description |
val | The minor code. |
static SystemException *
This method attempts to narrow the specified _narrow
(Exception *exc
)Exception
pointer to a SystemException
pointer. If the supplied pointer points to a SystemException
object, or an object derived from SystemException
, a pointer to the object is returned. If the supplied pointer does not point to a SystemException
object, a NULL
pointer is returned.
Parameter | Description |
exc | An Exception pointer to be narrowed. |
This method creates a
SystemException
object with the specified properties.
Parameter | Description |
minor | The minor code. |
status | The completion status, one of COMPLETED_YES, COMPLETED_NO, or COMPLETED_MAYBE. |
Last Updated: 02/03/98 17:19:17
Any sample code included above is provided for your use on an "AS IS" basis, under the Netscape License Agreement - Terms of Use