Tuxedo
0

Administering a Tuxedo Application at Run Time

 Previous Next Contents View as PDF  

CosLifeCycle::FactoryFinder::find_factories

Synopsis

Obtains a sequence of factory object references.

C++ Mapping

CosLifeCycle::Factories *
CORBA::Object_ptr CosLifeCycle::FactoryFinder::find_factories(
const CosNaming::Name& factory_key)
throw (CosLifeCycle::NoFactory);

Java Mapping

import org.omg.CosLifeCycle.*;
public org.omg.CORBA.Object[] find_factories(
org.omg.CosNaming.NameComponent[] factory_key)
throws org.omg.CosLifeCycle.NoFactory;

Parameter

factory_key

This parameter is an unbounded sequence of NameComponents (tuple of <id, kind> pairs) that uniquely identifies a factory object reference.

A NameComponent is defined as a having two members: an id and a kind, both of type string. The id field is used to represent the identity of factory object. The kind field is used to indicate how the value of the id field should be interpreted.

References to factory object registered using the operation TP::register_factory will have a kind value of "FactoryInterface".

Exception

CORBA::BAD_PARAM

Indicates that the value of an input parameter has an inappropriate value or is invalid. Of particular importance, the exception is raised if no value or a NULL value for the parameter factory_key is specified.

CosLifeCycle::NoFactory

Indicates that there are no factories registered that match the information in the factory_key parameter.

Description

The find_factories method is called by an application to obtain a sequence of factory object references. The operation is passed a key used to identify the desired factory. The key is a name, as defined by the CORBAservices Naming service. More than one factory may match the key, and, if that is the case, the FactoryFinder returns a sequence of factories.

The scope of the key is the FactoryFinder. The FactoryFinder assigns no semantics to the key. It simply matches keys. It makes no guarantees about the interface or implementation of the returned factories or objects they create.

Key values are considered equal if they are of equal length (same number of elements in the sequence), and if every NameComponent value in the key matches the corresponding NameComponent value at the exact same location in the key that was specified when the reference to the factory object was registered.

Return Values

An unbounded sequence of references to factory objects that match the information specified as the value of the factory_key parameter. In C++, the method returns a sequence of object references of type CosLifeCycle::Factory. In Java, the method returns an unbounded array of object references of type org.omg.CORBA.Object.

If the operation raises an exception, the return value is invalid and does not need to be released by the caller.

factory_key

This parameter is an unbounded sequence of NameComponents (tuple of <id, kind> pairs) that uniquely identifies a factory object reference.

A NameComponent is defined as a having two members: an id and a kind, both of type string. The id field is used to represent the identity of factory object. The kind field is used to indicate how the value of the id field should be interpreted.

References to factory object registered using the operation TP::register_factory will have a kind value of "FactoryInterface".CORBA::BAD_PARAM

Indicates that the value of an input parameter has an inappropriate value or is invalid. Of particular importance, the exception is raised if no value or a NULL value for the parameter factory_key is specified.

CosLifeCycle::NoFactory

Indicates that there are no factories registered that match the information in the factory_key parameter.

Indicates that the FactoryFinder or NameManager encountered an internal error while attempting to locate a reference for a factory object.

Error information is written to the user log.

Indicates that the FactoryFinder could not communicate with the NameManager.

Error information is written to the user log.The find_one_factory method is called by an application to obtain a reference to a single factory object whose key matches the value of the key specified as input to the method. If more than one factory object is registered with the specified key, the FactoryFinder selects one factory object based on the FactoryFinder's load balancing scheme. As a result, invoking the find_one_factory method multiple times using the same key may return different object references.

The scope of the key is the FactoryFinder. The FactoryFinder assigns no semantics to the key. It simply matches keys. It makes no guarantees about the interface or implementation of the returned factory or objects they create.

Key values are considered equal if they are of equal length (same number of elements in the sequence), and if every NameComponent value in the key matches the corresponding NameComponent value at the exact same location in the key that was specified when the reference to the factory object was registered.An object reference for a factory object. In C++, the method returns an object reference of type CosLifeCycle::Factory. In Java, the method returns an object reference of type org.omg.CORBA.Object.

If the operation raises an exception, the return value is invalid and does not need to be released by the caller.

 

Back to Top Previous Next
Contact e-docsContact BEAwebmasterprivacy