public ConsumerDispatcher createSubscriptionConsumerDispatcher ( ConsumerDispatcherState subState ) throws SIDiscriminatorSyntaxException , SISelectorSyntaxException , SIResourceException , SISelectorSyntaxException , SIDiscriminatorSyntaxException , SINonDurableSubscriptionMismatchException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createSubscriptionConsumerDispatcher" , subState ) ; ConsumerDispatcher cd = null ; boolean isNewCDcreated = false ; if ( subState . getSubscriberID ( ) == null ) { //this is non-durable non shared scenario. i.e subscriber id is null. Then go ahead and create //consumer dispatcher and subscription item stream. cd = createSubscriptionItemStreamAndConsumerDispatcher ( subState , false ) ; } else { //this is non-durable shared scenario. //Check whether already subscriber present or not in hashamp cd = ( ConsumerDispatcher ) _destinationManager . getNondurableSharedSubscriptions ( ) . get ( subState . getSubscriberID ( ) ) ; if ( cd == null ) { //consumer dispatcher is null.. means this is first consumer trying to create subscriber. //Go ahead and create consumer dispatcher and Subscription item stream. //we do not need to check for any flags like cloned because the call is from JMS2.0 explicitly //asking for subscriber to be shared. //_consumerDispatchersNonDurable is needed as the subscription creation has to be atomic synchronized ( _destinationManager . getNondurableSharedSubscriptions ( ) ) { // this lock is too high level.. has to be further granularized. //again try to get cd for a given consumer as another thread might have created it first i.e got lock first after cd=null cd = ( ConsumerDispatcher ) _destinationManager . getNondurableSharedSubscriptions ( ) . get ( subState . getSubscriberID ( ) ) ; if ( cd == null ) { cd = createSubscriptionItemStreamAndConsumerDispatcher ( subState , true ) ; isNewCDcreated = true ; } } } } //check whether this is non-durable shared consumer and CD is prior created by //another consumer.. this consumer supposed to reuse it. if ( ! isNewCDcreated && ( subState . getSubscriberID ( ) != null ) ) { //check whether it is same topic and having topic selectors. if ( ! cd . getConsumerDispatcherState ( ) . equals ( subState ) ) { // Found consumer dispatcher but only the IDs match, therefore cannot connect if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createSubscriptionConsumerDispatcher" , subState ) ; throw new SINonDurableSubscriptionMismatchException ( nls . getFormattedMessage ( "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143" , new Object [ ] { subState . getSubscriberID ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createSubscriptionConsumerDispatcher" , cd ) ; return cd ; }
however nobody is calling this thru AbstractAliasDestinationHandler in Liberty .