Author: alessio.soldano(a)jboss.com
Date: 2013-01-20 18:25:56 -0500 (Sun, 20 Jan 2013)
New Revision: 459
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/client/WSDynamicClient.java
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
Log:
Adding method for retrieving ObjectFactory classes
Modified: core/trunk/core/src/main/java/org/jboss/wise/core/client/WSDynamicClient.java
===================================================================
---
core/trunk/core/src/main/java/org/jboss/wise/core/client/WSDynamicClient.java 2013-01-20
22:41:17 UTC (rev 458)
+++
core/trunk/core/src/main/java/org/jboss/wise/core/client/WSDynamicClient.java 2013-01-20
23:25:56 UTC (rev 459)
@@ -23,6 +23,7 @@
package org.jboss.wise.core.client;
import java.net.URLClassLoader;
+import java.util.List;
import java.util.Map;
import org.jboss.wise.core.exception.ResourceNotAvailableException;
@@ -55,6 +56,11 @@
* @return The classLoader used to load generated class.
*/
public URLClassLoader getClassLoader();
+
+ /**
+ * @return The ObjectFactory classes for the generated sources
+ */
+ public List<Class<?>> getObjectFactories();
/**
* It return directly the method to invoke the specified action on specified
Modified:
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java
===================================================================
---
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2013-01-20
22:41:17 UTC (rev 458)
+++
core/trunk/core/src/main/java/org/jboss/wise/core/client/impl/reflection/WSDynamicClientImpl.java 2013-01-20
23:25:56 UTC (rev 459)
@@ -30,6 +30,8 @@
import java.net.URLClassLoader;
import java.util.Collections;
import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
@@ -216,6 +218,23 @@
public synchronized final void setClassLoader(URLClassLoader classLoader) {
this.classLoader = classLoader;
}
+
+ public synchronized List<Class<?>> getObjectFactories() {
+ List<Class<?>> list = new LinkedList<Class<?>>();
+ for (String className : classNames) {
+ if (className.endsWith("ObjectFactory")) {
+ try {
+ Class<?> clazz = JavaUtils.loadJavaType(className, this.getClassLoader());
+ //TODO!! Add check on @XmlRegistry
+ list.add(clazz);
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new IllegalStateException("Error during loading/instanciating
class:" + className + " with exception message: " + e.getMessage());
+ }
+ }
+ }
+ return list;
+ }
/**
* {@inheritDoc}
Show replies by date