Methods from the collector manager handler interface
545283
@Override
    public void init(CollectorManager collectorManager) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
            Tr.event(tc, "Subscribing to sources " + this, taskMap.keySet());
        }
        try {
            this.collectorMgr = collectorManager;
            //Get the source Ids from the task map and subscribe to relevant sources
            collectorMgr.subscribe(this, new ArrayList<String>(taskMap.keySet()));
        } catch (Exception e) {

        } finally {
            latch.countDown();
        }
    }
61869
public static Object invokeMethodN(Class senderClass, Object receiver, String messageName, Object[] messageArguments) throws Throwable {
        try {    
            return InvokerHelper.invokeMethod(receiver, messageName, messageArguments);
        } catch (GroovyRuntimeException gre) {
            throw unwrap(gre);
        }
    }
168852
private void initialize(Handler callbackHandler) {
		int processors = Runtime.getRuntime().availableProcessors();
		mDownloadDispatchers = new DownloadDispatcher[processors];
		mDelivery = new CallBackDelivery(callbackHandler);
	}
926015
private void performHandle(final Wave wave, final Method method) throws WaveException {

        // Build parameter list of the searched method
        final List<Object> parameterValues = new ArrayList<>();

        // Don't add WaveType parameters if we us the default processWave method
        if (!AbstractComponent.PROCESS_WAVE_METHOD_NAME.equals(method.getName())) {
            for (final WaveData<?> wd : wave.waveDatas()) {
                // Add only wave items defined as parameter
                if (wd.key().isParameter()) {
                    parameterValues.add(wd.value());
                }
            }
        }

        // Add the current wave to process
        parameterValues.add(wave);

        try {

            ClassUtility.callMethod(method, getWaveReady(), parameterValues.toArray());

        } catch (final CoreException e) {
            LOGGER.error(WAVE_DISPATCH_ERROR, e);
            // Propagate the wave exception
            throw new WaveException(wave, e);
        }

    }
17091
@SuppressWarnings("unchecked")
    protected void processInitialCollectorManagerServices() throws InvalidSyntaxException {
        ServiceReference<CollectorManager>[] servRefs = (ServiceReference<CollectorManager>[])
                        bundleContext.getServiceReferences(CollectorManager.class.getName(), null);

        if (servRefs != null) {
            for (ServiceReference<CollectorManager> servRef : servRefs) {
            	setCollectorManagerPipeline(servRef);
            }
        }
    }
90465
protected Method getExceptionHandlerMethod( FlowControllerHandlerContext context, String methodName, Throwable ex,
                                                Object formBean )
    {
        FlowController flowController = context.getFlowController();
        String cacheKey = methodName + '/' + ex.getClass().getName();
        ClassLevelCache cache = ClassLevelCache.getCache( flowController.getClass() );
        Method method = ( Method ) cache.get( CACHEID_EXCEPTION_HANDLER_METHODS, cacheKey );
        
        if ( method != null )
        {
            return method;
        }
     
        Class flowControllerClass = flowController.getClass();
        for ( Class exClass = ex.getClass(); exClass != null; exClass = exClass.getSuperclass() )
        {
            Class[] args = new Class[]{ exClass, String.class, String.class, Object.class };
            Method foundMethod = InternalUtils.lookupMethod( flowControllerClass, methodName, args );
            
            //
            // If we didn't find an exception-handler with the right signature, look for the deprecated signature with
            // FormData as the last argument.
            //
            if ( foundMethod == null && ( formBean == null || formBean instanceof FormData ) )
            {
                args = new Class[]{ exClass, String.class, String.class, FormData.class };         
                foundMethod = InternalUtils.lookupMethod( flowControllerClass, methodName, args );
            }
            
            //
            // If we didn't find an exception-handler with the right signature, look for the deprecated signature with
            // ActionForm as the last argument.
            //
            if ( foundMethod == null && ( formBean == null || formBean instanceof ActionForm ) )
            {
                args = new Class[]{ exClass, String.class, String.class, ActionForm.class };         
                foundMethod = InternalUtils.lookupMethod( flowControllerClass, methodName, args );
            }
            
            if ( foundMethod != null )
            {
                if ( _log.isDebugEnabled() )
                {
                    _log.debug( "Found exception handler for " + exClass.getName() );
                }
                
                if ( ! Modifier.isPublic( foundMethod.getModifiers() ) ) foundMethod.setAccessible( true );
                cache.put( CACHEID_EXCEPTION_HANDLER_METHODS, cacheKey, foundMethod );
                return foundMethod;
            }
            else
            {
                if ( _log.isErrorEnabled() )
                {
                    InternalStringBuilder msg = new InternalStringBuilder( "Could not find exception handler method " );
                    msg.append( methodName ).append( " for " ).append( exClass.getName() ).append( '.' );
                    _log.error( msg.toString() );
                }
            }
        }
        
        return null;
    }
