// Start the Valves in our pipeline (including the basic), if any
Valve current = first; if (current == null) {
current = basic;
} while (current != null) { if (current instanceof Lifecycle) {
((Lifecycle) current).start();
}
current = current.getNext();
}
// Stop the Valves in our pipeline (including the basic), if any
Valve current = first; if (current == null) {
current = basic;
} while (current != null) { if (current instanceof Lifecycle) {
((Lifecycle) current).stop();
}
current = current.getNext();
}
}
// Change components if necessary
Valve oldBasic = this.basic; if (oldBasic == valve) { return;
}
// Stop the old component if necessary if (oldBasic != null) { if (getState().isAvailable() && (oldBasic instanceof Lifecycle)) { try {
((Lifecycle) oldBasic).stop();
} catch (LifecycleException e) {
log.error(sm.getString("standardPipeline.basic.stop"), e);
}
} if (oldBasic instanceof Contained) { try {
((Contained) oldBasic).setContainer(null);
} catch (Throwable t) {
ExceptionUtils.handleThrowable(t);
}
}
}
// Start the new component if necessary if (valve == null) { return;
} if (valve instanceof Contained) {
((Contained) valve).setContainer(this.container);
} if (getState().isAvailable() && valve instanceof Lifecycle) { try {
((Lifecycle) valve).start();
} catch (LifecycleException e) {
log.error(sm.getString("standardPipeline.basic.start"), e); return;
}
}
// Update the pipeline
Valve current = first; while (current != null) { if (current.getNext() == oldBasic) {
current.setNext(valve); break;
}
current = current.getNext();
}
// Validate that we can add this Valve if (valve instanceof Contained) {
((Contained) valve).setContainer(this.container);
}
// Start the new component if necessary if (getState().isAvailable()) { if (valve instanceof Lifecycle) { try {
((Lifecycle) valve).start();
} catch (LifecycleException e) {
log.error(sm.getString("standardPipeline.valve.start"), e);
}
}
}
// Add this Valve to the set associated with this Pipeline if (first == null) {
first = valve;
valve.setNext(basic);
} else {
Valve current = first; while (current != null) { if (current.getNext() == basic) {
current.setNext(valve);
valve.setNext(basic); break;
}
current = current.getNext();
}
}
/** *ReturnthesetofValvesinthepipelineassociatedwiththisContainer,includingthebasicValve(ifany).If *therearenosuchValves,azero-lengtharrayisreturned.
*/
@Override public Valve[] getValves() {
List<Valve> valveList = new ArrayList<>();
Valve current = first; if (current == null) {
current = basic;
} while (current != null) {
valveList.add(current);
current = current.getNext();
}
return valveList.toArray(new Valve[0]);
}
public ObjectName[] getValveObjectNames() {
List<ObjectName> valveList = new ArrayList<>();
Valve current = first; if (current == null) {
current = basic;
} while (current != null) { if (current instanceof JmxEnabled) {
valveList.add(((JmxEnabled) current).getObjectName());
}
current = current.getNext();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.