Gerald Brose
August 2003

This is a simple hello world style demo for the Notification Service
which just serves to show that it was built and set up correctly.
It was taken from Brose et al., "Java Proramming with CORBA", 3d ed,
and modified so that no mapping filters are used.

To build the example, simply type "ant". To run it, make sure that
both the Naming Service and the Notification Service are running. If 
you start the Notification Service like this:

         ntfy -writeIOR c:\NTS_Ref

then your jacorb.properties file should contain a line like this, 

        ORBInitRef.NotificationService=file:/c:/NTS_Ref

if the service is running on a machine where you have access to
the IOR file. Then start the demo server like this:

        jaco demo.notification.office.PrintServer

The client is started like this:

        jaco demo.notification.office.PrintClient


Here's the output of one run of the program, first the server:


"Channel 4 created and bound to name office_event.channel.
Printer created and connected
Printer exported
--Printing Job # 0 --
A test job
--END JOB---
--CANCELLED JOB #4--
--Printing Job # 1 --
A test job
--END JOB---
--Printing Job # 2 --
A test job
--END JOB---
--Printing Job # 3 --
A test job
--END JOB---"

and now the client:

"Sending job, ID #0
Sending job, ID #1
Sending job, ID #2
Sending job, ID #3
Sending job, ID #4
Sleep...
Cancelling job ID #4
Looking for structured events....
got structured event.
        Office.Printed#0
        job_id : 0
        user_id : MeMyselfAndI
Looking for structured events....
got structured event.
        Office.Canceled#1
        job_id  : 4
        user_id  : MeMyselfAndI
Looking for structured events....
got structured event.
        Office.Printed#2
        job_id : 1
        user_id : MeMyselfAndI
Looking for structured events....
got structured event.
        Office.Printed#3
        job_id : 2
        user_id : MeMyselfAndI
Looking for structured events....
Disconnected!"

