Multiple {@link PipelineRoutedStore} share the same
{@link PipelineRoutedStats} object IF Mbean is not registered, the first
caller will register it. All callers increment the counter.
328374
public synchronized void registerJmxIfRequired() {
        referenceCount++;
        if(isRegistered == false) {
            String domain = JmxUtils.getPackageName(this.getClass());
            this.jmxObjectName = JmxUtils.createObjectName(domain, this.name);
            JmxUtils.registerMbean(this, this.jmxObjectName);
            isRegistered = true;
        }
    }
8251
public boolean duplicatesInStack(LinkedList<SchemaTableTree> distinctQueryStack) {
        Set<SchemaTable> alreadyVisited = new HashSet<>();
        for (SchemaTableTree schemaTableTree : distinctQueryStack) {
            if (!alreadyVisited.contains(schemaTableTree.getSchemaTable())) {
                alreadyVisited.add(schemaTableTree.getSchemaTable());
            } else {
                return true;
            }
        }
        return false;
    }
211828
@Override
    public void registerFactories(ChannelFactoryProvider provider) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Register factory provider; " + provider.getClass().getName());
        }
        synchronized (this.factories) {
            for (Entry<String, Class<? extends ChannelFactory>> entry : provider.getTypes().entrySet()) {
                this.providers.put(entry.getKey(), provider);
                Class<? extends ChannelFactory> newFactory = entry.getValue();
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                    Class<? extends ChannelFactory> prevFactory = this.factories.get(entry.getKey());
                    if (null != prevFactory && newFactory != prevFactory) {
                        Tr.event(tc, "WARNING: overlaying existing factory: " + prevFactory);
                    }
                }
                this.factories.put(entry.getKey(), newFactory);
            }
        } // end-sync

        // now that we have a new factory type, tell ChannelUtils to process
        // any delayed config that might be waiting for it
        ChannelUtils.loadConfig(null);
    }
505017
@Override
	public void resetStats()
    {
    	super.resetStats();
    	sentToQueueCount.set(0);
    	receivedFromQueueCount.set(0);
    	acknowledgedGetCount.set(0);
    	rollbackedGetCount.set(0);
    	expiredCount.set(0);
    }
1029476
private void addConsumerToRegisteredMonitorMap(
    MonitoredConsumer mc,
    ArrayList monitorList,
    Map registeredMonitors)
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(
          tc,
          "addConsumerToRegisteredMonitorMap",
          new Object[] { registeredMonitors,
                         mc,
                         monitorList });
    // Finally, add this consumer to the appropriate places in the registered
    // consumer monitors tables
    Iterator i = monitorList.iterator();
    while (i.hasNext())
    {
      String tExpr = (String)i.next();

      // Get the next monitor
      RegisteredCallbacks rMonitor = (RegisteredCallbacks)registeredMonitors.get(tExpr);

      // Retrieve the current list of consumers
      ArrayList matchingConsumerList = rMonitor.getMatchingConsumers();

      // There is no need to drive any callbacks as we are placing subscriptions
      // in the registrations table that correspond to existing subscriptions.
      // So simply add the new subscription to the list.
      matchingConsumerList.add(mc);
    }

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

  }
1093395
function mw(store) {
    if (savedStore && savedStore !== store) {
      throw new Error('cannot assign logicMiddleware instance to multiple stores, create separate instance for each');
    }
    savedStore = store;

    return next => {
      savedNext = next;
      const { action$, sub, logicCount: cnt } =
            applyLogic(arrLogic, savedStore, savedNext,
                       logicSub, actionSrc$, deps, logicCount,
                       monitor$);
      actionEnd$ = action$;
      logicSub = sub;
      logicCount = cnt;

      return action => {
        debug('starting off', action);
        monitor$.next({ action, op: 'top' });
        actionSrc$.next(action);
        return action;
      };
    };
  }