283238
function () {
    if (this._collectorsStarted) { return; }

    this._eventListener = {
      loadTimeCollector: this._bind(this._loadTimeCollector),
      mouseCollector: this._bind(this._mouseCollector),
      keyboardCollector: this._bind(this._keyboardCollector),
      accelerometerCollector: this._bind(this._accelerometerCollector),
      touchCollector: this._bind(this._touchCollector)
    };

    if (window.addEventListener) {
      window.addEventListener("load", this._eventListener.loadTimeCollector, false);
      window.addEventListener("mousemove", this._eventListener.mouseCollector, false);
      window.addEventListener("keypress", this._eventListener.keyboardCollector, false);
      window.addEventListener("devicemotion", this._eventListener.accelerometerCollector, false);
      window.addEventListener("touchmove", this._eventListener.touchCollector, false);
    } else if (document.attachEvent) {
      document.attachEvent("onload", this._eventListener.loadTimeCollector);
      document.attachEvent("onmousemove", this._eventListener.mouseCollector);
      document.attachEvent("keypress", this._eventListener.keyboardCollector);
    } else {
      throw new sjcl.exception.bug("can't attach event");
    }

    this._collectorsStarted = true;
  }
1277214
private void checkCallbackMethods() throws CoreException {

        for (final EnumEventType eet : getAnnotationValue()) {

            final String methodName = buildHandlingMethodName(eet);

            final Class<?> eventClass = getAnnotationApiEventClass();

            try {
                this.callbackObject.getClass().getDeclaredMethod(methodName, eventClass);
            } catch (NoSuchMethodException | SecurityException e) {
                throw new CoreException(NO_EVENT_CALLBACK.getText(this.callbackObject.getClass().getName(), methodName, eventClass.getName()), e);
            }
        }

    }
93548
private void reportOnCollector() {
		for (final Counter counter : collector.getCounters()) {
			if (!counter.isDisplayed()) {
				continue;
			}
			final List<CounterRequest> requests = counter.getRequests();
			long hits = 0;
			long duration = 0;
			long errors = 0;
			for (final CounterRequest cr : requests) {
				hits += cr.getHits();
				duration += cr.getDurationsSum();
				errors += cr.getSystemErrors();
			}

			final String sanitizedName = sanitizeName(counter.getName());
			printLong(MetricType.COUNTER, sanitizedName + "_hits_count", "javamelody counter",
					hits);
			if (!counter.isErrorCounter() || counter.isJobCounter()) {
				// errors has no sense for the error and log counters
				printLong(MetricType.COUNTER, sanitizedName + "_errors_count", "javamelody counter",
						errors);
			}
			if (duration >= 0) {
				// duration is negative and has no sense for the log counter
				printLong(MetricType.COUNTER, sanitizedName + "_duration_millis",
						"javamelody counter", duration);
			}
		}
	}
1142092
private void invokeFactoryMethod(MethodDefinition read, Map<Short, LocalVariableDefinition> structData, LocalVariableDefinition instance)
    {
        if (metadata.getBuilderMethod().isPresent()) {
            ThriftMethodInjection builderMethod = metadata.getBuilderMethod().get();
            read.loadVariable(instance);

            // push parameters on stack
            for (ThriftParameterInjection parameter : builderMethod.getParameters()) {
                read.loadVariable(structData.get(parameter.getId()));
            }

            // invoke the method
            read.invokeVirtual(builderMethod.getMethod())
                    .storeVariable(instance);
        }
    }
706757
@Override
    public boolean invoke(Manager manager, Object event) {
        try {
            Object[] arguments = resolveArguments(manager, event);
            if (containsNull(arguments)) {
                return false;
            }
            if (!method.isAccessible()) {
                method.setAccessible(true);
            }
            method.invoke(target, arguments);
            return true;
        } catch (Exception e) {
            if (e instanceof InvocationTargetException) {
                Throwable cause = ((InvocationTargetException) e).getTargetException();
                // Exception already wrapped by another Observer down the chain.
                if (cause instanceof InvocationException) {
                    throw (InvocationException) cause;
                }
                throw new InvocationException(cause);
            }
            throw new InvocationException(e);
        }
    }
1112638
@Override
  public void removeHandler(Handler handler)
  {
    synchronized (this) {
      ClassLoader loader = Thread.currentThread().getContextClassLoader();
      
      if (loader == null) {
        loader = _systemClassLoader;
      }

      for (int i = _loaders.size() - 1; i >= 0; i--) {
        WeakReference<ClassLoader> ref = _loaders.get(i);
        ClassLoader refLoader = ref.get();

        if (refLoader == null) {
          _loaders.remove(i);
        }

        if (isParentLoader(loader, refLoader)) {
          removeHandler(handler, refLoader);
        }
      }

      HandlerEntry ownHandlers = _ownHandlers.get();
      if (ownHandlers != null)
        ownHandlers.removeHandler(handler);
    }
  }
