Oracle9i OLAP Services Developer's Guide to the Oracle OLAP API
Release 1 (9.0.1)

Part Number A88756-01
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table of Contents
Contents
Go To Index
Index

Master Index

Feedback

Go to previous page Go to beginning of chapter Go to next page

Using the Smart Agent Naming Service, 3 of 3


Getting the CORBA Stub Using VisiBroker Smart Agent

What is a CORBA stub?

A CORBA stub is a Java object that resides on the application computer and represents the OLAP service to which a connection will be made. To obtain the stub, you execute methods that are provided by a CORBA naming service.

What do you do with a CORBA stub?

In the connection steps that are described in Chapter 3, you pass the stub as a parameter to the connect method on a ConnectionManager. The stub helps to identify the service to which the connection will be made.

Code for getting the CORBA stub

The following sample code for getting the stub uses the Smart Agent naming service that is compatible with version 3.4 of VisiBroker for Java. The code initializes an ORB object (called myORB in the code) and creates a stub that represents an OLAP service. The code specifies the following three identifiers:

You can find out the computer name, the port number, and the OLAP service name by asking your OLAP Services database administrator.

import org.omg.CORBA.ORB;

Properties orbParams = System.getProperties();
String addrName = "ORBagentAddr";
String addrValue = "LAB1";
String portName = "ORBagentPort";
String portValue = "10160";
orbParams.put(addrName, addrValue);
orbParams.put(portName, portValue);
String[] dummyArgs = {"A", "B"};

ORB myORB = ORB.init(dummyArgs, orbParams);

String serviceString = "LAB1:OLAPSrv1";

org.omg.CORBA.Object serviceStub = 
   ((com.visigenic.vbroker.orb.ORB) myORB).bind(
   "IDL:ExpressConnectionModule/ServerInterface:1.0",
   serviceString, null, null);

An alternative way to specify the Smart Agent computer name and port number is by providing them as parameters to the Java Runtime Environment (JRE) when the application executes. For our example, the following parameters could be specified when the application is executed. For each one, "-D" indicates that what follows is a JRE parameter.

-DORBagentAddr=LAB1 -DORBagentPort=10160

With these parameters specified, the application can use the ORB.init() method with no parameters.


Go to previous page Go to beginning of chapter Go to next page
Oracle
Copyright © 1996-2001, Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Book List
Go To Table of Contents
Contents
Go To Index
Index

Master Index

Feedback