-
1. Re: SwitchYard Debugger
rick_wagner Dec 14, 2013 9:32 AM (in response to rcernich)This must be [SWITCHYARD-1889] Add debug support to SwitchYard tooling - JBoss Issue Tracker
It's got my vote-- great idea!
Rick
-
2. Re: SwitchYard Debugger
rcernich Dec 18, 2013 4:21 PM (in response to rcernich)First screenshot detailing service breakpoints. These come in two forms: PROVIDER and CONSUMER. Provider aligns with component services and composite references. Consumer aligns with composite services and component references.
The breakpoints are implemented as Java method breakpoints with custom conditions. For example, method org.switchyard.bus.camel.processors.InterceptProcessor.process(Exchange) with the condition:
"PROVIDER".equalsIgnoreCase(this._target) && (org.switchyard.ExchangePhase.IN == ex.getProperty("org.switchyard.bus.camel.phase", org.switchyard.ExchangePhase.class) || org.switchyard.ExchangePhase.OUT == ex.getProperty("org.switchyard.bus.camel.phase", org.switchyard.ExchangePhase.class)) && "{urn:com.example.switchyard:switchyard-example2:1.0}ExampleService".equals(ex.getProperty("org.switchyard.bus.camel.provider", org.switchyard.Service.class).getName().toString())
The screenshot:
-
3. Re: SwitchYard Debugger
bfitzpat Dec 18, 2013 4:31 PM (in response to rcernich)That's awesome Rob! Great work!
-
4. Re: SwitchYard Debugger
kconner Dec 18, 2013 4:37 PM (in response to rcernich)Ooooh, this looks very interesting
-
5. Re: SwitchYard Debugger
kcbabo Dec 18, 2013 5:10 PM (in response to kconner)Very nice, Rob. How are the breakpoints set? It would be cool if the user could enable it via the button bar on services and references in the model. :-)
-
6. Re: SwitchYard Debugger
rcernich Dec 18, 2013 5:15 PM (in response to kcbabo)Hey Keith,
Looks like I left that detail out. Breakpoints can be toggled using a right-click on a service/reference figure. I'm currently working on adding an indicator onto the figures so the user knows if there's a breakpoint set on the figure or not.
Rob
-
-
8. Re: SwitchYard Debugger
rcernich Dec 19, 2013 11:24 AM (in response to rcernich)In case anybody wants to play, the source is up on github: https://github.com/rcernich/tools/tree/debug-support
-
9. Re: SwitchYard Debugger
kcbabo Dec 19, 2013 12:27 PM (in response to rcernich)Nice. We need to tint those lenses though.
-
-
11. Re: SwitchYard Debugger
rcernich Dec 20, 2013 1:33 PM (in response to rcernich)Upon further testing, it doesn't look like the "value" column for the child nodes gets refreshed properly. In order to see the changes, I've been toggling "view logical structures" off and on to get them to refresh. That said, the contents are correct and the detail pane shows the correct details.
-
12. Re: SwitchYard Debugger
rcernich Dec 20, 2013 3:30 PM (in response to rcernich)I've just found better results are obtained by setting "Show variable details ('toString()' value)" to "As the label for all variables" in preferences, Java->Debug->Detail Formatters. This provides a better "values" in the tree, whereas those strings would normally go in the detail pane. That said, I'm considering adding some detail formatters for common SwitchYard types (although there is no extension point that supports this, so...).
-
13. Re: Re: SwitchYard Debugger
dward Jan 6, 2014 11:59 AM (in response to rcernich)I use the following for a detail formatter when inspecting switchyard values in the debugger. It would be cool if we could default to (something like) this in switchyard tooling, especially considering how common XML Nodes (and SOAP Messages) are for our content/values:
Object obj = this;
if (obj == null) {
return null;
}
org.w3c.dom.Node node = null;
if (obj instanceof org.w3c.dom.Node) {
node = (org.w3c.dom.Node)obj;
} else if (obj instanceof javax.xml.soap.SOAPMessage) {
node = ((javax.xml.soap.SOAPMessage)obj).getSOAPPart();
}
if (node == null) {
return obj.toString();
}
javax.xml.transform.TransformerFactory tf = javax.xml.transform.TransformerFactory.newInstance();
javax.xml.transform.Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(javax.xml.transform.OutputKeys.ENCODING, "UTF-8");
transformer.setOutputProperty(javax.xml.transform.OutputKeys.INDENT, "yes");
transformer.setOutputProperty(javax.xml.transform.OutputKeys.METHOD, "xml");
transformer.setOutputProperty(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes");
transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
javax.xml.transform.dom.DOMSource source = new javax.xml.transform.dom.DOMSource(node);
java.io.StringWriter os = new java.io.StringWriter();
javax.xml.transform.stream.StreamResult result = new javax.xml.transform.stream.StreamResult(os);
transformer.transform(source, result);
return os.toString();
-
14. Re: Re: SwitchYard Debugger
rcernich Jan 6, 2014 12:11 PM (in response to dward)Hey David,
That would be nice, but Eclipse doesn't currently provide an extension point for registering detail formatters. Given that, I'm trying to figure out how this might be accomplished.
Thanks for the post. I'll be adding that to my own environment.
Rob