Project Wonder 2.0

er.changenotification
Class ERCNNotificationCoordinator

java.lang.Object
  extended byer.changenotification.ERCNNotificationCoordinator

public class ERCNNotificationCoordinator
extends Object

ERCNNotificationCoordinator is the primary controller of the change notification for enterprise objects. It manages the single connection to the JMS server, and creates ERCNPublisher and ERCNSubscriber objects and registers them as the observers to handle change notifications.

When the application finishes launching, it checks properties and initializes the framework. It can also perform necessary clean-up operations when the application is about to terminate.

The framework works transparently and you will not have to call any methods on the framework. Just add this framework to application project as an external framework and put necessary properties to your property file.

The current implementation supports concurrent request handling (multi threaded operations.) It only supports the changes in the default EOObjectStoreCoordinator.

Properties:
Put the following properties into WebObjects.properties file under your home directory, or into Properties file and register it under the applications project's Resources group.

 
 # The host name that the JMS server is running on
 er.changenotification.jms.serverHostName = localhost
 
 # Entities *not* to synchronize
 #er.changenotification.entitiesNotToSynchronize = (TalentPhoto)
 er.changenotification.entitiesNotToSynchronize = ()
 
 # Change types to track; Can contain inserted, updated and deleted. 
 er.changenotification.changeTypesToTrack = (inserted, updated, deleted)
 
 # JMS topic name (Destination object) to pass the notifications. 
 # Specify one and register it from the OpenJMS administration tool or 
 # configuration file. 
 er.changenotification.jms.topicName = business logic group 1
 
 # Whether or not the JMS subscriber is durable; 
 # prevents to miss change notifications by temporaly 
 # network disruptions. 
 # 
 # false - suggested for both development and deployment
 #
 #         Please do *not* set it true, otherwise OpenJMS 0.7.3.1 server 
 #         will fail with some databases (PostgreSQL, FrontBase, etc.)
 # 
 # If it's set to true, you need properly to shut down the applications 
 # (e.g. shut down it from JavaMonitor or calling application's 
 # terminate() method), otherwise JMS provider will try to keep  
 # all changes even after application is shut down. 
 #
 er.changenotification.jms.durableSubscribers = false
 
 


Method Summary
 ERCNConfiguration configuration()
           
static ERCNNotificationCoordinator coordinator()
           
static EODatabaseContext databaseContextForEntityNamed(String entityName, EOEditingContext editingContext)
           
 void finalize()
           
protected  String id()
           
 void initialize(NSNotification notification)
           
 boolean isConnected()
           
 void publishChange(NSNotification notification)
           
 void setSubscriberDelegate(ERCNSubscriberDelegate delegate)
           
 ERCNSubscriberDelegate subscriberDelegate()
           
 void terminate()
          releases JMS resouces, including closing the connection.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

coordinator

public static ERCNNotificationCoordinator coordinator()

id

protected String id()

initialize

public void initialize(NSNotification notification)

terminate

public void terminate()
releases JMS resouces, including closing the connection.

This method is supposed to be called by the applicaiton's terminate method.


finalize

public void finalize()
              throws Throwable
Throws:
Throwable

publishChange

public void publishChange(NSNotification notification)

configuration

public ERCNConfiguration configuration()

subscriberDelegate

public ERCNSubscriberDelegate subscriberDelegate()

setSubscriberDelegate

public void setSubscriberDelegate(ERCNSubscriberDelegate delegate)

isConnected

public boolean isConnected()

databaseContextForEntityNamed

public static EODatabaseContext databaseContextForEntityNamed(String entityName,
                                                              EOEditingContext editingContext)

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.