| Commit in servicemix/base/src/main/java/org/servicemix/components on MAIN | |||
| util/TransformComponentSupport.java | +28 | -1 | 1.5 -> 1.6 |
| xslt/XsltComponent.java | +1 | -21 | 1.8 -> 1.9 |
| +29 | -22 | ||
Added JAX-WS component directory
servicemix/base/src/main/java/org/servicemix/components/util
diff -u -r1.5 -r1.6 --- TransformComponentSupport.java 2 Aug 2005 16:30:23 -0000 1.5 +++ TransformComponentSupport.java 31 Aug 2005 15:39:38 -0000 1.6 @@ -26,12 +26,17 @@
import javax.jbi.messaging.MessagingException; import javax.jbi.messaging.NormalizedMessage;
+import java.util.Iterator; +
/** * A useful base class for a transform component. *
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.6 $
*/
public abstract class TransformComponentSupport extends ComponentSupport implements MessageExchangeListener {
+ private boolean copyProperties = true; + +
public void onMessageExchange(MessageExchange exchange) throws MessagingException {
NormalizedMessage in = exchange.getMessage("in");
if (in == null) {
@@ -70,4 +75,26 @@
* Transforms the given out message
*/
protected abstract boolean transform(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) throws MessagingException;
+
+
+ public boolean isCopyProperties() {
+ return copyProperties;
+ }
+
+
+ public void setCopyProperties(boolean copyProperties) {
+ this.copyProperties = copyProperties;
+ }
+
+
+ protected void copyProperties(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) {
+ if (isCopyProperties()) {
+ for (Iterator iter = in.getPropertyNames().iterator(); iter.hasNext();) {
+ String name = (String) iter.next();
+ Object value = in.getProperty(name);
+ out.setProperty(name, value);
+
+ }
+ }
+ }
}
servicemix/base/src/main/java/org/servicemix/components/xslt
diff -u -r1.8 -r1.9 --- XsltComponent.java 31 Aug 2005 11:43:25 -0000 1.8 +++ XsltComponent.java 31 Aug 2005 15:39:38 -0000 1.9 @@ -47,7 +47,7 @@
* href="">JAXP</a> to perform the XSLT * transformation. *
- * @version $Revision: 1.8 $
+ * @version $Revision: 1.9 $
*/
public class XsltComponent extends TransformComponentSupport implements MessageExchangeListener {
@@ -56,7 +56,6 @@
private Resource xsltResource;
private Templates templates;
private boolean disableOutput;
- private boolean copyProperties = true;
private boolean useStringBuffer = true;
// Properties
@@ -101,14 +100,6 @@
this.disableOutput = disableOutput;
}
- public boolean isCopyProperties() {
- return copyProperties;
- }
-
- public void setCopyProperties(boolean copyProperties) {
- this.copyProperties = copyProperties;
- }
-
public boolean isUseStringBuffer() {
return useStringBuffer;
}
@@ -149,17 +140,6 @@
Result result = new StreamResult(buffer);
transformer.transform(in.getContent(), result);
out.setContent(new BytesSource(buffer.toByteArray()));
- }
- }
-
- protected void copyProperties(MessageExchange exchange, NormalizedMessage in, NormalizedMessage out) {
- if (isCopyProperties()) {
- for (Iterator iter = in.getPropertyNames().iterator(); iter.hasNext();) {
- String name = (String) iter.next();
- Object value = in.getProperty(name);
- out.setProperty(name, value);
-
- }
}
}
