Usage for ORBacus ORB
Make sure that OB.jar and OBNaming.jar are in the CLASSPATH.
java com.ooc.CosNaming.Server -ORBconfig Naming.properties
Option -ORBconfig points to a configuration file.
Below shows a sample configuration file:
------------------------------------------------------------------
ooc.boa.port=1500
ooc.boa.conc_model=thread_pool
ooc.boa.thread_pool=100
ooc.orb.trace_level=1
-------------------------------------------------------------------
ooc.boa.port sets up the Name Service's listen port.
ooc.boa.conc_model means the concurrent model is thread pool.
ooc.boa.thread_pool sets the number of threads in the pool.
ooc.orb.trace_level sets up the tracing infomation.
For more information on how to configure the Name Server, please refer to the developer's guide.
java com.lightbridge.corba.server.ServerORBacus -ORBconfig Server.properties -ORBservice NameService iiop://localhost:1500/NameService
Replace localhost and port number with the ones of the Name Service.
Below shows a sample of the server configuration file:
-------------------------------------------------------------------
ooc.boa.conc_model=thread_pool
ooc.boa.thread_pool=100
ooc.orb.server_timeout=100
ooc.orb.trace_level=1
--------------------------------------------------------------------
ooc.orb.server_timeout
A server will actively close a connection after it has been idle for timeout seconds. Note
that the application must use one of the threaded concurrency models if connection timeouts
are desired.
java com.lightbridge.corba.server.ClientORBacus client.properties
Replace localhost and port number with the ones of the Name Service.
Below shows a sample of the client configuration file:
-------------------------------------------------------------------
ooc.orb.trace_level=1
ooc.orb.conc_model=threaded
lb.orb.ORBconfig=Client.properties
lb.orb.ORBservice=NameService
lb.orb.NameServerLocation=iiop://tinman:1500/NameService
lb.orb.product=portal
lb.orb.jndiLookup=lightbridge.Portal
lb.orb.request=MaxConsumerRequest.xml
--------------------------------------------------------------------
ooc.orb.conc_model
Va l u e : blocking, reactive, threaded
Selects the client-side concurrency model.
lb.orb.ORBconfig
Configuration file name for the underline ORB
lb.orb.ORBservice
Name Server's name. Should be "NameService" in this case.
lb.orb.NameServerLocation
Name Server location
lb.orb.product
Object Name
lb.orb.jndiLookup
JNDI lookup name
lb.orb.request
A file contains the actual request string
One must pass the location of the Name Service to the C++ client program. The location of the Name Service looks like iiop://localhost:1500/NameService.
LbCorba class encapsulates the underline ORB implementation and gives user an easy interface to invoke a method
on a
remote stateless session bean through a CORBA server. The stateless session bean must provide a create method with
no
argument and the method being invoked on must take a string argument and return a String value.
To use this class, user needs to provide NameServer name and location to the
constructor like this:
LbCorba corba("NameService", "iiop://localhost:1500/NameService");
One must replace "iiop." with the true location of the Name Server.
To invoke a method:
string response = corba.Call(request.c_str(),
objectName,
JNDIname,
"");
The Call method takes four arguments. Last two are optional.
The syntax of the Call method and its parameters are as the following:
string LbCorba::Call(const string& request,
const string& objectName,
const string& lookup,
const string& method)
Parameters:
request Input parameter for the bean's method
objectName object name in the registry to identify App Servers
lookup home interface name, default to "lightbridge." + objectName
method method name, default to "doTransaction"