414225
public void addMultipleCounterDataPoints(String tenantId, List<MetricLongBean> data) {
        try {
            URL endpoint = serverUrl.toURI().resolve("counters/raw").toURL(); //$NON-NLS-1$
            Request request = new Request.Builder()
                    .url(endpoint)
                    .post(toBody(data))
                    .header("Hawkular-Tenant", tenantId) //$NON-NLS-1$
                    .build();
            Response response = httpClient.newCall(request).execute();
            if (response.code() >= 400) {
                throw hawkularMetricsError(response);
            }
        } catch (URISyntaxException | IOException e) {
            throw new RuntimeException(e);
        }
    }
994475
@Override
    public void setTraceRouter(WsTraceRouter traceRouter) {

        internalTraceRouter.set(traceRouter);

        // Pass the earlierMessages queue to the router.
        // Now that the internalMessageRouter is non-null, this class will
        // NOT add any more messages to the earlierMessages queue.
        // The MessageRouter basically owns the earlierMessages queue
        // from now on.
        if (earlierTraces != null) {
            synchronized (this) {
                if (earlierTraces != null) {
                    traceRouter.setEarlierTraces(earlierTraces);
                }
            }
        } else {
            traceRouter.setEarlierTraces(null);
        }
    }
559488
private void populateLockStatus(PipelineInstanceModel instanceModel, boolean isLockable, boolean isCurrentlyLocked, boolean canBeUnlocked) {
        instanceModel.setIsLockable(isLockable);
        instanceModel.setCurrentlyLocked(isCurrentlyLocked);
        instanceModel.setCanUnlock(canBeUnlocked);
    }
