static JsonArrayBuilder createBootstrapStatsJson(Probe probe) { JsonArrayBuilder builder = Json.arrayBuilder(); Map<EventType, AtomicInteger> counts = probe.getBootstrapStats().getCounts(); List<EventType> sortedKeys = new ArrayList<>(counts.keySet()); Collections.sort(sortedKeys, new Comparator<EventType>() { @Override public int compare(EventType o1, EventType o2) { return Integer.compare(o1.getPriority(), o2.getPriority()); } }); for (EventType eventType : sortedKeys) { JsonObjectBuilder eventBuilder = Json.objectBuilder(); eventBuilder.add(NAME, eventType.toString()); eventBuilder.add(TYPE, eventType.getType()); eventBuilder.add(FIRED, counts.get(eventType).get()); eventBuilder.add(OBSERVERS, Queries.find(probe.getObservers(), 1, 0, new ObserverFilters(probe, eventType.getType(), null)).getTotal()); builder.add(eventBuilder); } return builder; }
representation = Representation.BASIC; for (Bean<?> bean : page.getData()) { switch (representation) { case SIMPLE:
representation = Representation.BASIC; for (Bean<?> bean : page.getData()) { switch (representation) { case SIMPLE:
representation = Representation.BASIC; for (Bean<?> bean : page.getData()) { switch (representation) { case SIMPLE:
representation = Representation.BASIC; for (Bean<?> bean : page.getData()) { switch (representation) { case SIMPLE:
representation = Representation.BASIC; for (Bean<?> bean : page.getData()) { switch (representation) { case SIMPLE:
representation = Representation.BASIC; for (Bean<?> bean : page.getData()) { switch (representation) { case SIMPLE:
representation = Representation.BASIC; for (Bean<?> bean : page.getData()) { switch (representation) { case SIMPLE:
/** * * @param probe * @return the collection of all observer methods, using basic representation */ static String createObserversJson(Page<ObserverMethod<?>> page, Probe probe, Representation representation) { JsonArrayBuilder observersBuilder = Json.arrayBuilder(); if (representation == null) { representation = Representation.BASIC; } for (ObserverMethod<?> observerMethod : page.getData()) { switch (representation) { case BASIC: observersBuilder.add(createBasicObserverJson(observerMethod, probe)); break; case FULL: observersBuilder.add(createFullObserverJson(observerMethod, probe)); break; default: throw new UnsupportedOperationException(representation.toString()); } } return createPageJson(page, observersBuilder); }
/** * * @param probe * @return the collection of all observer methods, using basic representation */ static String createObserversJson(Page<ObserverMethod<?>> page, Probe probe, Representation representation) { JsonArrayBuilder observersBuilder = Json.arrayBuilder(); if (representation == null) { representation = Representation.BASIC; } for (ObserverMethod<?> observerMethod : page.getData()) { switch (representation) { case BASIC: observersBuilder.add(createBasicObserverJson(observerMethod, probe)); break; case FULL: observersBuilder.add(createFullObserverJson(observerMethod, probe)); break; default: throw new UnsupportedOperationException(representation.toString()); } } return createPageJson(page, observersBuilder); }
/** * * @param probe * @return the collection of all observer methods, using basic representation */ static String createInvocationsJson(Page<Invocation> page, Probe probe, Representation representation) { JsonArrayBuilder invocationsBuilder = Json.arrayBuilder(); if (representation == null) { representation = Representation.BASIC; } for (Invocation invocation : page.getData()) { switch (representation) { case BASIC: invocationsBuilder.add(createBasicInvocationJson(invocation, probe)); break; case FULL: invocationsBuilder.add(createFullInvocationJson(invocation, probe)); break; default: throw new UnsupportedOperationException(representation.toString()); } } return createPageJson(page, invocationsBuilder); }
/** * * @param probe * @return the collection of all observer methods, using basic representation */ static String createInvocationsJson(Page<Invocation> page, Probe probe, Representation representation) { JsonArrayBuilder invocationsBuilder = Json.arrayBuilder(); if (representation == null) { representation = Representation.BASIC; } for (Invocation invocation : page.getData()) { switch (representation) { case BASIC: invocationsBuilder.add(createBasicInvocationJson(invocation, probe)); break; case FULL: invocationsBuilder.add(createFullInvocationJson(invocation, probe)); break; default: throw new UnsupportedOperationException(representation.toString()); } } return createPageJson(page, invocationsBuilder); }
/** * * @param probe * @return the collection of all observer methods, using basic representation */ static String createObserversJson(Page<ObserverMethod<?>> page, Probe probe, Representation representation) { JsonArrayBuilder observersBuilder = Json.arrayBuilder(); if (representation == null) { representation = Representation.BASIC; } for (ObserverMethod<?> observerMethod : page.getData()) { switch (representation) { case BASIC: observersBuilder.add(createBasicObserverJson(observerMethod, probe)); break; case FULL: observersBuilder.add(createFullObserverJson(observerMethod, probe)); break; default: throw new UnsupportedOperationException(representation.toString()); } } return createPageJson(page, observersBuilder); }