5.2.3 Locating a Factory
For a client application to request a factory to create a reference to an object, it must first obtain a reference to the factory object. The reference to the factory object is obtained by querying a FactoryFinder with specific selection criteria (see the following figure). The criteria are determined by the format of the particular FactoryFinder interface and method used.
Figure 5-2 Locating a Factory Object

Oracle Tuxedo CORBA extends the
CosLifeCycle::FactoryFinder
interface by introducing
four methods in addition to the find_factories()
method declared for the FactoryFinder. Therefore, using the Tobj
extensions, a client can use either the
find_factories(
) or
find_factories_by_id()
methods to obtain a list of
application factories. A client can also use the
find_one_factory
() or
find_one_factory_by_id
() method to obtain a single
application factory, and list_factories ()
to obtain a
list of all registered factories.
Note:
You can used the Oracle Tuxedo CORBA extensions to theCosLifeCycle::FactoryFinder
interface if you use the Tobj_Bootstrap object, however, use of the Tobj_Bootstrap object is not required to locate a factory. If you use CORBA INS, you can use the find_factories()
method provided by the CosLifeCycle::FactoryFinder
interface.
The CosLifeCycle::FactoryFinder
interface defines a
factory_key
, which is a sequence of id
and kind
strings conforming to the CosNaming Name
shown below. The kind
field of the NameComponent for
all application factories is set to the string
FactoryInterface
by the TP Framework when an
application factory is registered. Applications supply their own
value for the id
field.
Assuming that the CORBAservices Life Cycle Service modules are
contained in their own file (ns.idl
and
lcs.idl,
respectively), only the OMG IDL code for that
subset of both files that is relevant for using the Oracle Tuxedo
FactoryFinder is shown in the following listings.