[wise-commits] wise SVN: r458 - in webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui: treeElement and 1 other directory.

wise-commits at lists.jboss.org wise-commits at lists.jboss.org
Sun Jan 20 17:41:17 EST 2013


Author: alessio.soldano at jboss.com
Date: 2013-01-20 17:41:17 -0500 (Sun, 20 Jan 2013)
New Revision: 458

Modified:
   webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
   webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
Log:
Treat any class not loaded from the tools' URLClassLoader as a "simple" tree element


Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java	2013-01-20 22:24:39 UTC (rev 457)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/ClientConversationBean.java	2013-01-20 22:41:17 UTC (rev 458)
@@ -96,7 +96,7 @@
 	String portName = st.nextToken();
 	String operationName = st.nextToken();
 	try {
-	    inputTree = convertOperationParametersToGui(client.getWSMethod(serviceName, portName, operationName));
+	    inputTree = convertOperationParametersToGui(client.getWSMethod(serviceName, portName, operationName), client);
 	} catch (Exception e) {
 	    throw new RuntimeException(e);
 	}
@@ -114,30 +114,30 @@
 		WiseTreeElement wte = (WiseTreeElement)inputTree.getChild(it.next());
 		params.put(wte.getName(), wte.toObject());
 	    }
-	    outputTree = convertOperationResultToGui(wsMethod.invoke(params));
+	    outputTree = convertOperationResultToGui(wsMethod.invoke(params), client);
 	} catch (Exception e) {
 	    throw new RuntimeException(e);
 	}
 	
     }
     
-    private static TreeNodeImpl convertOperationParametersToGui(WSMethod wsMethod) {
+    private static TreeNodeImpl convertOperationParametersToGui(WSMethod wsMethod, WSDynamicClient client) {
 	WiseTreeElementBuilder builder = new WiseTreeElementBuilder();
 	TreeNodeImpl rootElement = new TreeNodeImpl();
 	Collection<? extends WebParameter> parameters = wsMethod.getWebParams().values();
 	for (WebParameter parameter : parameters) {
-	    WiseTreeElement wte = builder.buildTreeFromType(parameter.getType(), parameter.getName(), null); //TODO client for parameterized types...
+	    WiseTreeElement wte = builder.buildTreeFromType(parameter.getType(), parameter.getName(), client);
 	    rootElement.addChild(wte.getId(), wte);
 	}
 	return rootElement;
     }
     
-    private static TreeNodeImpl convertOperationResultToGui(InvocationResult result) {
+    private static TreeNodeImpl convertOperationResultToGui(InvocationResult result,  WSDynamicClient client) {
 	WiseTreeElementBuilder builder = new WiseTreeElementBuilder();
 	TreeNodeImpl rootElement = new TreeNodeImpl();
 	for (Entry<String, Object> res : result.getResult().entrySet()) {
 	    Object resObj = res.getValue();
-	    WiseTreeElement wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), null, resObj); //TODO client for parameterized types...
+	    WiseTreeElement wte = builder.buildTreeFromType(resObj.getClass(), res.getKey(), client, resObj);
 	    rootElement.addChild(wte.getId(), wte);
 	}
 	return rootElement;

Modified: webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java
===================================================================
--- webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java	2013-01-20 22:24:39 UTC (rev 457)
+++ webgui/branches/cdi-jsf/src/main/java/org/jboss/wise/gui/treeElement/WiseTreeElementBuilder.java	2013-01-20 22:41:17 UTC (rev 458)
@@ -92,7 +92,7 @@
 	    throw new WiseRuntimeException("Converter doesn't support this Object[] yet.");
 	}
 
-	if (cl.isEnum() || cl.isPrimitive() || cl.getName().equals(String.class.getName())) { // || !cl.getPackage().getName().equals(WSDynamicClient.WISE_TARGET_PACKAGE)) { //TODO ???
+	if (cl.isEnum() || cl.isPrimitive() || client.getClassLoader() != cl.getClassLoader()) {
 	    Logger.getLogger(this.getClass()).debug("* simple");
 	    SimpleWiseTreeElement element = SimpleWiseTreeElementFactory.create(cl, name);
 	    element.parseObject(obj);



More information about the wise-commits mailing list