Non-mobile objects connect to the Event Manager by instantiating an EventMangerConnection object and calling its makeConnection method. This method takes a boolean argument which specifies if a proxy should be used to communicate with the Event Manager. (Proxy functionality is not available in the Freeware version of Concordia.)
Objects interested in receiving distributed events must inform the Event Manager of their interest. This is accomplished by invoking the EventManagerConnection's registerEvents method and passing it an array of Class objects representing the types of events they wish to receive (i.e., class objects for events derived from EventType) and an EventPost implementation (i.e., either EventNotifyImpl or EventQueueImpl). Note that the classes which define the events being registered with the Event Manager must be available to the Event Manager at the time that registerEvents is called. Therefore, those classes must be accessible via the CLASSPATH of the local Concordia Server.
It is also possible to register to receive all events sent to an Event Manager by invoking the EventManagerConnection's registerAll method and passing it an EventPost implementation.
Objects may dynamically add new event registrations by simply invoking registerEvents at any time. However, an object may also indicate to the Event Manager that it is no longer interested in receiving certain types of events by calling the EventManagerConnection's unregisterEvents method and passing the EventPost implementation it used when it registered for the event and an array of Class objects representing the events it is no longer interested in receiving.
Alternatively, objects may delete all their registrations by invoking the EventManagerConnection's unregisterAll method and passing it their EventPost implementation.
Objects send events to other objects via the EventManagerConnection's postEvent method. This method takes an object derived from EventType as an argument. The EventManagerConnection object sends the specified event to the Event Manager, which forwards it to all objects that have registered to receive events of that type.
Next we will illustrate how the DBAccessProgram can use events.