Registers a MonitorPlugin with this thread pool. Only
one plugin is supported in the current implementation.

@throws TooManyListenersException
if a different
MonitorPlugin had already been registered with
this ThreadPool.
979205
public void setMonitorPlugin(MonitorPlugin plugin) throws TooManyListenersException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.entry(tc, "setMonitorPlugin", plugin);
        }

        if (this.monitorPlugin != null && !this.monitorPlugin.equals(plugin)) {
            throw new TooManyListenersException("INTERNAL ERROR: ThreadPool.MonitorPlugin already set.");
        }
        this.monitorPlugin = plugin;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "setMonitorPlugin", plugin);
        }
    }
1085230
void register(ResourceMonitorImpl monitorImpl) throws IOException
   {
      Path path = monitorImpl.getResourcePath();
      registerAll(path, monitorImpl);
   }
910685
private void registerPerformanceMonitor(String beanName,
                                            BeanDefinitionRegistry registry) {

        String perfMonitorName = beanName + "PerformanceMonitor";
        if (!registry.containsBeanDefinition(perfMonitorName))  {
            BeanDefinitionBuilder initializer =
                BeanDefinitionBuilder.rootBeanDefinition(PerformanceMonitorBean.class);
            registry.registerBeanDefinition(perfMonitorName, initializer.getBeanDefinition());
        }
    }
839913
@Override
    public boolean registerMonitor(Object monitor) {
        // Process the annotated object, build a configuration, and create probe
        // listeners that represent each call site of the monitor.
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "monitor = " + monitor);
        }
        long startTime = System.nanoTime();
        Set<ProbeListener> listeners = buildListenersFromAnnotated(monitor);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "buildListenersFromAnnotated time = " + TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime) + "usec");
        }

        // Update collections of listeners
        startTime = System.nanoTime();
        if (!addListenersForMonitor(monitor, listeners)) {
            return false;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "addListenersForMonitorTime = " + TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime) + "usec");
        }

        // Process all of the listeners and determine which of the available
        // classes needs to be transformed
        startTime = System.nanoTime();
        Collection<Class<?>> effectedClasses = processNewListeners(listeners);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "processNewListeners time = " + TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime) + "usec");
        }

        // Update the classes with the configured probes
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "effectedClasses.size() = " + effectedClasses.size());
        }
        startTime = System.nanoTime();
        this.transformer.instrumentWithProbes(effectedClasses);
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(this, tc, "instrumentWithProbes time = " + TimeUnit.NANOSECONDS.toMicros(System.nanoTime() - startTime) + "usec");
        }

        return true;
    }
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;
        }
    }
1348553
@Override
    public void registerFactory(String name, Class<? extends ChannelFactory> factory) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "registerFactory: " + name + "; " + factory);
        }
        synchronized (this.factories) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
                Class<? extends ChannelFactory> prevFactory = this.factories.get(name);
                if (null != prevFactory && factory != prevFactory) {
                    Tr.event(tc, "WARNING: overlaying existing factory: " + prevFactory);
                }
            }
            this.factories.put(name, factory);
        } // 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);
    }
976771
public void addPlugin(Plugin plugin) throws OrderingConstraintException {
        if (DEBUG) {
            System.out.println("Adding plugin " + plugin.getPluginId() + " to execution plan");
        }

        pluginList.add(plugin);

        // Add ordering constraints
        copyTo(plugin.interPassConstraintIterator(), interPassConstraintList);
        copyTo(plugin.intraPassConstraintIterator(), intraPassConstraintList);

        // Add detector factories
        for (DetectorFactory factory : plugin.getDetectorFactories()) {
            if (DEBUG) {
                System.out.println("  Detector factory " + factory.getShortName());
            }
            if (factoryMap.put(factory.getFullName(), factory) != null) {
                throw new OrderingConstraintException("Detector " + factory.getFullName() + " is defined by more than one plugin");
            }
        }
    }
198700
public void registerMessageListener(MessageListenerDefinition messageListenerDefinition) {
        checkNotNull(messageListenerDefinition);

        ConnectionDefinition connectionDefinition = connectionDefinitions.get(messageListenerDefinition.getConnectionName());
        if (connectionDefinition.isJeeMode() && messageListenerDefinition.getPoller() == null) {
            throw SeedException.createNew(JmsErrorCode.MESSAGE_POLLER_REQUIRED_IN_JEE_MODE)
                    .put(ERROR_CONNECTION_NAME, connectionDefinition.getName())
                    .put(ERROR_MESSAGE_LISTENER_NAME, messageListenerDefinition.getName());
        }

        try {
            createMessageConsumer(messageListenerDefinition);
        } catch (JMSException e) {
            throw SeedException.wrap(e, JmsErrorCode.UNABLE_TO_CREATE_MESSAGE_CONSUMER)
                    .put(ERROR_MESSAGE_LISTENER_NAME, messageListenerDefinition.getName());
        }

        if (messageListenerDefinitions.putIfAbsent(messageListenerDefinition.getName(), messageListenerDefinition) != null) {
            throw SeedException.createNew(JmsErrorCode.DUPLICATE_MESSAGE_LISTENER_NAME)
                    .put(ERROR_MESSAGE_LISTENER_NAME, messageListenerDefinition.getName());
        }
    }
