public <T> T createMonitor(Class<T> type, Monitorable monitorable, String destination) throws Fabric3Exception { if (destination == null) { destination = DEFAULT_DESTINATION; } int destinationIndex = router.getDestinationIndex(destination); ClassLoader loader = type.getClassLoader(); Map<Method, DispatchInfo> levels = new HashMap<>(); for (Method method : type.getMethods()) { DispatchInfo info = createDispatchInfo(type, loader, method); levels.put(method, info); } JDKMonitorHandler handler = new JDKMonitorHandler(destinationIndex, monitorable, router, levels); if (MonitorChannel.class.isAssignableFrom(type) || MonitorProxy.class.isAssignableFrom(type)) { return type.cast(handler); } return type.cast(Proxy.newProxyInstance(loader, new Class[]{type}, handler)); }
public <T> T createMonitor(Class<T> type, Monitorable monitorable, String destination) throws MonitorCreationException { if (destination == null) { destination = DEFAULT_DESTINATION; } int destinationIndex = router.getDestinationIndex(destination); ClassLoader loader = type.getClassLoader(); Map<Method, DispatchInfo> levels = new HashMap<Method, DispatchInfo>(); for (Method method : type.getMethods()) { DispatchInfo info = createDispatchInfo(type, loader, method); levels.put(method, info); } JDKMonitorHandler handler = new JDKMonitorHandler(destinationIndex, monitorable, router, levels); if (MonitorChannel.class.isAssignableFrom(type) || MonitorProxy.class.isAssignableFrom(type)) { return type.cast(handler); } return type.cast(Proxy.newProxyInstance(loader, new Class[]{type}, handler)); }
public <T> T createMonitor(Class<T> type, Monitorable monitorable, String destination) throws Fabric3Exception { if (destination == null) { destination = DEFAULT_DESTINATION; } int destinationIndex = router.getDestinationIndex(destination); ClassLoader loader = type.getClassLoader(); Map<Method, DispatchInfo> levels = new HashMap<>(); for (Method method : type.getMethods()) { DispatchInfo info = createDispatchInfo(type, loader, method); levels.put(method, info); } JDKMonitorHandler handler = new JDKMonitorHandler(destinationIndex, monitorable, router, levels); if (MonitorChannel.class.isAssignableFrom(type) || MonitorProxy.class.isAssignableFrom(type)) { return type.cast(handler); } return type.cast(Proxy.newProxyInstance(loader, new Class[]{type}, handler)); }