TopicConnection connection
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
_subscriber.subscribe(connection);
void didConnect(TopicConnection connection)
TopicConnection connection
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
_subscriber.unsubscribe();
void didDisconnect(TopicConnection connection)
NSNotification notification
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
_publisher.publishChange(notification);
void publishChange(NSNotification notification)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
if (_configuration == null)
            _configuration = ERCNConfiguration.getInstance();
        return _configuration;
ERCNConfiguration configuration()
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
return ERCNSubscriber.delegate();
ERCNSubscriberDelegate subscriberDelegate()
ERCNSubscriberDelegate delegate
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
ERCNSubscriber.setDelegate(delegate);
void setSubscriberDelegate(ERCNSubscriberDelegate delegate)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
return _connectionKeeper.topic();
Topic topic()
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
return _connectionKeeper.connection();
TopicConnection connection()
NSNotification notification
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNPublisher.java
if (! _coordinator.isConnected())  return;

        ERCNSnapshot snapshot = new ERCNSnapshot(notification);

        if (snapshot.shouldPostChange()) {
            final int deliveryMode = DeliveryMode.NON_PERSISTENT;
            final int priority = 4; // 0:Low -- 9:High
            // set TTL to 63 minutes; little longer than the default
            // value of ec.defaultFetchTimestampLag()
            final long timeToLive = 63 * 60 * 1000;
				TopicSession topicSession = _topicSession();
				if (topicSession != null) {
					ObjectMessage message = topicSession.createObjectMessage(snapshot);
                    Topic topic = _coordinator.topic();
					_topicPublisher(topic, topicSession).publish(topic, message, deliveryMode, priority, timeToLive);
					if (NSLog.debug.isEnabled())
						NSLog.debug.appendln(ERCNNotificationCoordinator.LOG_HEADER
                                + "Posted a message with snapshot: " + snapshot);
void publishChange(NSNotification notification)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNPublisher.java
TopicSession topicSession = null;
        try {
            TopicConnection connection = _coordinator.connection();
            topicSession = connection.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
TopicSession _topicSession()
Topic topic  TopicSession topicSession
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNPublisher.java
TopicPublisher topicPublisher = null;
        try {
            topicPublisher = topicSession.createPublisher(topic);
TopicPublisher _topicPublisher(Topic topic, TopicSession topicSession)
String operation
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSnapshot.java
ERCNConfiguration configuration = ERCNNotificationCoordinator.coordinator().configuration();
        return configuration.changeTypesToSubscrive().containsObject(operation);
    public static boolean shouldSynchronizeEntity(String entityName) {
        ERCNConfiguration configuration = ERCNNotificationCoordinator.coordinator().configuration();
        return ! configuration.entitiesNotToSynchronize().containsObject(entityName);
                NSDictionary snapshot = dbContext.snapshotForGlobalID(globalID);
                if (snapshot != null) {
                    snapshotsForEntity.addObject(snapshot);
                    _entryCount++;
boolean shouldApplyChangeFor(String operation)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
return _delegate; 
    static void setDelegate(ERCNSubscriberDelegate delegate) {
        _delegate = delegate;
ERCNSubscriberDelegate delegate()
TopicConnection connection
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
_topicSession = connection.createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
            NSLog.err.appendln(ERCNNotificationCoordinator.LOG_HEADER
                    + "Failed to create a JMS topic session: " + ex.getMessage());

        final String selector = null;
        final boolean noLocal = true;
            if (_coordinator.configuration().isSubscriberDurable()) {
                _topicSubscriber = _topicSession.createDurableSubscriber(_coordinator.topic(),
            NSLog.err.appendln(ERCNNotificationCoordinator.LOG_HEADER
                    + "An exception occured: " + ex.getMessage());
        try {
            _topicSubscriber.setMessageListener(this);
void subscribe(TopicConnection connection)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
try {
            if (_coordinator.configuration().isSubscriberDurable()) {
                _topicSession.unsubscribe(_coordinator.id());
void unsubscribe()
ERCNSnapshot ercnSnapshot
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
if (_delegate != null)
            _delegate.processInsertions(ercnSnapshot);
void _processInsertions(ERCNSnapshot ercnSnapshot)
ERCNSnapshot ercnSnapshot
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
if (_delegate != null)
            _delegate.processDeletions(ercnSnapshot);
    private void _processUpdates(ERCNSnapshot ercnSnapshot) {
        if (_delegate != null) {
            boolean isProcessed = _delegate.processUpdates(ercnSnapshot);
            if (isProcessed)
                return;
void _processDeletions(ERCNSnapshot ercnSnapshot)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
return _entitiesNotToSynchronize;
NSArray entitiesNotToSynchronize()
NSArray newEntitiesNotToSynchronize
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
if (newEntitiesNotToSynchronize != null) 
            _entitiesNotToSynchronize = newEntitiesNotToSynchronize;
        else 
            _entitiesNotToSynchronize = NSArray.EmptyArray;
void setEntitiesNotToSynchronize(NSArray newEntitiesNotToSynchronize)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
return _changeTypesToTrack;
NSArray changeTypesToTrack()
NSArray newChangeTypesToTrack
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
if (newChangeTypesToTrack != null) 
            _changeTypesToTrack = newChangeTypesToTrack;
        else 
            _changeTypesToTrack = NSArray.EmptyArray;
void setChangeTypesToTrack(NSArray newChangeTypesToTrack)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
return _topic;
Topic topic()
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNNotificationCoordinator.java
return _connection;
TopicConnection connection()
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNPublisher.java
super();
private ERCNPublisher()
ERCNNotificationCoordinator coordinator
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNPublisher.java
super();
    private TopicSession _topicSession() {
        TopicSession topicSession = (TopicSession)_topicSessionCollection.get();
        if (topicSession == null) {
                topicSession = _coordinator.connection().createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
                _topicSessionCollection.set(topicSession);
                NSLog.err.appendln("An exception occured: " + ex.getClass().getName() + " - " + ex.getMessage());
                ex.printStackTrace();
        return topicSession;
    private TopicPublisher _topicPublisher() {
        TopicPublisher topicPublisher = (TopicPublisher)_topicPublisherCollection.get();
        if (topicPublisher == null) {
            try {
                topicPublisher = _topicSession().createPublisher(_coordinator.topic());
                _topicPublisherCollection.set(topicPublisher);
public ERCNPublisher(ERCNNotificationCoordinator coordinator)
NSNotification notification
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNPublisher.java
ERCNSnapshot snapshot = new ERCNSnapshot(notification);

        if (snapshot.shouldPostChange()) {
            final int deliveryMode = DeliveryMode.PERSISTENT;
            final int priority = 4; // 0:Low -- 9:High  
            // set TTL to 63 minutes; little longer than the default  
            // value of ec.defaultFetchTimestampLag()
            final long timeToLive = 63 * 60 * 1000; 
            try {
                ObjectMessage message = _topicSession().createObjectMessage(snapshot);
                _topicPublisher().publish(_coordinator.topic(), message, deliveryMode, priority, timeToLive);
                if (NSLog.debug.isEnabled())
                    NSLog.debug.appendln("Posted a message with snapshot: " + snapshot);
void publishChange(NSNotification notification)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
super();
    public ERCNSubscriber(ERCNNotificationCoordinator coordinator, boolean isDurable) {
        super();
        _coordinator = coordinator;
        _isDurable = isDurable;
            _topicSession = _coordinator.connection().createTopicSession(false, Session.CLIENT_ACKNOWLEDGE);
            NSLog.err.appendln("An exception occured: " + ex.getClass().getName() + " - " + ex.getMessage());
            ex.printStackTrace();
        String selector = null;
        boolean noLocal = true;
            if (_isDurable) {
                _topicSubscriber = _topicSession.createDurableSubscriber(_coordinator.topic(), 
            NSLog.err.appendln("An exception occured: " + ex.getClass().getName() + " - " + ex.getMessage());
            ex.printStackTrace();
private ERCNSubscriber()
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
return _delegate;
NSKeyValueCoding delegate()
NSKeyValueCoding newDelegate
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
_delegate = newDelegate;
void setDelegate(NSKeyValueCoding newDelegate)
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
return _topicSubscriber;
                NSLog.debug.appendln("Received a message with snapshot: " + snapshot);
            processInsertions(snapshot.shapshotsForInsertionGroupedByEntity());
            processDeletions(snapshot.globalIDsForDeletionGroupedByEntity());
            processUpdates(snapshot.shapshotsForUpdateGroupedByEntity());
            NSLog.debug.appendln("Finished processing changes.");
            NSLog.err.appendln("An exception occured: " + ex.getClass().getName() + " - " + ex.getMessage());
                NSLog.err.appendln("An exception occured: " + ex.getClass().getName() + " - " + ex.getMessage());
    public void processInsertions(NSDictionary insertions) {
        if (delegate() != null) {
            delegate().takeValueForKey(insertions, "processInsertions");
    
    public void processDeletions(NSDictionary deletions) { 
        if (delegate() != null) {
            delegate().takeValueForKey(deletions, "processDeletions");
TopicSubscriber topicSubscriber()
NSDictionary updatedEntDict
Common/Frameworks/ERChangeNotificationJMS/Sources/er/changenotification/ERCNSubscriber.java
NSArray entityNames = updatedEntDict.allKeys();
        
            NSArray snapshots = (NSArray)updatedEntDict.objectForKey(entityName);
                    NSLog.debug.appendln("snapshot: " + snapshot);
    //            when it's requested to terminate. Should wait *here* for the last 
    //            notification to finish, then return so that the coordinator can safely 
    //            close the connection to the JMS server.  
    public synchronized void terminate() {
        try {
            if (_isDurable) {
                _topicSession.unsubscribe(_coordinator.id());
void processUpdates(NSDictionary updatedEntDict)