public synchronized <T extends BaseListener>void doSubscription(final Set<Long> tagIds,final T listener){
  if (tagIds == null) {
    String error="Called with null parameter (id collection). Ignoring request.";
    log.warn("doSubscription() : " + error);
    throw new IllegalArgumentException(error);
  }
  if (listener == null) {
    String error="Called with null parameter (BaseTagListener). Ignoring request.";
    log.warn("doSubscription() : " + error);
    throw new IllegalArgumentException(error);
  }
  if (tagIds.isEmpty()) {
    String info="Called with empty tag id list. Ignoring request.";
    log.info("doSubscription() : " + info);
    return;
  }
  if (log.isDebugEnabled()) {
    log.debug(String.format("doSubscription() : called for %d tags.",tagIds.size()));
  }
  try {
    cache.subscribe(tagIds,listener);
    tagUpdateListeners.add(listener);
  }
 catch (  CacheSynchronizationException cse) {
    log.error("doSubscription() : Cache error occured while subscribing to data tags ==> Rolling back subscription.",cse);
    cache.unsubscribeDataTags(tagIds,listener);
    throw cse;
  }
}

public synchronized < T extends BaseListener > void doSubscription ( final Set < Long > tagIds , final T listener ) { if ( tagIds == null ) { String error = "Called with null parameter (id collection). Ignoring request." ; log . warn ( "doSubscription() : " + error ) ; throw new IllegalArgumentException ( error ) ; } if ( listener == null ) { String error = "Called with null parameter (BaseTagListener). Ignoring request." ; log . warn ( "doSubscription() : " + error ) ; throw new IllegalArgumentException ( error ) ; } if ( tagIds . isEmpty ( ) ) { String info = "Called with empty tag id list. Ignoring request." ; log . info ( "doSubscription() : " + info ) ; return ; } if ( log . isDebugEnabled ( ) ) { log . debug ( String . format ( "doSubscription() : called for %d tags." , tagIds . size ( ) ) ) ; } try { cache . subscribe ( tagIds , listener ) ; tagUpdateListeners . add ( listener ) ; } catch ( CacheSynchronizationException cse ) { log . error ( "doSubscription() : Cache error occured while subscribing to data tags ==> Rolling back subscription." , cse ) ; cache . unsubscribeDataTags ( tagIds , listener ) ; throw cse ; } }
inner method that handles the tag subscription .
