@Override
	public void registerConsumer(LocalMessageConsumer consumer)
    {
        super.registerConsumer(consumer);
        
        subscriptionsLock.writeLock().lock();
        try
		{
        	LocalTopicSubscription subscription = subscriptionMap.remove(consumer.getSubscriberId());
        	if (subscription == null)
        	{
        		// New subscription
        		storeNewSubscription(consumer);
        	}
        	else
        	{
        		// Remove old subscription
        		removeSubscription(subscription);
        		// Replace by new subscription
        		storeNewSubscription(consumer);
        	}
		}
        finally
        {
        	subscriptionsLock.writeLock().unlock();
        }
    }
@ Override public void registerConsumer ( LocalMessageConsumer consumer ) { super . registerConsumer ( consumer ) ; subscriptionsLock . writeLock ( ) . lock ( ) ; try { LocalTopicSubscription subscription = subscriptionMap . remove ( consumer . getSubscriberId ( ) ) ; if ( subscription == null ) { storeNewSubscription ( consumer ) ; } else { removeSubscription ( subscription ) ; storeNewSubscription ( consumer ) ; } } finally { subscriptionsLock . writeLock ( ) . unlock ( ) ; } }
/* (non-Javadoc)
@see net.timewalker.ffmq4.local.destination.AbstractLocalDestination#registerConsumer(net.timewalker.ffmq4.local.session.LocalMessageConsumer)