use of org.glassfish.flashlight.client.StatefulProbeClientInvoker in project Payara by payara.
the class FlashlightProbe method fireProbeOnException.
public void fireProbeOnException(Object exceptionValue, ArrayList<ProbeInvokeState> states) {
if (!listenerEnabled.get()) {
return;
}
if (parent != null) {
parent.fireProbeOnException(exceptionValue, states);
}
int sz = invokerList.size();
int stateIndex = -1;
for (int i = 0; i < sz; i++) {
StatefulProbeClientInvoker invoker = (StatefulProbeClientInvoker) invokerList.get(i);
if (invoker != null) {
stateIndex = findStateIndex(invoker.getId(), states);
if (stateIndex >= 0)
invoker.invokeOnException(states.get(stateIndex).getState(), exceptionValue);
}
}
}
use of org.glassfish.flashlight.client.StatefulProbeClientInvoker in project Payara by payara.
the class FlashlightProbe method initInvokerList.
private void initInvokerList() {
Set<Map.Entry<Integer, ProbeClientInvoker>> entries = invokers.entrySet();
List<ProbeClientInvoker> invList = new ArrayList(2);
if (stateful) {
// invokes
for (Map.Entry<Integer, ProbeClientInvoker> entry : entries) {
ProbeClientInvoker invoker = entry.getValue();
if (invoker instanceof StatefulProbeClientInvoker)
invList.add(invoker);
}
} else {
for (Map.Entry<Integer, ProbeClientInvoker> entry : entries) {
ProbeClientInvoker invoker = entry.getValue();
invList.add(invoker);
}
}
invokerList = invList;
}
use of org.glassfish.flashlight.client.StatefulProbeClientInvoker in project Payara by payara.
the class FlashlightProbe method fireProbeAfter.
public void fireProbeAfter(Object returnValue, ArrayList<ProbeInvokeState> states) {
if (!listenerEnabled.get()) {
return;
}
if (parent != null) {
parent.fireProbeAfter(returnValue, states);
}
int sz = invokerList.size();
int stateIndex = -1;
for (int i = 0; i < sz; i++) {
StatefulProbeClientInvoker invoker = (StatefulProbeClientInvoker) invokerList.get(i);
if (invoker != null) {
stateIndex = findStateIndex(invoker.getId(), states);
if (stateIndex >= 0)
invoker.invokeAfter(states.get(stateIndex).getState(), returnValue);
}
}
}
use of org.glassfish.flashlight.client.StatefulProbeClientInvoker in project Payara by payara.
the class FlashlightProbe method fireProbeBefore.
public ArrayList<ProbeInvokeState> fireProbeBefore(Object[] params) {
if (!listenerEnabled.get()) {
return null;
}
ArrayList<ProbeInvokeState> probeInvokeStates = new ArrayList<ProbeInvokeState>();
if (parent != null) {
ArrayList<ProbeInvokeState> parentStates = parent.fireProbeBefore(params);
probeInvokeStates.addAll(parentStates);
}
int sz = invokerList.size();
for (int i = 0; i < sz; i++) {
StatefulProbeClientInvoker invoker = (StatefulProbeClientInvoker) invokerList.get(i);
if (invoker != null) {
probeInvokeStates.add(new ProbeInvokeState(invoker.getId(), invoker.invokeBefore(params)));
}
}
return probeInvokeStates;
}
Aggregations