private final JSRemoteConsumerPoint findOrCreateJSRemoteConsumerPoint(String[] discriminators, int[] selectorDomains,
                                                        String[] selectors)
    throws ClosedException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "findOrCreateJSRemoteConsumerPoint",
          new Object[]{Arrays.toString(discriminators),
                       Arrays.toString(selectorDomains),
                       Arrays.toString(selectors)});

    String selectionCriteriasAsString = parent.convertSelectionCriteriasToString(
                                                  discriminators, selectorDomains, selectors);

    JSRemoteConsumerPoint aock = (JSRemoteConsumerPoint) consumerKeyTable.get(selectionCriteriasAsString);
    if (aock == null)
    {
      try
      {
        // create an JSRemoteConsumerPoint
        aock = new JSRemoteConsumerPoint();
        SelectionCriteria[] criterias = new SelectionCriteria[discriminators.length];
        ConsumableKey[] consumerKeys = new ConsumableKey[discriminators.length];
        OrderingContextImpl ocontext = null;
        SIBUuid12 connectionUuid = new SIBUuid12();

        if (discriminators.length > 1)
          ocontext = new OrderingContextImpl(); // create a new ordering context
        for (int i=0; i < discriminators.length; i++)
        {
          SelectorDomain domain = SelectorDomain.getSelectorDomain(selectorDomains[i]);
          criterias[i] = parent.createSelectionCriteria(discriminators[i], selectors[i], domain);

          // attach as many times as necessary
          consumerKeys[i] =
            (ConsumableKey) consumerDispatcher.attachConsumerPoint(
              aock,
              criterias[i],
              connectionUuid,
              false,
              false,
              null);

          if (ocontext != null)
            consumerDispatcher.joinKeyGroup(consumerKeys[i], ocontext);

          consumerKeys[i].start(); // in case we use a ConsumerKeyGroup, this is essential

        }

        if (parent.getCardinalityOne() || consumerDispatcher.isPubSub())
        {
          // effectively infinite timeout, since don't want to close the ConsumerKey if RME is inactive for
          // a while. Only close this ConsumerKey when start flushing this stream.
          // NOTE shared durable subs might not be cardinality one but we still do not want the streams
          // to flush on timeout
          //
          // Defect 516583, set the idleTimeout parameter to 0, not to Long.MAX_VALUE in order to have an
          // "infinite timeout".
          aock.init(this, selectionCriteriasAsString, consumerKeys, 0, am, criterias);
        }
        else
        {
          aock.init(
            this,
            selectionCriteriasAsString,
            consumerKeys,
            mp.getCustomProperties().get_ck_idle_timeout(),
            am,
            criterias);
        }
        consumerKeyTable.put(selectionCriteriasAsString, aock);
      }
      catch (Exception e)
      {
        // should not occur!
        FFDCFilter.processException(
          e,
          "com.ibm.ws.sib.processor.impl.AOStream.findOrCreateJSRemoteConsumerPoint",
          "1:2942:1.80.3.24",
          this);
        SibTr.exception(tc, e);

        aock = null;
        ClosedException e2 = new ClosedException(e.getMessage());
        // just using the ClosedException as a convenience
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "findOrCreateJSRemoteConsumerPoint", e2);

        throw e2;
      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "findOrCreateJSRemoteConsumerPoint", aock);

    return aock;
  }
private final JSRemoteConsumerPoint findOrCreateJSRemoteConsumerPoint ( String [ ] discriminators , int [ ] selectorDomains , String [ ] selectors ) throws ClosedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "findOrCreateJSRemoteConsumerPoint" , new Object [ ] { Arrays . toString ( discriminators ) , Arrays . toString ( selectorDomains ) , Arrays . toString ( selectors ) } ) ; String selectionCriteriasAsString = parent . convertSelectionCriteriasToString ( discriminators , selectorDomains , selectors ) ; JSRemoteConsumerPoint aock = ( JSRemoteConsumerPoint ) consumerKeyTable . get ( selectionCriteriasAsString ) ; if ( aock == null ) { try { aock = new JSRemoteConsumerPoint ( ) ; SelectionCriteria [ ] criterias = new SelectionCriteria [ discriminators . length ] ; ConsumableKey [ ] consumerKeys = new ConsumableKey [ discriminators . length ] ; OrderingContextImpl ocontext = null ; SIBUuid12 connectionUuid = new SIBUuid12 ( ) ; if ( discriminators . length > 1 ) ocontext = new OrderingContextImpl ( ) ; for ( int i = 0 ; i < discriminators . length ; i ++ ) { SelectorDomain domain = SelectorDomain . getSelectorDomain ( selectorDomains [ i ] ) ; criterias [ i ] = parent . createSelectionCriteria ( discriminators [ i ] , selectors [ i ] , domain ) ; consumerKeys [ i ] = ( ConsumableKey ) consumerDispatcher . attachConsumerPoint ( aock , criterias [ i ] , connectionUuid , false , false , null ) ; if ( ocontext != null ) consumerDispatcher . joinKeyGroup ( consumerKeys [ i ] , ocontext ) ; consumerKeys [ i ] . start ( ) ; } if ( parent . getCardinalityOne ( ) || consumerDispatcher . isPubSub ( ) ) { aock . init ( this , selectionCriteriasAsString , consumerKeys , 0 , am , criterias ) ; } else { aock . init ( this , selectionCriteriasAsString , consumerKeys , mp . getCustomProperties ( ) . get_ck_idle_timeout ( ) , am , criterias ) ; } consumerKeyTable . put ( selectionCriteriasAsString , aock ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.AOStream.findOrCreateJSRemoteConsumerPoint" , "1:2942:1.80.3.24" , this ) ; SibTr . exception ( tc , e ) ; aock = null ; ClosedException e2 = new ClosedException ( e . getMessage ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "findOrCreateJSRemoteConsumerPoint" , e2 ) ; throw e2 ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "findOrCreateJSRemoteConsumerPoint" , aock ) ; return aock ; }
Helper method.
Called from withing a synchronized (this) block.
@param discriminators
@param selectorDomains
@param selectors
@return