You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by ch...@apache.org on 2006/02/22 00:40:29 UTC
svn commit: r379627 [12/34] - in /incubator/servicemix/trunk: ./ etc/
sandbox/servicemix-wsn-1.2/src/sa/META-INF/
sandbox/servicemix-wsn-1.2/src/su/META-INF/ servicemix-assembly/
servicemix-assembly/src/main/assembly/ servicemix-assembly/src/main/relea...
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReader.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReader.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReader.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReader.java Tue Feb 21 15:40:05 2006
@@ -1,294 +1,294 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.jaxp;
-
-import java.util.ArrayList;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-
-import org.w3c.dom.Attr;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class W3CDOMStreamReader extends DOMStreamReader {
- private Node content;
-
- private Document document;
-
- /**
- * @param element
- */
- public W3CDOMStreamReader(Element element) {
- super(new ElementFrame(element));
-
- this.document = element.getOwnerDocument();
- }
-
- /**
- * Get the document associated with this stream.
- * @return
- */
- public Document getDocument() {
- return document;
- }
-
- /**
- * Find name spaces declaration in atrributes and move them to separate collection.
- */
- protected void newFrame(ElementFrame frame) {
- Element element = getCurrentElement();
- frame.uris = new ArrayList();
- frame.prefixes = new ArrayList();
- frame.attributes = new ArrayList();
-
- NamedNodeMap nodes = element.getAttributes();
-
- String ePrefix = element.getPrefix();
- if (ePrefix == null) {
- ePrefix = "";
- }
-
- for (int i = 0; i < nodes.getLength(); i++) {
- Node node = nodes.item(i);
- String prefix = node.getPrefix();
- String localName = node.getLocalName();
- String value = node.getNodeValue();
- String name = node.getNodeName();
-
- if (prefix == null)
- prefix = "";
-
- if (name != null && name.equals("xmlns")) {
- frame.uris.add(value);
- frame.prefixes.add("");
- } else if (prefix.length() > 0 && prefix.equals("xmlns")) {
- frame.uris.add(value);
- frame.prefixes.add(localName);
- } else if (name.startsWith("xmlns:")) {
- prefix = name.substring(6);
- frame.uris.add(value);
- frame.prefixes.add(prefix);
- } else {
- frame.attributes.add(node);
- }
- }
- }
-
- protected void endElement() {
- super.endElement();
- }
-
- Element getCurrentElement() {
- return (Element) getCurrentFrame().element;
- }
-
- protected ElementFrame getChildFrame(int currentChild) {
- return new ElementFrame(getCurrentElement().getChildNodes().item(
- currentChild));
- }
-
- protected int getChildCount() {
- return getCurrentElement().getChildNodes().getLength();
- }
-
- protected int moveToChild(int currentChild) {
- this.content = getCurrentElement().getChildNodes().item(currentChild);
-
- if (content instanceof Text)
- return CHARACTERS;
- else if (content instanceof Element)
- return START_ELEMENT;
- else if (content instanceof CDATASection)
- return CDATA;
- else if (content instanceof Comment)
- return CHARACTERS;
- else if (content instanceof EntityReference)
- return ENTITY_REFERENCE;
-
- throw new IllegalStateException();
- }
-
- public String getElementText() throws XMLStreamException {
- return getText();
- }
-
- public String getNamespaceURI(String prefix) {
- int index = getCurrentFrame().prefixes.indexOf(prefix);
- if (index == -1)
- return null;
-
- return (String) getCurrentFrame().uris.get(index);
- }
-
- public String getAttributeValue(String ns, String local) {
- if (ns == null || ns.equals(""))
- return getCurrentElement().getAttribute(local);
- else
- return getCurrentElement().getAttributeNS(ns, local);
- }
-
- public int getAttributeCount() {
- return getCurrentFrame().attributes.size();
- }
-
- Attr getAttribute(int i) {
- return (Attr) getCurrentFrame().attributes.get(i);
- }
-
- private String getLocalName(Attr attr) {
-
- String name = attr.getLocalName();
- if (name == null) {
- name = attr.getNodeName();
- }
- return name;
- }
-
- public QName getAttributeName(int i) {
- Attr at = getAttribute(i);
-
- String prefix = at.getPrefix();
- String ln = getLocalName(at);
- //at.getNodeName();
- String ns = at.getNamespaceURI();
-
- if (prefix == null) {
- return new QName(ns, ln);
- } else {
- return new QName(ns, ln, prefix);
- }
- }
-
- public String getAttributeNamespace(int i) {
- return getAttribute(i).getNamespaceURI();
- }
-
- public String getAttributeLocalName(int i) {
- Attr attr = getAttribute(i);
- String name = getLocalName(attr);
- return name;
- }
-
- public String getAttributePrefix(int i) {
- return getAttribute(i).getPrefix();
- }
-
- public String getAttributeType(int i) {
- return toStaxType(getAttribute(i).getNodeType());
- }
-
- public static String toStaxType(short jdom) {
- switch (jdom) {
- default:
- return null;
- }
- }
-
- public String getAttributeValue(int i) {
- return getAttribute(i).getValue();
- }
-
- public boolean isAttributeSpecified(int i) {
- return getAttribute(i).getValue() != null;
- }
-
- public int getNamespaceCount() {
- return getCurrentFrame().prefixes.size();
- }
-
- public String getNamespacePrefix(int i) {
- return (String) getCurrentFrame().prefixes.get(i);
- }
-
- public String getNamespaceURI(int i) {
- return (String) getCurrentFrame().uris.get(i);
- }
-
- public NamespaceContext getNamespaceContext() {
- throw new UnsupportedOperationException();
- }
-
- public String getText() {
- Node node = getCurrentElement().getChildNodes().item(getCurrentFrame().currentChild);
- return node.getNodeValue();
- }
-
- public char[] getTextCharacters() {
- return getText().toCharArray();
- }
-
- public int getTextStart() {
- return 0;
- }
-
- public int getTextLength() {
- return getText().length();
- }
-
- public String getEncoding() {
- return null;
- }
-
- public QName getName() {
- Element el = getCurrentElement();
-
- String prefix = getPrefix();
- String ln = getLocalName();
-
- if (prefix == null) {
- return new QName(el.getNamespaceURI(), ln);
- } else {
- return new QName(el.getNamespaceURI(), ln, prefix);
- }
- }
-
- public String getLocalName() {
- String name = getCurrentElement().getLocalName();
- // When the element has no namespaces, null is returned
- if (name == null) {
- name = getCurrentElement().getNodeName();
- }
- return name;
- }
-
- public String getNamespaceURI() {
- return getCurrentElement().getNamespaceURI();
- }
-
- public String getPrefix() {
- String prefix = getCurrentElement().getPrefix();
- if (prefix == null) {
- prefix = "";
- }
- return prefix;
- }
-
- public String getPITarget() {
- throw new UnsupportedOperationException();
- }
-
- public String getPIData() {
- throw new UnsupportedOperationException();
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.jaxp;
+
+import java.util.ArrayList;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.EntityReference;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+public class W3CDOMStreamReader extends DOMStreamReader {
+ private Node content;
+
+ private Document document;
+
+ /**
+ * @param element
+ */
+ public W3CDOMStreamReader(Element element) {
+ super(new ElementFrame(element));
+
+ this.document = element.getOwnerDocument();
+ }
+
+ /**
+ * Get the document associated with this stream.
+ * @return
+ */
+ public Document getDocument() {
+ return document;
+ }
+
+ /**
+ * Find name spaces declaration in atrributes and move them to separate collection.
+ */
+ protected void newFrame(ElementFrame frame) {
+ Element element = getCurrentElement();
+ frame.uris = new ArrayList();
+ frame.prefixes = new ArrayList();
+ frame.attributes = new ArrayList();
+
+ NamedNodeMap nodes = element.getAttributes();
+
+ String ePrefix = element.getPrefix();
+ if (ePrefix == null) {
+ ePrefix = "";
+ }
+
+ for (int i = 0; i < nodes.getLength(); i++) {
+ Node node = nodes.item(i);
+ String prefix = node.getPrefix();
+ String localName = node.getLocalName();
+ String value = node.getNodeValue();
+ String name = node.getNodeName();
+
+ if (prefix == null)
+ prefix = "";
+
+ if (name != null && name.equals("xmlns")) {
+ frame.uris.add(value);
+ frame.prefixes.add("");
+ } else if (prefix.length() > 0 && prefix.equals("xmlns")) {
+ frame.uris.add(value);
+ frame.prefixes.add(localName);
+ } else if (name.startsWith("xmlns:")) {
+ prefix = name.substring(6);
+ frame.uris.add(value);
+ frame.prefixes.add(prefix);
+ } else {
+ frame.attributes.add(node);
+ }
+ }
+ }
+
+ protected void endElement() {
+ super.endElement();
+ }
+
+ Element getCurrentElement() {
+ return (Element) getCurrentFrame().element;
+ }
+
+ protected ElementFrame getChildFrame(int currentChild) {
+ return new ElementFrame(getCurrentElement().getChildNodes().item(
+ currentChild));
+ }
+
+ protected int getChildCount() {
+ return getCurrentElement().getChildNodes().getLength();
+ }
+
+ protected int moveToChild(int currentChild) {
+ this.content = getCurrentElement().getChildNodes().item(currentChild);
+
+ if (content instanceof Text)
+ return CHARACTERS;
+ else if (content instanceof Element)
+ return START_ELEMENT;
+ else if (content instanceof CDATASection)
+ return CDATA;
+ else if (content instanceof Comment)
+ return CHARACTERS;
+ else if (content instanceof EntityReference)
+ return ENTITY_REFERENCE;
+
+ throw new IllegalStateException();
+ }
+
+ public String getElementText() throws XMLStreamException {
+ return getText();
+ }
+
+ public String getNamespaceURI(String prefix) {
+ int index = getCurrentFrame().prefixes.indexOf(prefix);
+ if (index == -1)
+ return null;
+
+ return (String) getCurrentFrame().uris.get(index);
+ }
+
+ public String getAttributeValue(String ns, String local) {
+ if (ns == null || ns.equals(""))
+ return getCurrentElement().getAttribute(local);
+ else
+ return getCurrentElement().getAttributeNS(ns, local);
+ }
+
+ public int getAttributeCount() {
+ return getCurrentFrame().attributes.size();
+ }
+
+ Attr getAttribute(int i) {
+ return (Attr) getCurrentFrame().attributes.get(i);
+ }
+
+ private String getLocalName(Attr attr) {
+
+ String name = attr.getLocalName();
+ if (name == null) {
+ name = attr.getNodeName();
+ }
+ return name;
+ }
+
+ public QName getAttributeName(int i) {
+ Attr at = getAttribute(i);
+
+ String prefix = at.getPrefix();
+ String ln = getLocalName(at);
+ //at.getNodeName();
+ String ns = at.getNamespaceURI();
+
+ if (prefix == null) {
+ return new QName(ns, ln);
+ } else {
+ return new QName(ns, ln, prefix);
+ }
+ }
+
+ public String getAttributeNamespace(int i) {
+ return getAttribute(i).getNamespaceURI();
+ }
+
+ public String getAttributeLocalName(int i) {
+ Attr attr = getAttribute(i);
+ String name = getLocalName(attr);
+ return name;
+ }
+
+ public String getAttributePrefix(int i) {
+ return getAttribute(i).getPrefix();
+ }
+
+ public String getAttributeType(int i) {
+ return toStaxType(getAttribute(i).getNodeType());
+ }
+
+ public static String toStaxType(short jdom) {
+ switch (jdom) {
+ default:
+ return null;
+ }
+ }
+
+ public String getAttributeValue(int i) {
+ return getAttribute(i).getValue();
+ }
+
+ public boolean isAttributeSpecified(int i) {
+ return getAttribute(i).getValue() != null;
+ }
+
+ public int getNamespaceCount() {
+ return getCurrentFrame().prefixes.size();
+ }
+
+ public String getNamespacePrefix(int i) {
+ return (String) getCurrentFrame().prefixes.get(i);
+ }
+
+ public String getNamespaceURI(int i) {
+ return (String) getCurrentFrame().uris.get(i);
+ }
+
+ public NamespaceContext getNamespaceContext() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getText() {
+ Node node = getCurrentElement().getChildNodes().item(getCurrentFrame().currentChild);
+ return node.getNodeValue();
+ }
+
+ public char[] getTextCharacters() {
+ return getText().toCharArray();
+ }
+
+ public int getTextStart() {
+ return 0;
+ }
+
+ public int getTextLength() {
+ return getText().length();
+ }
+
+ public String getEncoding() {
+ return null;
+ }
+
+ public QName getName() {
+ Element el = getCurrentElement();
+
+ String prefix = getPrefix();
+ String ln = getLocalName();
+
+ if (prefix == null) {
+ return new QName(el.getNamespaceURI(), ln);
+ } else {
+ return new QName(el.getNamespaceURI(), ln, prefix);
+ }
+ }
+
+ public String getLocalName() {
+ String name = getCurrentElement().getLocalName();
+ // When the element has no namespaces, null is returned
+ if (name == null) {
+ name = getCurrentElement().getNodeName();
+ }
+ return name;
+ }
+
+ public String getNamespaceURI() {
+ return getCurrentElement().getNamespaceURI();
+ }
+
+ public String getPrefix() {
+ String prefix = getCurrentElement().getPrefix();
+ if (prefix == null) {
+ prefix = "";
+ }
+ return prefix;
+ }
+
+ public String getPITarget() {
+ throw new UnsupportedOperationException();
+ }
+
+ public String getPIData() {
+ throw new UnsupportedOperationException();
+ }
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/W3CDOMStreamReader.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/XMLStreamHelper.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/XMLStreamHelper.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/XMLStreamHelper.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/XMLStreamHelper.java Tue Feb 21 15:40:05 2006
@@ -1,248 +1,248 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.jaxp;
-
-import javanet.staxutils.XMLStreamReaderToContentHandler;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.AttributesImpl;
-
-/**
- * Utility methods for working with an XMLStreamWriter. Maybe push this back into
- * stax-utils project.
- *
- * @version $Revision: 1.16 $
- */
-public class XMLStreamHelper implements XMLStreamConstants {
- private static Attributes emptyAttributes = new AttributesImpl();
-
-
- /**
- * Returns true if currently at the start of an element, otherwise move forwards to
- * the next element start and return true, otherwise false is returned if the end of
- * the stream is reached.
- */
- public static boolean skipToStartOfElement(XMLStreamReader in) throws XMLStreamException {
- for (int code = in.getEventType(); code != END_DOCUMENT; code = in.next()) {
- if (code == START_ELEMENT) {
- return true;
- }
- }
- return false;
- }
-
- public static void writeStartElement(QName qname, ContentHandler handler) throws SAXException {
- handler.startElement(qname.getNamespaceURI(), qname.getLocalPart(), QNameHelper.getQualifiedName(qname), emptyAttributes);
- }
-
- public static void writeEndElement(QName qname, ContentHandler handler) throws SAXException {
- handler.endElement(qname.getNamespaceURI(), qname.getLocalPart(), QNameHelper.getQualifiedName(qname));
- }
-
-
- /**
- * Copies the current element and its conetnt to the output
- */
- public static void copy(XMLStreamReader in, XMLStreamWriter out, boolean repairing) throws XMLStreamException {
- int elementCount = 0;
- for (int code = in.getEventType(); in.hasNext(); code = in.next()) {
- elementCount = copyOne(in, out, repairing, code, elementCount);
- }
- while (elementCount-- > 0) {
- out.writeEndElement();
- }
- }
-
- /**
- *
- */
- public static int copyOne(XMLStreamReader in, XMLStreamWriter out, boolean repairing, int code, int elementCount) throws XMLStreamException {
- switch (code) {
- case START_ELEMENT:
- elementCount++;
- writeStartElementAndAttributes(out, in, repairing);
- break;
-
- case END_ELEMENT:
- if (--elementCount < 0) {
- return elementCount;
- }
- out.writeEndElement();
- break;
-
- case CDATA:
- out.writeCData(in.getText());
- break;
-
- case CHARACTERS:
- out.writeCharacters(in.getText());
- break;
- }
- return elementCount;
- }
-
- public static void writeStartElement(XMLStreamWriter out, String prefix, String uri, String localName, boolean repairing) throws XMLStreamException {
- boolean map = isPrefixNotMappedToUri(out, prefix, uri);
- if (prefix != null && prefix.length() > 0) {
- if (map) {
- out.setPrefix(prefix, uri);
- }
- out.writeStartElement(prefix, localName, uri);
- if (map && !repairing) {
- out.writeNamespace(prefix, uri);
- }
- }
- else {
- boolean hasURI = uri != null && uri.length() > 0;
- if (map && hasURI) {
- out.setDefaultNamespace(uri);
- }
- out.writeStartElement(uri, localName);
- if (map && !repairing && hasURI) {
- out.writeDefaultNamespace(uri);
- }
- }
- }
-
- public static void writeStartElement(XMLStreamWriter out, QName envelopeName, boolean repairing) throws XMLStreamException {
- writeStartElement(out, envelopeName.getPrefix(), envelopeName.getNamespaceURI(), envelopeName.getLocalPart(), repairing);
- }
-
- public static void writeStartElement(XMLStreamWriter out, XMLStreamReader in, boolean repairing) throws XMLStreamException {
- String prefix = in.getPrefix();
-
- // we can avoid this step if in repairing mode
- int count = in.getNamespaceCount();
- for (int i = 0; i < count; i++) {
- String aPrefix = in.getNamespacePrefix(i);
- if (prefix == aPrefix || (prefix != null && prefix.equals(aPrefix))) {
- continue;
- }
- String uri = in.getNamespaceURI(i);
- if (isPrefixNotMappedToUri(out, aPrefix, uri)) {
- if (aPrefix != null && aPrefix.length() > 0) {
- out.setPrefix(aPrefix, uri);
- }
- else {
- out.setDefaultNamespace(uri);
- }
- }
- }
- String localName = in.getLocalName();
- String uri = in.getNamespaceURI();
- writeStartElement(out, prefix, uri, localName, repairing);
- }
-
-
- public static void writeStartElementAndAttributes(XMLStreamWriter out, XMLStreamReader in, boolean repairing) throws XMLStreamException {
- writeStartElement(out, in, repairing);
- if (!repairing) {
- writeNamespaces(out, in, in.getPrefix());
- }
- writeAttributes(out, in);
- }
-
- public static void writeAttributes(XMLStreamWriter out, XMLStreamReader in) throws XMLStreamException {
- int count = in.getAttributeCount();
- for (int i = 0; i < count; i++) {
- out.writeAttribute(in.getAttributePrefix(i),
- in.getAttributeNamespace(i),
- in.getAttributeLocalName(i),
- in.getAttributeValue(i));
- }
- }
-
- public static void writeNamespaces(XMLStreamWriter out, XMLStreamReader in, String prefixOfCurrentElement) throws XMLStreamException {
- int count = in.getNamespaceCount();
- for (int i = 0; i < count; i++) {
- String prefix = in.getNamespacePrefix(i);
- String uri = in.getNamespaceURI(i);
-
- // ROGER
- if ( prefixOfCurrentElement == null && prefix.length()==0 ) {
- continue;
- }
-
- if (prefixOfCurrentElement != null && prefixOfCurrentElement.equals(prefix)) {
- continue;
- }
- if (isPrefixNotMappedToUri(out, prefix, uri)) {
- out.writeNamespace(prefix, uri);
- }
- }
- }
-
-
- public static void writeNamespacesExcludingPrefixAndNamespace(XMLStreamWriter out, XMLStreamReader in, String ignorePrefix, String ignoreNamespace) throws XMLStreamException {
- int count = in.getNamespaceCount();
- for (int i = 0; i < count; i++) {
- String prefix = in.getNamespacePrefix(i);
- if (!ignorePrefix.equals(prefix)) {
- String uri = in.getNamespaceURI(i);
- if (!ignoreNamespace.equals(uri)) {
- out.writeNamespace(prefix, uri);
- }
- }
- }
- }
-
- public static void writeAttribute(XMLStreamWriter out, QName name, String attributeValue) throws XMLStreamException {
- writeAttribute(out, name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), attributeValue);
- }
-
- public static void writeAttribute(XMLStreamWriter out, String prefix, String namespaceURI, String localPart, String attributeValue) throws XMLStreamException {
- out.writeAttribute(prefix, namespaceURI, localPart, attributeValue);
- }
-
- protected static boolean isPrefixNotMappedToUri(XMLStreamWriter out, String prefix, String uri) {
- if (prefix == null) {
- prefix = "";
- }
- NamespaceContext context = out.getNamespaceContext();
- if (context == null) {
- return false;
- }
- String mappedUri = context.getPrefix(prefix);
- boolean map = (mappedUri == null || !mappedUri.equals(uri));
- return map;
- }
-
- /**
- * Copies the content to the SAX stream
- */
- public static void copy(XMLStreamReader in, ContentHandler contentHandler) throws XMLStreamException {
- XMLStreamReaderToContentHandler converter = new XMLStreamReaderToContentHandler(in, contentHandler);
- converter.bridge();
- }
-
- /**
- * Copies the element and its content to the SAX stream
- */
- public static void copyElement(XMLStreamReader in, ContentHandler contentHandler) throws XMLStreamException {
- copy(new FragmentStreamReader(in), contentHandler);
- }
-
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.jaxp;
+
+import javanet.staxutils.XMLStreamReaderToContentHandler;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.ContentHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.AttributesImpl;
+
+/**
+ * Utility methods for working with an XMLStreamWriter. Maybe push this back into
+ * stax-utils project.
+ *
+ * @version $Revision: 1.16 $
+ */
+public class XMLStreamHelper implements XMLStreamConstants {
+ private static Attributes emptyAttributes = new AttributesImpl();
+
+
+ /**
+ * Returns true if currently at the start of an element, otherwise move forwards to
+ * the next element start and return true, otherwise false is returned if the end of
+ * the stream is reached.
+ */
+ public static boolean skipToStartOfElement(XMLStreamReader in) throws XMLStreamException {
+ for (int code = in.getEventType(); code != END_DOCUMENT; code = in.next()) {
+ if (code == START_ELEMENT) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static void writeStartElement(QName qname, ContentHandler handler) throws SAXException {
+ handler.startElement(qname.getNamespaceURI(), qname.getLocalPart(), QNameHelper.getQualifiedName(qname), emptyAttributes);
+ }
+
+ public static void writeEndElement(QName qname, ContentHandler handler) throws SAXException {
+ handler.endElement(qname.getNamespaceURI(), qname.getLocalPart(), QNameHelper.getQualifiedName(qname));
+ }
+
+
+ /**
+ * Copies the current element and its conetnt to the output
+ */
+ public static void copy(XMLStreamReader in, XMLStreamWriter out, boolean repairing) throws XMLStreamException {
+ int elementCount = 0;
+ for (int code = in.getEventType(); in.hasNext(); code = in.next()) {
+ elementCount = copyOne(in, out, repairing, code, elementCount);
+ }
+ while (elementCount-- > 0) {
+ out.writeEndElement();
+ }
+ }
+
+ /**
+ *
+ */
+ public static int copyOne(XMLStreamReader in, XMLStreamWriter out, boolean repairing, int code, int elementCount) throws XMLStreamException {
+ switch (code) {
+ case START_ELEMENT:
+ elementCount++;
+ writeStartElementAndAttributes(out, in, repairing);
+ break;
+
+ case END_ELEMENT:
+ if (--elementCount < 0) {
+ return elementCount;
+ }
+ out.writeEndElement();
+ break;
+
+ case CDATA:
+ out.writeCData(in.getText());
+ break;
+
+ case CHARACTERS:
+ out.writeCharacters(in.getText());
+ break;
+ }
+ return elementCount;
+ }
+
+ public static void writeStartElement(XMLStreamWriter out, String prefix, String uri, String localName, boolean repairing) throws XMLStreamException {
+ boolean map = isPrefixNotMappedToUri(out, prefix, uri);
+ if (prefix != null && prefix.length() > 0) {
+ if (map) {
+ out.setPrefix(prefix, uri);
+ }
+ out.writeStartElement(prefix, localName, uri);
+ if (map && !repairing) {
+ out.writeNamespace(prefix, uri);
+ }
+ }
+ else {
+ boolean hasURI = uri != null && uri.length() > 0;
+ if (map && hasURI) {
+ out.setDefaultNamespace(uri);
+ }
+ out.writeStartElement(uri, localName);
+ if (map && !repairing && hasURI) {
+ out.writeDefaultNamespace(uri);
+ }
+ }
+ }
+
+ public static void writeStartElement(XMLStreamWriter out, QName envelopeName, boolean repairing) throws XMLStreamException {
+ writeStartElement(out, envelopeName.getPrefix(), envelopeName.getNamespaceURI(), envelopeName.getLocalPart(), repairing);
+ }
+
+ public static void writeStartElement(XMLStreamWriter out, XMLStreamReader in, boolean repairing) throws XMLStreamException {
+ String prefix = in.getPrefix();
+
+ // we can avoid this step if in repairing mode
+ int count = in.getNamespaceCount();
+ for (int i = 0; i < count; i++) {
+ String aPrefix = in.getNamespacePrefix(i);
+ if (prefix == aPrefix || (prefix != null && prefix.equals(aPrefix))) {
+ continue;
+ }
+ String uri = in.getNamespaceURI(i);
+ if (isPrefixNotMappedToUri(out, aPrefix, uri)) {
+ if (aPrefix != null && aPrefix.length() > 0) {
+ out.setPrefix(aPrefix, uri);
+ }
+ else {
+ out.setDefaultNamespace(uri);
+ }
+ }
+ }
+ String localName = in.getLocalName();
+ String uri = in.getNamespaceURI();
+ writeStartElement(out, prefix, uri, localName, repairing);
+ }
+
+
+ public static void writeStartElementAndAttributes(XMLStreamWriter out, XMLStreamReader in, boolean repairing) throws XMLStreamException {
+ writeStartElement(out, in, repairing);
+ if (!repairing) {
+ writeNamespaces(out, in, in.getPrefix());
+ }
+ writeAttributes(out, in);
+ }
+
+ public static void writeAttributes(XMLStreamWriter out, XMLStreamReader in) throws XMLStreamException {
+ int count = in.getAttributeCount();
+ for (int i = 0; i < count; i++) {
+ out.writeAttribute(in.getAttributePrefix(i),
+ in.getAttributeNamespace(i),
+ in.getAttributeLocalName(i),
+ in.getAttributeValue(i));
+ }
+ }
+
+ public static void writeNamespaces(XMLStreamWriter out, XMLStreamReader in, String prefixOfCurrentElement) throws XMLStreamException {
+ int count = in.getNamespaceCount();
+ for (int i = 0; i < count; i++) {
+ String prefix = in.getNamespacePrefix(i);
+ String uri = in.getNamespaceURI(i);
+
+ // ROGER
+ if ( prefixOfCurrentElement == null && prefix.length()==0 ) {
+ continue;
+ }
+
+ if (prefixOfCurrentElement != null && prefixOfCurrentElement.equals(prefix)) {
+ continue;
+ }
+ if (isPrefixNotMappedToUri(out, prefix, uri)) {
+ out.writeNamespace(prefix, uri);
+ }
+ }
+ }
+
+
+ public static void writeNamespacesExcludingPrefixAndNamespace(XMLStreamWriter out, XMLStreamReader in, String ignorePrefix, String ignoreNamespace) throws XMLStreamException {
+ int count = in.getNamespaceCount();
+ for (int i = 0; i < count; i++) {
+ String prefix = in.getNamespacePrefix(i);
+ if (!ignorePrefix.equals(prefix)) {
+ String uri = in.getNamespaceURI(i);
+ if (!ignoreNamespace.equals(uri)) {
+ out.writeNamespace(prefix, uri);
+ }
+ }
+ }
+ }
+
+ public static void writeAttribute(XMLStreamWriter out, QName name, String attributeValue) throws XMLStreamException {
+ writeAttribute(out, name.getPrefix(), name.getNamespaceURI(), name.getLocalPart(), attributeValue);
+ }
+
+ public static void writeAttribute(XMLStreamWriter out, String prefix, String namespaceURI, String localPart, String attributeValue) throws XMLStreamException {
+ out.writeAttribute(prefix, namespaceURI, localPart, attributeValue);
+ }
+
+ protected static boolean isPrefixNotMappedToUri(XMLStreamWriter out, String prefix, String uri) {
+ if (prefix == null) {
+ prefix = "";
+ }
+ NamespaceContext context = out.getNamespaceContext();
+ if (context == null) {
+ return false;
+ }
+ String mappedUri = context.getPrefix(prefix);
+ boolean map = (mappedUri == null || !mappedUri.equals(uri));
+ return map;
+ }
+
+ /**
+ * Copies the content to the SAX stream
+ */
+ public static void copy(XMLStreamReader in, ContentHandler contentHandler) throws XMLStreamException {
+ XMLStreamReaderToContentHandler converter = new XMLStreamReaderToContentHandler(in, contentHandler);
+ converter.bridge();
+ }
+
+ /**
+ * Copies the element and its content to the SAX stream
+ */
+ public static void copyElement(XMLStreamReader in, ContentHandler contentHandler) throws XMLStreamException {
+ copy(new FragmentStreamReader(in), contentHandler);
+ }
+
+
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/jaxp/XMLStreamHelper.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseSystemService.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseSystemService.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseSystemService.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseSystemService.java Tue Feb 21 15:40:05 2006
@@ -1,63 +1,63 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.management;
-
-import javax.jbi.JBIException;
-
-import org.apache.servicemix.jbi.container.JBIContainer;
-
-public abstract class BaseSystemService extends BaseLifeCycle {
-
- protected JBIContainer container;
-
- /**
- * Get the name of the item
- * @return the name
- */
- public String getName() {
- String name = getClass().getName();
- int index = name.lastIndexOf(".");
- if (index >= 0 && (index+1) < name.length()) {
- name = name.substring(index+1);
- }
- return name;
- }
-
- /**
- * Get the type of the item
- * @return the type
- */
- public String getType() {
- return "SystemService";
- }
-
- public void init(JBIContainer container) throws JBIException {
- this.container = container;
- container.getManagementContext().registerSystemService(this, getServiceMBean());
-
- }
-
- public void shutDown() throws JBIException {
- stop();
- super.shutDown();
- if (container != null && container.getManagementContext() != null) {
- container.getManagementContext().unregisterMBean(this);
- }
- }
-
- protected abstract Class getServiceMBean();
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.management;
+
+import javax.jbi.JBIException;
+
+import org.apache.servicemix.jbi.container.JBIContainer;
+
+public abstract class BaseSystemService extends BaseLifeCycle {
+
+ protected JBIContainer container;
+
+ /**
+ * Get the name of the item
+ * @return the name
+ */
+ public String getName() {
+ String name = getClass().getName();
+ int index = name.lastIndexOf(".");
+ if (index >= 0 && (index+1) < name.length()) {
+ name = name.substring(index+1);
+ }
+ return name;
+ }
+
+ /**
+ * Get the type of the item
+ * @return the type
+ */
+ public String getType() {
+ return "SystemService";
+ }
+
+ public void init(JBIContainer container) throws JBIException {
+ this.container = container;
+ container.getManagementContext().registerSystemService(this, getServiceMBean());
+
+ }
+
+ public void shutDown() throws JBIException {
+ stop();
+ super.shutDown();
+ if (container != null && container.getManagementContext() != null) {
+ container.getManagementContext().unregisterMBean(this);
+ }
+ }
+
+ protected abstract Class getServiceMBean();
+
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/BaseSystemService.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/MBeanServerContext.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListComponentTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListComponentTask.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListComponentTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListComponentTask.java Tue Feb 21 15:40:05 2006
@@ -1,123 +1,123 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.management.task;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
-import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
-import org.apache.tools.ant.BuildException;
-
-import javax.management.ObjectName;
-import java.io.IOException;
-
-/**
- * ListComponentTask
- *
- * @version $Revision:
- */
-public class ListComponentTask extends JbiTask {
- private static final Log log = LogFactory.getLog(DeployedAssembliesTask.class);
- private String sharedLibraryName;
- private String serviceAssemblyName;
- private String bindingComponentName;
- private String state;
-
- /**
- *
- * @return shared library name
- */
- public String getSharedLibraryName() {
- return sharedLibraryName;
- }
-
- /**
- *
- * @param sharedLibraryName
- */
- public void setSharedLibraryName(String sharedLibraryName) {
- this.sharedLibraryName = sharedLibraryName;
- }
-
- /**
- *
- * @return service assembly name
- */
- public String getServiceAssemblyName() {
- return serviceAssemblyName;
- }
-
- /**
- *
- * @param serviceAssemblyName
- */
- public void setServiceAssemblyName(String serviceAssemblyName) {
- this.serviceAssemblyName = serviceAssemblyName;
- }
-
- /**
- *
- * @return binding component name
- */
- public String getBindingComponentName() {
- return bindingComponentName;
- }
-
- /**
- *
- * @param bindingComponentName
- */
- public void setBindingComponentName(String bindingComponentName) {
- this.bindingComponentName = bindingComponentName;
- }
-
- /**
- *
- * @return component state
- */
- public String getState() {
- return state;
- }
-
- /**
- *
- * @param state Sets the component state
- */
- public void setState(String state) {
- this.state = state;
- }
-
- /**
- * execute the task
- *
- * @throws BuildException
- */
- public void execute() throws BuildException {
- try {
- AdminCommandsServiceMBean acs;
- acs = getAdminCommandsService();
- String result = acs.listComponents(false, true, this.getState(), this.getSharedLibraryName(), this.getServiceAssemblyName());
- System.out.println(result);
- } catch (IOException e) {
- log.error("Caught an exception getting the admin commands service", e);
- throw new BuildException("exception " + e);
- } catch (Exception e) {
- log.error("Error listing component", e);
- throw new BuildException("exception " + e);
- }
-
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.management.task;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.management.ManagementContextMBean;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+import javax.management.ObjectName;
+import java.io.IOException;
+
+/**
+ * ListComponentTask
+ *
+ * @version $Revision:
+ */
+public class ListComponentTask extends JbiTask {
+ private static final Log log = LogFactory.getLog(DeployedAssembliesTask.class);
+ private String sharedLibraryName;
+ private String serviceAssemblyName;
+ private String bindingComponentName;
+ private String state;
+
+ /**
+ *
+ * @return shared library name
+ */
+ public String getSharedLibraryName() {
+ return sharedLibraryName;
+ }
+
+ /**
+ *
+ * @param sharedLibraryName
+ */
+ public void setSharedLibraryName(String sharedLibraryName) {
+ this.sharedLibraryName = sharedLibraryName;
+ }
+
+ /**
+ *
+ * @return service assembly name
+ */
+ public String getServiceAssemblyName() {
+ return serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @param serviceAssemblyName
+ */
+ public void setServiceAssemblyName(String serviceAssemblyName) {
+ this.serviceAssemblyName = serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @return binding component name
+ */
+ public String getBindingComponentName() {
+ return bindingComponentName;
+ }
+
+ /**
+ *
+ * @param bindingComponentName
+ */
+ public void setBindingComponentName(String bindingComponentName) {
+ this.bindingComponentName = bindingComponentName;
+ }
+
+ /**
+ *
+ * @return component state
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ *
+ * @param state Sets the component state
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void execute() throws BuildException {
+ try {
+ AdminCommandsServiceMBean acs;
+ acs = getAdminCommandsService();
+ String result = acs.listComponents(false, true, this.getState(), this.getSharedLibraryName(), this.getServiceAssemblyName());
+ System.out.println(result);
+ } catch (IOException e) {
+ log.error("Caught an exception getting the admin commands service", e);
+ throw new BuildException("exception " + e);
+ } catch (Exception e) {
+ log.error("Error listing component", e);
+ throw new BuildException("exception " + e);
+ }
+
+ }
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListComponentTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListEnginesTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListEnginesTask.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListEnginesTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListEnginesTask.java Tue Feb 21 15:40:05 2006
@@ -1,108 +1,108 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.management.task;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
-import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
-import org.apache.tools.ant.BuildException;
-
-import javax.management.ObjectName;
-import java.io.IOException;
-
-/**
- * ListEnginesTask
- *
- * @version $Revision:
- */
-public class ListEnginesTask extends JbiTask {
- private static final Log log = LogFactory.getLog(ListEnginesTask.class);
- private String state;
- private String serviceAssemblyName;
- private String sharedLibraryName;
-
- /**
- *
- * @return the state
- */
- public String getState() {
- return state;
- }
-
- /**
- *
- * @param state Sets the state
- */
- public void setState(String state) {
- this.state = state;
- }
-
- /**
- *
- * @return service assembly name
- */
- public String getServiceAssemblyName() {
- return serviceAssemblyName;
- }
-
- /**
- *
- * @param serviceAssemblyName the service assembly name to set
- */
- public void setServiceAssemblyName(String serviceAssemblyName) {
- this.serviceAssemblyName = serviceAssemblyName;
- }
-
- /**
- *
- * @return The shared library name
- */
- public String getSharedLibraryName() {
- return sharedLibraryName;
- }
-
- /**
- *
- * @param sharedLibraryName Sets the shared library name
- */
- public void setSharedLibraryName(String sharedLibraryName) {
- this.sharedLibraryName = sharedLibraryName;
- }
-
-
- /**
- * execute the task
- *
- * @throws BuildException
- */
- public void execute() throws BuildException {
- try {
- AdminCommandsServiceMBean acs = getAdminCommandsService();
- String result = acs.listComponents(true, false, this.getState(), this.getSharedLibraryName(), this.getServiceAssemblyName());
- System.out.println(result);
- } catch (IOException e) {
- log.error("Caught an exception getting deployed assemblies", e);
- throw new BuildException(e);
-
- } catch (Exception e) {
- log.error("Caught an exception getting deployed assemblies", e);
- throw new BuildException("exception " + e);
- }
-
- }
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.management.task;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.jbi.management.ManagementContextMBean;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
+import org.apache.tools.ant.BuildException;
+
+import javax.management.ObjectName;
+import java.io.IOException;
+
+/**
+ * ListEnginesTask
+ *
+ * @version $Revision:
+ */
+public class ListEnginesTask extends JbiTask {
+ private static final Log log = LogFactory.getLog(ListEnginesTask.class);
+ private String state;
+ private String serviceAssemblyName;
+ private String sharedLibraryName;
+
+ /**
+ *
+ * @return the state
+ */
+ public String getState() {
+ return state;
+ }
+
+ /**
+ *
+ * @param state Sets the state
+ */
+ public void setState(String state) {
+ this.state = state;
+ }
+
+ /**
+ *
+ * @return service assembly name
+ */
+ public String getServiceAssemblyName() {
+ return serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @param serviceAssemblyName the service assembly name to set
+ */
+ public void setServiceAssemblyName(String serviceAssemblyName) {
+ this.serviceAssemblyName = serviceAssemblyName;
+ }
+
+ /**
+ *
+ * @return The shared library name
+ */
+ public String getSharedLibraryName() {
+ return sharedLibraryName;
+ }
+
+ /**
+ *
+ * @param sharedLibraryName Sets the shared library name
+ */
+ public void setSharedLibraryName(String sharedLibraryName) {
+ this.sharedLibraryName = sharedLibraryName;
+ }
+
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void execute() throws BuildException {
+ try {
+ AdminCommandsServiceMBean acs = getAdminCommandsService();
+ String result = acs.listComponents(true, false, this.getState(), this.getSharedLibraryName(), this.getServiceAssemblyName());
+ System.out.println(result);
+ } catch (IOException e) {
+ log.error("Caught an exception getting deployed assemblies", e);
+ throw new BuildException(e);
+
+ } catch (Exception e) {
+ log.error("Caught an exception getting deployed assemblies", e);
+ throw new BuildException("exception " + e);
+ }
+
+ }
+
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListEnginesTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListLibrariesTask.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListLibrariesTask.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListLibrariesTask.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListLibrariesTask.java Tue Feb 21 15:40:05 2006
@@ -1,90 +1,90 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.management.task;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.tools.ant.BuildException;
-import org.apache.servicemix.jbi.management.ManagementContextMBean;
-import org.apache.servicemix.jbi.management.task.JbiTask;
-import org.apache.servicemix.jbi.management.task.DeployedAssembliesTask;
-import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
-
-import javax.management.ObjectName;
-import java.io.IOException;
-
-/**
- * ListLibrariesTask
- *
- * @version $Revision:
- */
-public class ListLibrariesTask extends JbiTask {
- private static final Log log = LogFactory.getLog(DeployedAssembliesTask.class);
- private String componentName;
- private String sharedLibraryName;
-
- /**
- *
- * @return component name
- */
- public String getComponentName() {
- return componentName;
- }
-
- /**
- *
- * @param componentName The component name to set
- */
- public void setComponentName(String componentName) {
- this.componentName = componentName;
- }
-
- /**
- *
- * @return shared library name
- */
- public String getSharedLibraryName() {
- return sharedLibraryName;
- }
-
- /**
- *
- * @param sharedLibraryName the shared library name to set
- */
- public void setSharedLibraryName(String sharedLibraryName) {
- this.sharedLibraryName = sharedLibraryName;
- }
-
- /**
- * execute the task
- *
- * @throws BuildException
- */
- public void execute() throws BuildException {
- try {
- AdminCommandsServiceMBean acs;
- acs = getAdminCommandsService();
- String result = acs.listSharedLibraries(this.getComponentName(), this.getSharedLibraryName());
- System.out.println(result);
- } catch (IOException e) {
- log.error("Caught an exception getting admin commands service", e);
- throw new BuildException(e);
- } catch (Exception e) {
- log.error("Error listing shared libraries", e);
- throw new BuildException(e);
- }
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.management.task;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tools.ant.BuildException;
+import org.apache.servicemix.jbi.management.ManagementContextMBean;
+import org.apache.servicemix.jbi.management.task.JbiTask;
+import org.apache.servicemix.jbi.management.task.DeployedAssembliesTask;
+import org.apache.servicemix.jbi.framework.AdminCommandsServiceMBean;
+
+import javax.management.ObjectName;
+import java.io.IOException;
+
+/**
+ * ListLibrariesTask
+ *
+ * @version $Revision:
+ */
+public class ListLibrariesTask extends JbiTask {
+ private static final Log log = LogFactory.getLog(DeployedAssembliesTask.class);
+ private String componentName;
+ private String sharedLibraryName;
+
+ /**
+ *
+ * @return component name
+ */
+ public String getComponentName() {
+ return componentName;
+ }
+
+ /**
+ *
+ * @param componentName The component name to set
+ */
+ public void setComponentName(String componentName) {
+ this.componentName = componentName;
+ }
+
+ /**
+ *
+ * @return shared library name
+ */
+ public String getSharedLibraryName() {
+ return sharedLibraryName;
+ }
+
+ /**
+ *
+ * @param sharedLibraryName the shared library name to set
+ */
+ public void setSharedLibraryName(String sharedLibraryName) {
+ this.sharedLibraryName = sharedLibraryName;
+ }
+
+ /**
+ * execute the task
+ *
+ * @throws BuildException
+ */
+ public void execute() throws BuildException {
+ try {
+ AdminCommandsServiceMBean acs;
+ acs = getAdminCommandsService();
+ String result = acs.listSharedLibraries(this.getComponentName(), this.getSharedLibraryName());
+ System.out.println(result);
+ } catch (IOException e) {
+ log.error("Caught an exception getting admin commands service", e);
+ throw new BuildException(e);
+ } catch (Exception e) {
+ log.error("Error listing shared libraries", e);
+ throw new BuildException(e);
+ }
+ }
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/management/task/ListLibrariesTask.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/BrokerMBean.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/BrokerMBean.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/BrokerMBean.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/BrokerMBean.java Tue Feb 21 15:40:05 2006
@@ -1,22 +1,22 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.nmr;
-
-import javax.jbi.management.LifeCycleMBean;
-
-public interface BrokerMBean extends LifeCycleMBean {
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.nmr;
+
+import javax.jbi.management.LifeCycleMBean;
+
+public interface BrokerMBean extends LifeCycleMBean {
+
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/nmr/BrokerMBean.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FastStack.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FastStack.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FastStack.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FastStack.java Tue Feb 21 15:40:05 2006
@@ -1,37 +1,37 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.util;
-
-import java.util.ArrayList;
-
-public class FastStack extends ArrayList {
-
- public void push(Object o) {
- add(o);
- }
-
- public Object pop() {
- return remove(size() - 1);
- }
-
- public boolean empty() {
- return size() == 0;
- }
-
- public Object peek() {
- return get(size() - 1);
- }
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.util;
+
+import java.util.ArrayList;
+
+public class FastStack extends ArrayList {
+
+ public void push(Object o) {
+ add(o);
+ }
+
+ public Object pop() {
+ return remove(size() - 1);
+ }
+
+ public boolean empty() {
+ return size() == 0;
+ }
+
+ public Object peek() {
+ return get(size() - 1);
+ }
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/FastStack.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/StreamDataSource.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/StreamDataSource.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/StreamDataSource.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/StreamDataSource.java Tue Feb 21 15:40:05 2006
@@ -1,74 +1,74 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.util;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-import javax.activation.DataSource;
-
-/**
- * Stream DataSource for Mail and message attachments .
- * @author <a href="mailto:gnodet@logicblaze.com"> Guillaume Nodet</a>
- * @since 3.0
- */
-public class StreamDataSource implements DataSource {
-
- private InputStream in;
- private String contentType;
- private String name;
-
- public StreamDataSource(InputStream in) {
- this(in, null, null);
- }
-
- public StreamDataSource(InputStream in, String contentType) {
- this(in, contentType, null);
- }
-
- public StreamDataSource(InputStream in, String contentType, String name) {
- this.in = in;
- this.contentType = contentType;
- this.name = name;
- }
-
- public InputStream getInputStream() throws IOException {
- if (in == null) throw new IOException("no data");
- return in;
- }
-
- public OutputStream getOutputStream() throws IOException {
- throw new IOException("getOutputStream() not supported");
- }
-
- public String getContentType() {
- return contentType;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setContentType(String contentType) {
- this.contentType = contentType;
- }
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import javax.activation.DataSource;
+
+/**
+ * Stream DataSource for Mail and message attachments .
+ * @author <a href="mailto:gnodet@logicblaze.com"> Guillaume Nodet</a>
+ * @since 3.0
+ */
+public class StreamDataSource implements DataSource {
+
+ private InputStream in;
+ private String contentType;
+ private String name;
+
+ public StreamDataSource(InputStream in) {
+ this(in, null, null);
+ }
+
+ public StreamDataSource(InputStream in, String contentType) {
+ this(in, contentType, null);
+ }
+
+ public StreamDataSource(InputStream in, String contentType, String name) {
+ this.in = in;
+ this.contentType = contentType;
+ this.name = name;
+ }
+
+ public InputStream getInputStream() throws IOException {
+ if (in == null) throw new IOException("no data");
+ return in;
+ }
+
+ public OutputStream getOutputStream() throws IOException {
+ throw new IOException("getOutputStream() not supported");
+ }
+
+ public String getContentType() {
+ return contentType;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setContentType(String contentType) {
+ this.contentType = contentType;
+ }
+
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/java/org/apache/servicemix/jbi/util/StreamDataSource.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/main/resources/META-INF/DISCLAIMER.txt
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/main/resources/META-INF/DISCLAIMER.txt?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/main/resources/META-INF/DISCLAIMER.txt (original)
+++ incubator/servicemix/trunk/servicemix-core/src/main/resources/META-INF/DISCLAIMER.txt Tue Feb 21 15:40:05 2006
@@ -1,7 +1,7 @@
-ActiveMQ is an effort undergoing incubation at the Apache Software Foundation
-(ASF), sponsored by the Geronimo PMC. Incubation is required of all newly
-accepted projects until a further review indicates that the infrastructure,
-communications, and decision making process have stabilized in a manner
-consistent with other successful ASF projects. While incubation status is not
-necessarily a reflection of the completeness or stability of the code, it does
+ActiveMQ is an effort undergoing incubation at the Apache Software Foundation
+(ASF), sponsored by the Geronimo PMC. Incubation is required of all newly
+accepted projects until a further review indicates that the infrastructure,
+communications, and decision making process have stabilized in a manner
+consistent with other successful ASF projects. While incubation status is not
+necessarily a reflection of the completeness or stability of the code, it does
indicate that the project has yet to be fully endorsed by the ASF.
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/resources/META-INF/DISCLAIMER.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/servicemix-core/src/main/resources/META-INF/LICENSE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/test/components/logger-component-1.0-exploded.jar/META-INF/DISCLAIMER.txt
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/components/logger-component-1.0-exploded.jar/META-INF/DISCLAIMER.txt?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/components/logger-component-1.0-exploded.jar/META-INF/DISCLAIMER.txt (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/components/logger-component-1.0-exploded.jar/META-INF/DISCLAIMER.txt Tue Feb 21 15:40:05 2006
@@ -1,7 +1,7 @@
-ActiveMQ is an effort undergoing incubation at the Apache Software Foundation
-(ASF), sponsored by the Geronimo PMC. Incubation is required of all newly
-accepted projects until a further review indicates that the infrastructure,
-communications, and decision making process have stabilized in a manner
-consistent with other successful ASF projects. While incubation status is not
-necessarily a reflection of the completeness or stability of the code, it does
+ActiveMQ is an effort undergoing incubation at the Apache Software Foundation
+(ASF), sponsored by the Geronimo PMC. Incubation is required of all newly
+accepted projects until a further review indicates that the infrastructure,
+communications, and decision making process have stabilized in a manner
+consistent with other successful ASF projects. While incubation status is not
+necessarily a reflection of the completeness or stability of the code, it does
indicate that the project has yet to be fully endorsed by the ASF.
Propchange: incubator/servicemix/trunk/servicemix-core/src/test/components/logger-component-1.0-exploded.jar/META-INF/DISCLAIMER.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/servicemix/trunk/servicemix-core/src/test/components/logger-component-1.0-exploded.jar/META-INF/LICENSE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/components/util/CopyTransformerTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/components/util/CopyTransformerTest.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/components/util/CopyTransformerTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/components/util/CopyTransformerTest.java Tue Feb 21 15:40:05 2006
@@ -1,45 +1,45 @@
-package org.apache.servicemix.components.util;
-
-import java.io.Reader;
-import java.io.StringReader;
-
-import javax.jbi.messaging.NormalizedMessage;
-import javax.xml.transform.Source;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-
-import junit.framework.TestCase;
-
-import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.apache.servicemix.jbi.messaging.NormalizedMessageImpl;
-import org.xml.sax.InputSource;
-
-public class CopyTransformerTest extends TestCase {
-
- private CopyTransformer transformer = CopyTransformer.getInstance();
-
- public void testWithSAXSource() throws Exception {
- Reader r = new StringReader("<hello>world</hello>");
- Source src = new SAXSource(new InputSource(r));
- NormalizedMessage msg = copyMessage(src);
- r.close();
- new SourceTransformer().contentToString(msg);
- }
-
- public void testWithStreamSource() throws Exception {
- Reader r = new StringReader("<hello>world</hello>");
- Source src = new StreamSource(r);
- NormalizedMessage msg = copyMessage(src);
- r.close();
- new SourceTransformer().contentToString(msg);
- }
-
- protected NormalizedMessage copyMessage(Source src) throws Exception {
- NormalizedMessage from = new NormalizedMessageImpl();
- NormalizedMessage to = new NormalizedMessageImpl();
- from.setContent(src);
- transformer.transform(null, from, to);
- return to;
- }
-
-}
+package org.apache.servicemix.components.util;
+
+import java.io.Reader;
+import java.io.StringReader;
+
+import javax.jbi.messaging.NormalizedMessage;
+import javax.xml.transform.Source;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.TestCase;
+
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.messaging.NormalizedMessageImpl;
+import org.xml.sax.InputSource;
+
+public class CopyTransformerTest extends TestCase {
+
+ private CopyTransformer transformer = CopyTransformer.getInstance();
+
+ public void testWithSAXSource() throws Exception {
+ Reader r = new StringReader("<hello>world</hello>");
+ Source src = new SAXSource(new InputSource(r));
+ NormalizedMessage msg = copyMessage(src);
+ r.close();
+ new SourceTransformer().contentToString(msg);
+ }
+
+ public void testWithStreamSource() throws Exception {
+ Reader r = new StringReader("<hello>world</hello>");
+ Source src = new StreamSource(r);
+ NormalizedMessage msg = copyMessage(src);
+ r.close();
+ new SourceTransformer().contentToString(msg);
+ }
+
+ protected NormalizedMessage copyMessage(Source src) throws Exception {
+ NormalizedMessage from = new NormalizedMessageImpl();
+ NormalizedMessage to = new NormalizedMessageImpl();
+ from.setContent(src);
+ transformer.transform(null, from, to);
+ return to;
+ }
+
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/components/util/CopyTransformerTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentPacketTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentPacketTest.java?rev=379627&r1=379626&r2=379627&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentPacketTest.java (original)
+++ incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentPacketTest.java Tue Feb 21 15:40:05 2006
@@ -1,37 +1,37 @@
-/*
- * Copyright 2005-2006 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.servicemix.jbi.framework;
-
-import javax.jbi.servicedesc.ServiceEndpoint;
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.servicemix.jbi.servicedesc.InternalEndpoint;
-
-public class ComponentPacketTest extends TestCase {
-
- public void testRegisterTwoEndpoints() throws Exception {
- ComponentPacket packet = new ComponentPacket();
- ComponentNameSpace cns = new ComponentNameSpace("container", "component", null);
- ServiceEndpoint ep1 = new InternalEndpoint(cns, "endpoint", new QName("urn:foo", "service1"));
- ServiceEndpoint ep2 = new InternalEndpoint(cns, "endpoint", new QName("urn:foo", "service2"));
- packet.addActiveEndpoint(ep1);
- packet.addActiveEndpoint(ep2);
- assertEquals(2, packet.getActiveEndpoints().size());
- }
-
-}
+/*
+ * Copyright 2005-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.jbi.framework;
+
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.servicemix.jbi.servicedesc.InternalEndpoint;
+
+public class ComponentPacketTest extends TestCase {
+
+ public void testRegisterTwoEndpoints() throws Exception {
+ ComponentPacket packet = new ComponentPacket();
+ ComponentNameSpace cns = new ComponentNameSpace("container", "component", null);
+ ServiceEndpoint ep1 = new InternalEndpoint(cns, "endpoint", new QName("urn:foo", "service1"));
+ ServiceEndpoint ep2 = new InternalEndpoint(cns, "endpoint", new QName("urn:foo", "service2"));
+ packet.addActiveEndpoint(ep1);
+ packet.addActiveEndpoint(ep2);
+ assertEquals(2, packet.getActiveEndpoints().size());
+ }
+
+}
Propchange: incubator/servicemix/trunk/servicemix-core/src/test/java/org/apache/servicemix/jbi/framework/ComponentPacketTest.java
------------------------------------------------------------------------------
svn:eol-style = native