Chair for Computer Aided Medical Procedures & Augmented Reality
Lehrstuhl für Informatikanwendungen in der Medizin & Augmented Reality

THIS WEBPAGE IS DEPRECATED - please visit our new website

Java Coding Tutorial

Write a Service from scratch

  1. Decide which CORBA interface out of dwarf/idl/DWARF/Service.idl is the most suitable (e.g. PickyService)
  2. Open a new directory for the service (see DwarfCVSStructureTutorial)
  3. Write your class implementing the startService and stopService methods. These must register a handler object for all needs and abilities (e.g. SvcProtPushSupplier,see Communication Interfaces (Protocols) on page DwarfDocumentation)

Write a Service using the TemplateService (recommended)

For implementing a Service by use of the TemplateService do the following: Use Eclispe or pure shell tools

In case of Eclipse do the following:

  1. Open a new directory for the service (see DwarfCVSStructureTutorial)
  2. Open a corresponding project in Eclipse
  3. Create a new class in this project by extending from the TemplateService to generate your own service class. Name this class &

In case of Pure shell:

  1. Go to the directory dwarf/src/templates/javaservice and read the README file first.
  2. Execute the create_files.sh script. You will be asked for serveral informations, that will be inserted in the generated Service's files.
  3. Move the generated directory to dwarf/src/services

In Both cases do finally:

  1. Override the generated method bodies in the only class you find. In the two create[Ability|Need]Object methods must return instances that inherit from the corresponding interface of the [Ability|Need]Description, e.g. SvcProtPushSupplier (see Communication Interfaces (Protocols) on page DwarfDocumentation). The last line of the method must be return <YOUR_OBJECT>._this(orb); in order to return a valid CORBA object.
  2. Let the thread in the runThread die if you need no extra executions (like reading from a Socket connection)
  3. now see the DwarfIntegrationTutorial for further steps

Write a Service using the BaseService

This is currently under development.

-- MarcusToennis - 04 Jan 2006

Edit | Attach | Refresh | Diffs | More | Revision r1.9 - 05 Jan 2006 - 15:56 - MarcusToennis

Lehrstuhl für Computer Aided Medical Procedures & Augmented Reality    rss.gif