827434
def _method(self, *args, **kwargs):
    
    yield self.resource_handler.handle(self.__resource_view_type__, *args, **kwargs)
793955
private void onHandlerEntry() {
        if (enabled) {
            Type exceptionType = handlers.get(handlerPendingInstruction);

            // Clear the pending instruction flag
            handlerPendingInstruction = null;

            // Filter the interested down to this exception
            Set<ProbeListener> filtered = new HashSet<ProbeListener>();
            for (ProbeListener listener : enabledListeners) {
                ListenerConfiguration config = listener.getListenerConfiguration();
                ProbeFilter filter = config.getTransformerData(EXCEPTION_FILTER_KEY);
                if (filter.isBasicFilter() && filter.basicClassNameMatches(exceptionType.getClassName())) {
                    filtered.add(listener);
                } else if (filter.isAdvancedFilter()) {
                    Class<?> clazz = getOwningClass(exceptionType.getInternalName());
                    if (clazz != null && filter.matches(clazz)) {
                        filtered.add(listener);
                    }
                }
            }

            if (filtered.isEmpty()) {
                return;
            }

            String key = createKey(exceptionType);
            ProbeImpl probe = getProbe(key);
            long probeId = probe.getIdentifier();

            setProbeInProgress(true);
            visitInsn(DUP); // throwable throwable
            visitLdcInsn(Long.valueOf(probeId)); // throwable throwable long1 long2
            visitInsn(DUP2_X1); // throwable long1 long2 throwable long1 long2
            visitInsn(POP2); // throwable long1 long2 throwable
            if (isStatic()) {
                visitInsn(ACONST_NULL); // throwable long1 long2 throwable this
            } else {
                visitVarInsn(ALOAD, 0); // throwable long1 long2 throwable this
            }
            visitInsn(SWAP); // throwable long1 long2 this throwable
            visitInsn(ACONST_NULL); // throwable long1 long2 this throwable null
            visitInsn(SWAP); // throwable long1 long2 this null throwable
            visitFireProbeInvocation(); // throwable
            setProbeInProgress(false);

            setProbeListeners(probe, filtered);
        }
    }
270579
function( thing, method, internal ) {

                var thingName, thingMethod,
                    thingIsObject = $.isPlainObject( thing ),
                    thingObject = thingIsObject ? thing : {}

                if ( thing ) {

                    // If the thing isn’t an object, make it one.
                    if ( !thingIsObject ) {
                        thingObject[ thing ] = method
                    }

                    // Go through the things to bind to.
                    for ( thingName in thingObject ) {

                        // Grab the method of the thing.
                        thingMethod = thingObject[ thingName ]

                        // If it was an internal binding, prefix it.
                        if ( internal ) {
                            thingName = '_' + thingName
                        }

                        // Make sure the thing methods collection exists.
                        STATE.methods[ thingName ] = STATE.methods[ thingName ] || []

                        // Add the method to the relative method collection.
                        STATE.methods[ thingName ].push( thingMethod )
                    }
                }

                return P
            }
279160
protected void detectHandlerMethods() {

		processAtmostRequestMappingInfo();

		try {
			registerNativeFunctionHandlers(
					handlerMappingInfoStorage.getHandlerMappingInfos(),
					NativeFunctionResponseBodyHandler.class);
			registerNativeFunctionHandlers(
					handlerMappingInfoStorage.getHandlerWithViewMappingInfos(),
					NativeFunctionModelAndViewHandler.class);

		} catch (Exception e) {
			e.printStackTrace();
		}
	}
165782
private void processMethodCall() {
        if ("invoke".equals(getNameConstantOperand()) && "java/lang/reflect/Method".equals(getClassConstantOperand())) {
            return;
        }
        String sig = getSigConstantOperand();
        List<String> args = SignatureUtils.getParameterSignatures(sig);
        if (stack.getStackDepth() >= args.size()) {
            for (int i = 0; i < args.size(); i++) {
                String argSig = args.get(i);
                if (argSig.startsWith(Values.SIG_ARRAY_PREFIX)) {
                    OpcodeStack.Item itm = stack.getStackItem(args.size() - i - 1);
                    int arrayReg = itm.getRegisterNumber();
                    WrapperInfo wi = wrappers.get(Integer.valueOf(arrayReg));
                    if (wi != null) {
                        wi.wasArg = true;
                    }
                }
            }
        }
    }