INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
libOrcaIce
|
Customizes Ice API for Orca.
This library aims at simplifying Orca component development. It provides several helper classes to use and derive from and several functions to use. In doing so we make unavoidable assumptions about how Ice is going to be used in Orca components. If your component cannot live with these constraints you can always go back to using Ice directly (it's not much more work).
Header file:
#include <orcaice/orcaice.h>
Contents:
Here's what our stand-alone component looks like. In this figure and the one below, white color stands for standard Ice objects which we don't modify, e.g. the Communicator -- the Ice run-time object. Gray color stands for the objects which come with libOrcaIce and used unmodified by component developers. Cream color stands for component-specific code, written by component developers.
Here's what an IceBox service looks like. The main idea is to have the guts of the component used unmodified in both stand-alone and application server environment.
Note that 'Component1' code is identical in both cases -- that's a big time saver!
The functions described here are very high-level. They are intended as one-line wrappers which work in typical situations. If your usage does not fit the pattern, no worries: just look how they are implemented, copy the code into your program and modify it as needed.
In the discussion below, we assume here that the library functions are called from inside a class derived from orcaice::Component. You can see more output from libOrcaIce by setting orcaice::Tracer verbosity for info, warning, and error to 2.
Make an instance of your object implementation and initialize it using information in the config file.
Ice::MyInterfacePtr obj = new MyInterfaceI; orcaice::createInterfaceWithTag( context(), obj, "MyConfigFileTag" );
The interface tag in this example is "MyConfigFileTag". The function context() summarizes the context of your component (pointers to Communicator, Adapter, etc.). The function orcaice::createInterfaceWithTag adds the newly created interface implementation to the component's adapter, thereby making it reachable over the network.
Let's start sending updates of object type orca::MyObject. The config file tag for this interface is "MyConfigFileTag".
orca::MyInterfaceConsumerPrx publisher; orcaice::connectToTopicWithTag <orca::MyObjectConsumerPrx> ( context(), publisher, "MyConfigFileTag" );
Use this function to connect to the IceStorm server and get a proxy to the "consumer of information". We will publish information by pushing data to the consumer. Note that you don't create the proxy itself (using keyword new), the function does everything for you.
Now let's connect to a remote interface. We first create a proxy of the right type (so we can call its remote operations). The interface tag here is "MyConfigFileTag". Note that you don't create the proxy itself (with new), the function does everything for you.
orca::YourObjectPrx yourObjectPrx; orcaice::connectToInterface<orca::YourObjectPrx>( context(), yourObjectPrx, "MyConfigFileTag" );
There's no corresponding function in libOrcaIce because, normally, you call the subscribe() operation on an interface which publishes the data so you don't actually talk to the IceStorm server directly.
The following properties are assigned defaults unless they are configured explicitely:
IceStorm.TopicManager.Proxy
(string)
[ComponentTag].AdapterId (string)
[ComponentTag].Endpoints (string)Ice.Admin.Endpoints
(string)Component and Application properties.
Orca.Component.RequireRegistry
(bool)Orca.Component.EnableTracer
(bool)Orca.Component.EnableStatus
(bool)Orca.Component.EnableHome
(bool)Orca.Component.EnableProperties
(bool)Orca.Component.EnableProcess
(bool)Orca.PrintProperties
(bool)Orca.Component.PrintProperties
(bool)Orca.Component.PrintContext
(bool)Orca.Component.PrintStarted
(bool)Orca.Application.CallbackOnInterrupt
(bool)Properties for individual standard interfaces.
Orca.Status.RequireIceStorm
(bool)Orca.Status.PublishPeriod
(int)Orca.Status.StallTolerance.Multiplicative
(double)Orca.Status.StallTolerance.Additive
(double)Orca.Tracer.RequireIceStorm
(bool)Orca.Tracer.Filename
(string)Orca.Tracer.Timestamp
(bool)Tracing and warnings.
Orca.Warn.DefaultProperty
(bool)Orca.Warn.FactoryProperty
(bool)A sample configuration file which sets all parameters to sensible defaults is shown here.
# Ice config Ice.Default.Locator=IceGrid/Locator: default -p 12000 #Ice.Default.Locator=IceGrid/Locator: default: default -h host.xxx.xxx.xxx -p 12000 # Orca config Orca.Component.RequireRegisty=0 Orca.Component.PrintProperties=0 Orca.Component.PrintContext=0 Orca.Component.PrintStarted=0 Orca.Status.RequireIceStorm=0 Orca.Tracer.RequireIceStorm=0 # Orca warnings Orca.Warn.DefaultProperty=1 Orca.Warn.FactoryProperty=0 # Orca Tracer config Orca.Tracer.Filename=orca_component_trace.txt Orca.Tracer.InfoToDisplay=1 Orca.Tracer.InfoToNetwork=0 Orca.Tracer.InfoToLog=0 Orca.Tracer.InfoToFile=0 Orca.Tracer.WarningToDisplay=1 Orca.Tracer.WarningToNetwork=0 Orca.Tracer.WarningToLog=0 Orca.Tracer.WarningToFile=0 Orca.Tracer.ErrorToDisplay=10 Orca.Tracer.ErrorToNetwork=0 Orca.Tracer.ErrorToLog=0 Orca.Tracer.ErrorToFile=0 Orca.Tracer.DebugToDisplay=0 Orca.Tracer.DebugToNetwork=0 Orca.Tracer.DebugToLog=0 Orca.Tracer.DebugToFile=0 Orca.Tracer.Timestamp=1
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)