988497
public void registerCallback(UOWScopeCallback callback)
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "registerCallback", new Object[]{callback, this});
        
        _callbackManager.addCallback(callback);
        
        if (tc.isEntryEnabled()) Tr.exit(tc, "registerCallback");
    }
1281167
protected final void registerBrowser( AbstractQueueBrowser browser )
    {
    	if (browsersMap.put(browser.getId(),browser) != null)
    		throw new IllegalArgumentException("Browser "+browser.getId()+" already exists");
    }
431254
private synchronized void createConsumerThreadPool() {
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.entry(tc, "createConsumerThreadPool");
        if (_consumerThreadPool == null) {
            // 214163 Add a threadpool listener to associate threads in trace
            // with the messaging engine.
            _consumerThreadPool = new ThreadPool(
                            "Consumer " + getMessagingEngineName(),
                            0,
                            _customProperties.get_max_consumer_threadpool_size(),
                            new ThreadPoolListener[] { new ThreadPoolListenerImpl(this) });
            _consumerThreadPool
                            .setRequestBufferExpansionLimit(Integer.MAX_VALUE);
        }
        if (TraceComponent.isAnyTracingEnabled()
            && tc.isEntryEnabled())
            SibTr.exit(tc, "createConsumerThreadPool");
    }
965091
@SuppressWarnings({ "unchecked", "rawtypes" })
    protected void activate(ComponentContext cc) {
        BundleContext bundleContext = cc.getBundleContext();
        monitorServiceTracker = new ServiceTracker(bundleContext, "com.ibm.websphere.monitor.MonitorManager", new ServiceTrackerCustomizer() {

            @Override
            public Object addingService(ServiceReference serviceReference) {
                init();
                return this;
            }

            @Override
            public void modifiedService(ServiceReference arg0, Object serviceReference) {}

            @Override
            public void removedService(ServiceReference arg0, Object serviceReference) {
                preDestroy();
            }
        });;
        monitorServiceTracker.open();
    }
119736
def register_tc_plugins(self, plugin_name, plugin_class):
        
        if plugin_name in self.registered_plugins:
            raise PluginException("Plugin {} already registered! Duplicate "
                                  "plugins?".format(plugin_name))
        self.logger.debug("Registering plugin %s", plugin_name)
        plugin_class.init(bench=self.bench)
        if plugin_class.get_bench_api() is not None:
            register_func = self.plugin_types[PluginTypes.BENCH]
            register_func(plugin_name, plugin_class)
        if plugin_class.get_parsers() is not None:
            register_func = self.plugin_types[PluginTypes.PARSER]
            register_func(plugin_name, plugin_class)
        if plugin_class.get_external_services() is not None:
            register_func = self.plugin_types[PluginTypes.EXTSERVICE]
            register_func(plugin_name, plugin_class)

        self.registered_plugins.append(plugin_name)
1101572
public static synchronized void registerUserThread(String service, UserThreadPool userThreadPool) {
        if (userThreadMap == null) {
            userThreadMap = new ConcurrentHashMap<String, UserThreadPool>();
        }
        userThreadMap.put(service, userThreadPool);
    }
744978
public void register(CacheEntryListenerConfiguration<K, V> configuration) {
    if (configuration.getCacheEntryListenerFactory() == null) {
      return;
    }
    EventTypeAwareListener<K, V> listener = new EventTypeAwareListener<>(
        configuration.getCacheEntryListenerFactory().create());

    CacheEntryEventFilter<K, V> filter = event -> true;
    if (configuration.getCacheEntryEventFilterFactory() != null) {
      filter = new EventTypeFilter<>(listener,
          configuration.getCacheEntryEventFilterFactory().create());
    }

    Registration<K, V> registration = new Registration<>(configuration, filter, listener);
    dispatchQueues.putIfAbsent(registration, CompletableFuture.completedFuture(null));
  }
634568
@Override
	public void initializePlugin(StagemonitorPlugin.InitArguments initArguments) {
		this.metricRegistry = initArguments.getMetricRegistry();
		healthCheckRegistry = initArguments.getHealthCheckRegistry();
		TracingPlugin tracingPlugin = initArguments.getPlugin(TracingPlugin.class);
		final CacheManager cacheManager = CacheManager.getCacheManager(ehCacheNameOption.getValue());
		if (cacheManager == null) {
			tryAgainWhenFirstRequestComesIn(tracingPlugin);
		} else {
			monitorCaches(cacheManager);
			healthCheckRegistry.register("EhCache CacheManager", ImmediateResult.of(HealthCheck.Result.healthy()));
		}
		final CorePlugin corePlugin = initArguments.getPlugin(CorePlugin.class);
		corePlugin.getGrafanaClient().sendGrafanaDashboardAsync("grafana/ElasticsearchEhCache.json");
	}
173615
def register(coordinator):
    """"""
    fetch_queue = Queue.Queue()
    coordinator.register(FetchItem, fetch_queue)
    for i in xrange(FLAGS.fetch_threads):
        coordinator.worker_threads.append(
            FetchThread(fetch_queue, coordinator.input_queue))