Author: objectiser
Date: 2010-11-16 18:45:23 -0500 (Tue, 16 Nov 2010)
New Revision: 1112
Modified:
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java
Log:
Removed dependency on another ODE class.
Modified: trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java 2010-11-16
22:50:58 UTC (rev 1111)
+++
trunk/runtime/engine/src/main/java/org/jboss/soa/si/ws/SOAPMessageAdapter.java 2010-11-16
23:45:23 UTC (rev 1112)
@@ -23,7 +23,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.ode.utils.stl.CollectionsX;
import org.apache.ode.utils.wsdl.WsdlUtils;
import org.apache.xerces.jaxp.DocumentBuilderFactoryImpl;
import org.jboss.soa.si.MessageAdapter;
@@ -553,7 +552,7 @@
} */
public static <T> T getFirstExtensibilityElement(ElementExtensible parent,
Class<T> cls) {
- Collection<T> ee = CollectionsX.filter(parent.getExtensibilityElements(),
cls);
+ Collection<T> ee = filter(parent.getExtensibilityElements(), cls);
return ee.isEmpty() ? null : ee.iterator().next();
@@ -564,7 +563,7 @@
}
public static List<SOAPHeader> getSOAPHeaders(ElementExtensible eee) {
- return CollectionsX.filter(new ArrayList<SOAPHeader>(),
(Collection<Object>) eee.getExtensibilityElements(),
+ return filter(new ArrayList<SOAPHeader>(), (Collection<Object>)
eee.getExtensibilityElements(),
SOAPHeader.class);
}
@@ -764,4 +763,23 @@
}
return null;
}
+
+ public static <C extends Collection<T>, S, T extends S> C filter(C newList,
Iterator<S> iterator, Class<T> t) {
+ while (iterator.hasNext()) {
+ S next = iterator.next();
+ if (t.isAssignableFrom(next.getClass())) {
+ newList.add((T) next);
+ }
+ }
+ return newList;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static <T> Collection<T> filter(Collection src, final Class<T>
aClass) {
+ return filter(new ArrayList<T>(src.size()), src.iterator(), aClass);
+ }
+
+ public static <C extends Collection<T>, S, T extends S> C filter(C dest,
Collection<S> src, Class<T> t) {
+ return filter(dest, src.iterator(), t);
+ }
}