69963
protected void registerMultifactorProviderAuthenticationWebflow(final Flow flow, final String subflowId,
                                                                    final FlowDefinitionRegistry mfaProviderFlowRegistry,
                                                                    final String providerId) {
        if (!mfaProviderFlowRegistry.containsFlowDefinition(subflowId)) {
            LOGGER.warn("Could not locate flow id [{}]", subflowId);
            return;
        }
        val mfaFlow = (Flow) mfaProviderFlowRegistry.getFlowDefinition(subflowId);
        mfaFlow.getStartActionList().add(createSetAction("flowScope.".concat(CasWebflowConstants.VAR_ID_MFA_PROVIDER_ID), StringUtils.quote(providerId)));

        val initStartState = (ActionState) mfaFlow.getStartState();
        val transition = (Transition) initStartState.getTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS);
        val targetStateId = transition.getTargetStateId();
        transition.setTargetStateResolver(new DefaultTargetStateResolver(CasWebflowConstants.STATE_ID_MFA_CHECK_BYPASS));

        val bypassAction = createActionState(mfaFlow, CasWebflowConstants.STATE_ID_MFA_CHECK_BYPASS, createEvaluateAction(MFA_CHECK_BYPASS_BEAN_ID));
        createTransitionForState(bypassAction, CasWebflowConstants.TRANSITION_ID_NO, CasWebflowConstants.STATE_ID_MFA_CHECK_AVAILABLE);
        createTransitionForState(bypassAction, CasWebflowConstants.TRANSITION_ID_YES, CasWebflowConstants.TRANSITION_ID_SUCCESS);

        val availableAction = createActionState(mfaFlow, CasWebflowConstants.STATE_ID_MFA_CHECK_AVAILABLE, createEvaluateAction(MFA_CHECK_AVAILABLE_BEAN_ID));
        if (mfaFlow.containsState(CasWebflowConstants.STATE_ID_MFA_PRE_AUTH)) {
            createTransitionForState(availableAction, CasWebflowConstants.TRANSITION_ID_YES, CasWebflowConstants.STATE_ID_MFA_PRE_AUTH);
        } else {
            createTransitionForState(availableAction, CasWebflowConstants.TRANSITION_ID_YES, targetStateId);
        }
        createTransitionForState(availableAction, CasWebflowConstants.TRANSITION_ID_NO, CasWebflowConstants.TRANSITION_ID_MFA_FAILURE);

        val failureAction = createActionState(mfaFlow, CasWebflowConstants.TRANSITION_ID_MFA_FAILURE, createEvaluateAction(MFA_CHECK_FAILURE_BEAN_ID));
        createTransitionForState(failureAction, CasWebflowConstants.TRANSITION_ID_UNAVAILABLE, CasWebflowConstants.TRANSITION_ID_UNAVAILABLE);
        createTransitionForState(failureAction, CasWebflowConstants.TRANSITION_ID_BYPASS, CasWebflowConstants.TRANSITION_ID_SUCCESS);

        LOGGER.trace("Adding end state [{}] with transition to [{}] to flow [{}] for MFA",
            CasWebflowConstants.STATE_ID_MFA_UNAVAILABLE, CasWebflowConstants.VIEW_ID_MFA_UNAVAILABLE, flow.getId());
        createEndState(flow, CasWebflowConstants.STATE_ID_MFA_UNAVAILABLE, CasWebflowConstants.VIEW_ID_MFA_UNAVAILABLE);

        LOGGER.trace("Adding end state [{}] with transition to [{}] to flow [{}] for MFA",
            CasWebflowConstants.STATE_ID_MFA_DENIED, CasWebflowConstants.VIEW_ID_MFA_DENIED, flow.getId());
        createEndState(flow, CasWebflowConstants.STATE_ID_MFA_DENIED, CasWebflowConstants.VIEW_ID_MFA_DENIED);

        val subflowState = createSubflowState(flow, subflowId, subflowId);
        val states = getCandidateStatesForMultifactorAuthentication();
        LOGGER.trace("Candidate states for multifactor authentication are [{}]", states);

        states.forEach(s -> {
            LOGGER.trace("Locating state [{}] to process for multifactor authentication", s);
            val actionState = getState(flow, s);

            LOGGER.trace("Adding transition [{}] to [{}] for [{}]", CasWebflowConstants.TRANSITION_ID_DENY, CasWebflowConstants.STATE_ID_MFA_DENIED, s);
            createTransitionForState(actionState, CasWebflowConstants.TRANSITION_ID_DENY, CasWebflowConstants.STATE_ID_MFA_DENIED);

            LOGGER.trace("Adding transition [{}] to [{}] for [{}]", CasWebflowConstants.TRANSITION_ID_UNAVAILABLE, CasWebflowConstants.STATE_ID_MFA_UNAVAILABLE, s);
            createTransitionForState(actionState, CasWebflowConstants.TRANSITION_ID_UNAVAILABLE, CasWebflowConstants.STATE_ID_MFA_UNAVAILABLE);

            LOGGER.trace("Locating transition id [{}] to process multifactor authentication for state [{}]", CasWebflowConstants.TRANSITION_ID_SUCCESS, s);
            val targetSuccessId = actionState.getTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS).getTargetStateId();

            LOGGER.trace("Locating transition id [{}] to process multifactor authentication for state [{}]", CasWebflowConstants.TRANSITION_ID_SUCCESS_WITH_WARNINGS, s);
            val targetWarningsId = actionState.getTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS_WITH_WARNINGS).getTargetStateId();

            LOGGER.trace("Locating transition id [{}] to process multifactor authentication for state [{}]", CasWebflowConstants.TRANSITION_ID_DENY, s);
            val targetDenied = actionState.getTransition(CasWebflowConstants.TRANSITION_ID_DENY).getTargetStateId();

            LOGGER.trace("Location transition id [{}] to process multifactor authentication for stat [{}]", CasWebflowConstants.TRANSITION_ID_UNAVAILABLE, s);
            val targetUnavailable = actionState.getTransition(CasWebflowConstants.TRANSITION_ID_UNAVAILABLE).getTargetStateId();

            val mappings = new ArrayList<DefaultMapping>();
            val inputMapper = createMapperToSubflowState(mappings);
            val subflowMapper = createSubflowAttributeMapper(inputMapper, null);
            subflowState.setAttributeMapper(subflowMapper);

            LOGGER.trace("Creating transitions to subflow state [{}]", subflowState.getId());
            val transitionSet = subflowState.getTransitionSet();
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS, targetSuccessId));
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_SUCCESS_WITH_WARNINGS, targetWarningsId));
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_DENY, targetDenied));
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_UNAVAILABLE, targetUnavailable));
            transitionSet.add(createTransition(CasWebflowConstants.TRANSITION_ID_CANCEL, CasWebflowConstants.STATE_ID_INIT_LOGIN_FORM));

            LOGGER.trace("Creating transition [{}] for state [{}]", subflowId, actionState.getId());
            createTransitionForState(actionState, subflowId, subflowId);
        });

        registerMultifactorFlowDefinitionIntoLoginFlowRegistry(mfaProviderFlowRegistry);
        augmentMultifactorProviderFlowRegistry(mfaProviderFlowRegistry);

        LOGGER.trace("Registering the [{}] flow into the flow [{}]", subflowId, flow.getId());
        val startState = flow.getTransitionableState(flow.getStartState().getId());
        createTransitionForState(startState, subflowId, subflowId);

        val initState = flow.getTransitionableState(CasWebflowConstants.STATE_ID_INITIAL_AUTHN_REQUEST_VALIDATION_CHECK);
        createTransitionForState(initState, subflowId, subflowId);
    }
