4.5.1 Visual Basicクライアントの例: Bootstrapオブジェクトの使用

次のコード・スニペットは、Bootstrapオブジェクトを使用するVisual Basicクライアントのプログラミング方法を示しています。

‘Declare the Bootstrap object
Public oBootstrap As DITobj_Bootstrap

‘Declare the FactoryFinder object
Public oBsFactoryFinder As DITobj_FactoryFinder

‘Declare factory for Registrar object
Public oRegistrarFactory As DIUniversityB_RegistrarFactory

‘Declare actual Registrar object
Public oRegistrarFactory As DIUniversityB_RegistrarFactory
....

‘Create the Bootstrap object

Set oBootstrap = CreateObject(“Tobj.Bootstrap”)

‘Connect to the Oracle Tuxedo Domain
oBootstrap.Initialize    “//host:port”

‘Get the FactoryFinder for the Oracle Tuxedo Domain
Set oBSFactoryFinder =  oBootstrap.CreateObject(“Tobj.FactoryFinder”)

‘Get a factory for the Registrar object
‘using the FactoryFinder method find_one_factory_by_id
Set oRegistrarFactory =
oBSFactoryFinder.find_one_factory_by_id(“RegistrarFactoryID”)

'Create a Registrar object
Set oRegistrar = oRegistrarFactory.find_registrar(exc)