VisiBroker for C++ Server Manager Interfaces and Classes

This document describes C++ Container and Storage interfaces and their associated methods for the Server Manager.

The Container Interface

Container Methods for C++

A container can hold properties, operations, and other containers. Each major ORB component is represented as a container. The top-level container corresponds to the ORB itself and includes a few ORB properties, the shutdown method, and a few other commonly used containers like RootPOA and Agent.

This section explains the C++ methods that can be executed on the container interface. There are four categories:

Methods related to property manipulation and queries

CORBA::StringSequence list_all_properties();

Returns the names of all the properties in the contianer as a StringSequence.

PropertySequence get_all_properties();

Returns the PropertySequence containing the names, values, and read-write status of all the properties in the container.

Property get_property(in string name raises(NameInvalid);

Returns the value of the property name passed as an input parameter.

void add_property(in string name, in any value) raises(NameInvalid, ValueInvalid, ValueNotSettable);

Sets the value of the property name to the requested value.

void persist_properties(in boolean recurse) raises(StorageException);

Causes the container to actually store its properties to the associated storage. If no storage is associated with the container, a StorageException will be raised. When it is invoked with the parameter recurse=true, the properties of the children containers are also stored into the storage. It is up to the container to decide if it has to store all the properties or only the changed properties.

void restore_properties(in boolean recurse) raises(StorageException);

Instructs the container to obtain its properties from the storage. A container knows exactly what properties is manages and it attempts to read those properties from the storage. The containers shipped with the ORB do not support restoring from the storage. You must create containers that support this feature yourself.

Methods related to operations

::CORBA::StringSeqence list_all_operations();

Returns the names of all the operations suppored in the container.

OperationSequence get_all_operations();

Returns all the operations along with the parameters and the type code of the parameters so that the operation can be invoked with the appropriate parameters.

Operation get_operation(in string name) raises(NameInvalid);

Returns the parameter information of the operation specified by name which can be used to invoke the operation.

any do_operation(in Operation op) raises(NameInvalid, ValueInvalid, OperationFailed);

Invokes the method in the operation and returns the result.

Methods related to children containers

::CORBA::StringSequence list_all_containers();

Returns the names of all the children containers of the current container.

NamedContainerSequence get_all_containers();

Returns all the children containers.

NamedContainer get_container(in string name) raises(NameInvalid);

Returns the child container identified by the name parameter. If there is not any child container with this name, a NameInvalid exception is raised.

void add_container(in NamedContainer container) raises(NameAlreadyPresent, ValueInvalid);

Adds the container as a child container of this container.

void set_container(in string name, in Container value)  raises(NameInvalid, ValueInvalid, ValueNotSettable);

Modifies the child container identified by the name parameter to one in the value parameter.

Methods related to storage

void set_storage(in Storage s, in boolean recurse);

Sets the storage of this container. If recurse=true, it also sets the storage for all its children as well.

Storage get_storage();

Returns the current storage of the container.

The Storage Interface

The Server Manager provides an abstract notion of storage that can be implemented in any fashion. Individual containers may choose to store their properties in databases, flat files, or some other means. The storage implementation included with the VisiBroker ORB uses a flat-file-based approach.

Storage Interface Methods for C++

void open() raises (StorageException);

Opens the storage and makes it ready for reading and writing the properties. For the database-based implementation, logging into the database is performed in this method.

void close() raises (StorageException);

Closes the storage. This method also updates the storage with any properties that have been changed since the last Container::persist_properties call. In database implementations, this method closes the database connection.

Container::PropertySequence read_properties() raises(StorageException);

Reads all the properties from the storage.

Container::Property read_property(in string propertyName) raises(StorageException, Container::NameInvalid);

Returns the property value for propertyName read from the storage.

void write_properties(in Container::PropertySequence p) raises(StorageException);

Saves the property sequence into the storage.

void write_property(in Container::Property p) raises(StorageException);

Saves the single property into the storage.