This page last changed on Feb 14, 2008 by sfentress.

There are 2 layers where services are used in OTrunk. At the object/model layer and at the view/controller layer.
This page focuses on the services for the object/model layer of OTrunk. Look at the OTrunk View Services page for information about the view/controller layer.
These services are stored in the OTSystem object, and are managed by the OTrunkImpl object

Accessing services

There are 2 ways to access these services:

  • call the instance method OTrunk.getService(Class serviceInterface)
  • add the service interface as a param to the constructor of a concrete OTClass. for example:
    public OTSensorDataProxy(ResourceSchema resources,
    			SensorDataManager sdm) {

Adding services

There are 2 ways to add services to the system so they are available.

  • Make OTSystem be the root object in the otml file, and add an OTObject which implements OTBundle in the bundles property of the OTSystem. There is also a deprecated services property in the OTSystem object. If you are making new otml files use bundles instead of services.
  • When creating the OTrunkImpl object, an array of Objects and array of Classes can be passed which are then added to the service map.

Creating a new service

The best way to add a new service at this time is to make a new class that extends DefaultOTObject and implements OTBundle. Well call this a new bundle. The new bundle should create and add the services it provides during the registerServices call.

Current service usage

OTrunk Services being used:

  • OTViewFactory - this is provided by the OTViewService bundle
    • OTViewer
    • OTViewerHelper
    • PfViewPrinter
    • OTReportViewer
  • SensorDataManager - this is provided by the OTInterfaceManager bundle
    • OTLoggerImporter
    • OTLoggerRecordChooser
    • OTSensorDataProxy
    • OTSeuptLogger
  • OTScriptManager - this is provided by the OTScriptEngineBundle
    • OTScriptButtonView
    • OTScriptObjectView
  • UserMessageHandler - this added through the OTrunkImpl constructor
    • OTInterfaceManager - this is the class implementing SensorDataManager
  • OTSharingManager - this is provided by the OTSharingBundle
Document generated by Confluence on Jan 27, 2014 16:52