96093
public void setCounters(java.util.Collection<SummarizedCounter> counters) {
        if (counters == null) {
            this.counters = null;
            return;
        }

        this.counters = new java.util.ArrayList<SummarizedCounter>(counters);
    }
831765
public <T2 extends T> void incrementAll(Counter<T2> other) {
        for (T2 element: other.keySet()) {
            double cnt = other.getCount(element);
            incrementCount(element, cnt);
        }
    }
269181
public JMProgressiveManager<T, R>
			registerCountChangeListener(Consumer<Number> countChangeListener) {
		return registerListener(progressiveCount, countChangeListener);
	}
971405
private void createProxyHandler() throws MessageStoreException {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "createProxyHandler");

        _multiMEProxyHandler = new MultiMEProxyHandler(this, _txManager);
        _persistentStore.addItemStream(_multiMEProxyHandler, _txManager
                        .createAutoCommitTransaction());

        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "createProxyHandler");
    }
419413
@Override
    protected void logIncrementalStatsByAccount(String account, RunStats stats) {
        log.info("Session stats by account (incremental): account={} tasksAdded={}",
                 account, ((BitIntegrityRunStats) stats).getAdded());

    }
413632
public final synchronized void incrementReferenceCount() throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "incrementReferenceCount");

        if (_referenceCountIsDecreasing)
        {
        	if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) SibTr.event(this, tc, "Cannot increment! Reference count has begun decreasing.");
        	if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "incrementReferenceCount");
            throw new SevereMessageStoreException("Cannot add more references to an item after one has been removed");
        }
        _referenceCount++;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "incrementReferenceCount");
    }
49906
private void handleJmxRefreshables(List<MBeanWrapper> mbeanWrappers, AttributeNodeForPojo rootNode) {
		for (MBeanWrapper mbeanWrapper : mbeanWrappers) {
			Eventloop eventloop = mbeanWrapper.getEventloop();
			List<JmxRefreshable> currentRefreshables = rootNode.getAllRefreshables(mbeanWrapper.getMBean());
			if (!eventloopToJmxRefreshables.containsKey(eventloop)) {
				eventloopToJmxRefreshables.put(eventloop, currentRefreshables);
				eventloop.execute(createRefreshTask(eventloop, null, 0));
			} else {
				List<JmxRefreshable> previousRefreshables = eventloopToJmxRefreshables.get(eventloop);
				List<JmxRefreshable> allRefreshables = new ArrayList<>(previousRefreshables);
				allRefreshables.addAll(currentRefreshables);
				eventloopToJmxRefreshables.put(eventloop, allRefreshables);
			}

			refreshableStatsCounts.put(eventloop, eventloopToJmxRefreshables.get(eventloop).size());
		}
	}