protected final OnDemandStatsProducer getProducer(Class producerClass, String producerId, String category, String subsystem, boolean tracingSupported){
        OnDemandStatsProducer<T> producer = (OnDemandStatsProducer<T>) ProducerRegistryFactory.getProducerRegistryInstance().getProducer(producerId);

        if (producer == null) {
            producer = new OnDemandStatsProducer<T>(producerId, category, subsystem, getStatsFactory());
            producer.setTracingSupported(tracingSupported);
            ProducerRegistryFactory.getProducerRegistryInstance().registerProducer(producer);

            //check for annotations
            createClassLevelAccumulators(producer, producerClass);

            for (Method method : producerClass.getMethods()){
                createMethodLevelAccumulators(producer, method);
            }
        }

        try {
            return  (OnDemandStatsProducer) ProducerRegistryFactory.getProducerRegistryInstance().getProducer(producerId);
        } catch (ClassCastException e) {
            LOGGER.error("getProducer(): Unexpected producer type", e);
            return null;
        }
    }
protected final OnDemandStatsProducer getProducer ( Class producerClass , String producerId , String category , String subsystem , boolean tracingSupported ) { OnDemandStatsProducer < T > producer = ( OnDemandStatsProducer < T > ) ProducerRegistryFactory . getProducerRegistryInstance ( ) . getProducer ( producerId ) ; if ( producer == null ) { producer = new OnDemandStatsProducer < T > ( producerId , category , subsystem , getStatsFactory ( ) ) ; producer . setTracingSupported ( tracingSupported ) ; ProducerRegistryFactory . getProducerRegistryInstance ( ) . registerProducer ( producer ) ; createClassLevelAccumulators ( producer , producerClass ) ; for ( Method method : producerClass . getMethods ( ) ) { createMethodLevelAccumulators ( producer , method ) ; } } try { return ( OnDemandStatsProducer ) ProducerRegistryFactory . getProducerRegistryInstance ( ) . getProducer ( producerId ) ; } catch ( ClassCastException e ) { LOGGER . error ( "getProducer(): Unexpected producer type" , e ) ; return null ; } }
Returns {@link OnDemandStatsProducer}.

@param producerClass producer class
@param producerId producer id
@param category category
@param subsystem subsystem
@param tracingSupported is tracing supported
@return {@link OnDemandStatsProducer}