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/07/28 07:49:50 UTC
svn commit: r426392 [7/47] - in /incubator/servicemix/trunk:
apache-servicemix/src/main/assembly/ apache-servicemix/src/main/release/conf/
apache-servicemix/src/main/release/examples/basic/
apache-servicemix/src/main/release/examples/bpel-bpe/ apache-s...
Modified: incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/Bank.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/Bank.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/Bank.java (original)
+++ incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/Bank.java Thu Jul 27 22:49:32 2006
@@ -1,53 +1,53 @@
-/*
- * 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 loanbroker;
-
-import javax.jbi.messaging.ExchangeStatus;
-import javax.jbi.messaging.InOut;
-import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.MessagingException;
-import javax.jbi.messaging.NormalizedMessage;
-import javax.xml.namespace.QName;
-
-import org.apache.servicemix.MessageExchangeListener;
-import org.apache.servicemix.components.util.ComponentSupport;
-import org.apache.servicemix.jbi.jaxp.StringSource;
-
-public class Bank extends ComponentSupport implements MessageExchangeListener {
-
- public Bank(int number) {
- setService(new QName("urn:logicblaze:soa:bank", "Bank" + number));
- setEndpoint("bank");
- }
-
- public void onMessageExchange(MessageExchange exchange) throws MessagingException {
- InOut inOut = (InOut) exchange;
- if (inOut.getStatus() == ExchangeStatus.DONE) {
- return;
- } else if (inOut.getStatus() == ExchangeStatus.ERROR) {
- return;
- }
- System.err.println(getService().getLocalPart() + " requested");
- try {
- String output = "<getLoanQuoteResponse xmlns=\"urn:logicblaze:soa:bank\"><rate>" + (Math.ceil(1000 * Math.random()) / 100) + "</rate></getLoanQuoteResponse>";
- NormalizedMessage answer = inOut.createMessage();
- answer.setContent(new StringSource(output));
- answer(inOut, answer);
- } catch (Exception e) {
- throw new MessagingException(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 loanbroker;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.MessageExchangeListener;
+import org.apache.servicemix.components.util.ComponentSupport;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+
+public class Bank extends ComponentSupport implements MessageExchangeListener {
+
+ public Bank(int number) {
+ setService(new QName("urn:logicblaze:soa:bank", "Bank" + number));
+ setEndpoint("bank");
+ }
+
+ public void onMessageExchange(MessageExchange exchange) throws MessagingException {
+ InOut inOut = (InOut) exchange;
+ if (inOut.getStatus() == ExchangeStatus.DONE) {
+ return;
+ } else if (inOut.getStatus() == ExchangeStatus.ERROR) {
+ return;
+ }
+ System.err.println(getService().getLocalPart() + " requested");
+ try {
+ String output = "<getLoanQuoteResponse xmlns=\"urn:logicblaze:soa:bank\"><rate>" + (Math.ceil(1000 * Math.random()) / 100) + "</rate></getLoanQuoteResponse>";
+ NormalizedMessage answer = inOut.createMessage();
+ answer.setContent(new StringSource(output));
+ answer(inOut, answer);
+ } catch (Exception e) {
+ throw new MessagingException(e);
+ }
+ }
}
Propchange: incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/Bank.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/CreditAgency.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/CreditAgency.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/CreditAgency.java (original)
+++ incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/CreditAgency.java Thu Jul 27 22:49:32 2006
@@ -1,114 +1,114 @@
-/*
- * 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 loanbroker;
-
-import javax.jbi.messaging.ExchangeStatus;
-import javax.jbi.messaging.Fault;
-import javax.jbi.messaging.InOut;
-import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.MessagingException;
-import javax.jbi.messaging.NormalizedMessage;
-import javax.xml.namespace.QName;
-import javax.xml.transform.TransformerException;
-
-import org.apache.servicemix.MessageExchangeListener;
-import org.apache.servicemix.components.util.ComponentSupport;
-import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.apache.servicemix.jbi.jaxp.StringSource;
-import org.apache.servicemix.jbi.util.DOMUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.traversal.NodeIterator;
-
-import com.sun.org.apache.xpath.internal.CachedXPathAPI;
-
-public class CreditAgency extends ComponentSupport implements MessageExchangeListener {
-
- public CreditAgency() {
- setService(new QName("urn:logicblaze:soa:creditagency", "CreditAgencyService"));
- setEndpoint("agency");
- }
-
- public void onMessageExchange(MessageExchange exchange) throws MessagingException {
- InOut inOut = (InOut) exchange;
- if (inOut.getStatus() == ExchangeStatus.DONE) {
- return;
- } else if (inOut.getStatus() == ExchangeStatus.ERROR) {
- return;
- }
- try {
- Document doc = (Document) new SourceTransformer().toDOMNode(inOut.getInMessage());
- String ssn = textValueOfXPath(doc, "//*[local-name()='ssn']");
- if (ssn == null || ssn.length() == 0) {
- fail(exchange, new NullPointerException());
- return;
- }
- if (!ssn.startsWith("1")) {
- Fault fault = inOut.createFault();
- fault.setContent(new StringSource("<invalidSSNFault xmlns=\"urn:logicblaze:soa:creditagency:types\"><ssn>" + ssn + "</ssn></invalidSSNFault>"));
- fail(inOut, fault);
- } else {
- String operation = null;
- if (inOut.getOperation() != null) {
- operation = inOut.getOperation().getLocalPart();
- } else {
- operation = doc.getDocumentElement().getLocalName();
- }
- String output;
- if ("getCreditScore".equals(operation)) {
- output = "<getCreditScoreResponse xmlns=\"urn:logicblaze:soa:creditagency\"><score>" + getCreditScore(ssn) + "</score></getCreditScoreResponse>";
- } else if ("getCreditHistoryLength".equals(operation)) {
- output = "<getCreditHistoryLengthResponse xmlns=\"urn:logicblaze:soa:creditagency\"><length>" + getCreditHistoryLength(ssn) + "</length></getCreditHistoryLengthResponse>";
- } else {
- throw new UnsupportedOperationException(operation);
- }
- NormalizedMessage answer = inOut.createMessage();
- answer.setContent(new StringSource(output));
- answer(inOut, answer);
- }
- } catch (Exception e) {
- throw new MessagingException(e);
- }
- }
- int getCreditScore(String ssn) {
- //return ((int) (Math.random() * 600) + 300);
- return 1000;
- }
- int getCreditHistoryLength(String ssn) {
- //return ((int) (Math.random() * 19) + 1);
- return 10;
- }
-
- protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
- CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
- NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, xpath);
- Node root = iterator.nextNode();
- if (root instanceof Element) {
- Element element = (Element) root;
- if (element == null) {
- return "";
- }
- String text = DOMUtil.getElementText(element);
- return text;
- }
- else if (root != null) {
- return root.getNodeValue();
- } else {
- return null;
- }
- }
+/*
+ * 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 loanbroker;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.Fault;
+import javax.jbi.messaging.InOut;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.NormalizedMessage;
+import javax.xml.namespace.QName;
+import javax.xml.transform.TransformerException;
+
+import org.apache.servicemix.MessageExchangeListener;
+import org.apache.servicemix.components.util.ComponentSupport;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.jbi.util.DOMUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.traversal.NodeIterator;
+
+import com.sun.org.apache.xpath.internal.CachedXPathAPI;
+
+public class CreditAgency extends ComponentSupport implements MessageExchangeListener {
+
+ public CreditAgency() {
+ setService(new QName("urn:logicblaze:soa:creditagency", "CreditAgencyService"));
+ setEndpoint("agency");
+ }
+
+ public void onMessageExchange(MessageExchange exchange) throws MessagingException {
+ InOut inOut = (InOut) exchange;
+ if (inOut.getStatus() == ExchangeStatus.DONE) {
+ return;
+ } else if (inOut.getStatus() == ExchangeStatus.ERROR) {
+ return;
+ }
+ try {
+ Document doc = (Document) new SourceTransformer().toDOMNode(inOut.getInMessage());
+ String ssn = textValueOfXPath(doc, "//*[local-name()='ssn']");
+ if (ssn == null || ssn.length() == 0) {
+ fail(exchange, new NullPointerException());
+ return;
+ }
+ if (!ssn.startsWith("1")) {
+ Fault fault = inOut.createFault();
+ fault.setContent(new StringSource("<invalidSSNFault xmlns=\"urn:logicblaze:soa:creditagency:types\"><ssn>" + ssn + "</ssn></invalidSSNFault>"));
+ fail(inOut, fault);
+ } else {
+ String operation = null;
+ if (inOut.getOperation() != null) {
+ operation = inOut.getOperation().getLocalPart();
+ } else {
+ operation = doc.getDocumentElement().getLocalName();
+ }
+ String output;
+ if ("getCreditScore".equals(operation)) {
+ output = "<getCreditScoreResponse xmlns=\"urn:logicblaze:soa:creditagency\"><score>" + getCreditScore(ssn) + "</score></getCreditScoreResponse>";
+ } else if ("getCreditHistoryLength".equals(operation)) {
+ output = "<getCreditHistoryLengthResponse xmlns=\"urn:logicblaze:soa:creditagency\"><length>" + getCreditHistoryLength(ssn) + "</length></getCreditHistoryLengthResponse>";
+ } else {
+ throw new UnsupportedOperationException(operation);
+ }
+ NormalizedMessage answer = inOut.createMessage();
+ answer.setContent(new StringSource(output));
+ answer(inOut, answer);
+ }
+ } catch (Exception e) {
+ throw new MessagingException(e);
+ }
+ }
+ int getCreditScore(String ssn) {
+ //return ((int) (Math.random() * 600) + 300);
+ return 1000;
+ }
+ int getCreditHistoryLength(String ssn) {
+ //return ((int) (Math.random() * 19) + 1);
+ return 10;
+ }
+
+ protected String textValueOfXPath(Node node, String xpath) throws TransformerException {
+ CachedXPathAPI cachedXPathAPI = new CachedXPathAPI();
+ NodeIterator iterator = cachedXPathAPI.selectNodeIterator(node, xpath);
+ Node root = iterator.nextNode();
+ if (root instanceof Element) {
+ Element element = (Element) root;
+ if (element == null) {
+ return "";
+ }
+ String text = DOMUtil.getElementText(element);
+ return text;
+ }
+ else if (root != null) {
+ return root.getNodeValue();
+ } else {
+ return null;
+ }
+ }
}
Propchange: incubator/servicemix/trunk/servicemix-bpe/src/test/java/loanbroker/CreditAgency.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-bpe/src/test/java/org/apache/servicemix/bpe/BPESpringComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-bpe/src/test/java/org/apache/servicemix/bpe/BPESpringComponentTest.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-bpe/src/test/java/org/apache/servicemix/bpe/BPESpringComponentTest.java (original)
+++ incubator/servicemix/trunk/servicemix-bpe/src/test/java/org/apache/servicemix/bpe/BPESpringComponentTest.java Thu Jul 27 22:49:32 2006
@@ -1,40 +1,40 @@
-package org.apache.servicemix.bpe;
-
-import javax.jbi.messaging.ExchangeStatus;
-import javax.jbi.messaging.MessageExchange;
-import javax.xml.namespace.QName;
-
-import org.apache.servicemix.client.DefaultServiceMixClient;
-import org.apache.servicemix.client.ServiceMixClient;
-import org.apache.servicemix.jbi.jaxp.SourceTransformer;
-import org.apache.servicemix.jbi.jaxp.StringSource;
-import org.apache.servicemix.tck.SpringTestSupport;
-import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
-import org.springframework.context.support.AbstractXmlApplicationContext;
-
-public class BPESpringComponentTest extends SpringTestSupport {
-
- public void test() throws Exception {
- ServiceMixClient client = new DefaultServiceMixClient(jbi);
- MessageExchange me = client.createInOutExchange();
- me.setService(new QName("urn:logicblaze:soa:loanbroker", "LoanBrokerService"));
- me.setOperation(new QName("getLoanQuote"));
- me.getMessage("in").setContent(new StringSource("<getLoanQuoteRequest xmlns=\"urn:logicblaze:soa:loanbroker\"><ssn>1234341</ssn><amount>100000.0</amount><duration>12</duration></getLoanQuoteRequest>"));
- long t0 = System.currentTimeMillis();
- client.sendSync(me);
- long t1 = System.currentTimeMillis();
- if (me.getError() != null) {
- throw me.getError();
- }
- assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
- String out = new SourceTransformer().contentToString(me.getMessage("out"));
- System.err.println(out);
- System.err.println("Time: " + (t1 - t0));
- client.done(me);
- }
-
- protected AbstractXmlApplicationContext createBeanFactory() {
- return new ClassPathXmlApplicationContext("org/apache/servicemix/bpe/spring.xml");
- }
-
-}
+package org.apache.servicemix.bpe;
+
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.MessageExchange;
+import javax.xml.namespace.QName;
+
+import org.apache.servicemix.client.DefaultServiceMixClient;
+import org.apache.servicemix.client.ServiceMixClient;
+import org.apache.servicemix.jbi.jaxp.SourceTransformer;
+import org.apache.servicemix.jbi.jaxp.StringSource;
+import org.apache.servicemix.tck.SpringTestSupport;
+import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+public class BPESpringComponentTest extends SpringTestSupport {
+
+ public void test() throws Exception {
+ ServiceMixClient client = new DefaultServiceMixClient(jbi);
+ MessageExchange me = client.createInOutExchange();
+ me.setService(new QName("urn:logicblaze:soa:loanbroker", "LoanBrokerService"));
+ me.setOperation(new QName("getLoanQuote"));
+ me.getMessage("in").setContent(new StringSource("<getLoanQuoteRequest xmlns=\"urn:logicblaze:soa:loanbroker\"><ssn>1234341</ssn><amount>100000.0</amount><duration>12</duration></getLoanQuoteRequest>"));
+ long t0 = System.currentTimeMillis();
+ client.sendSync(me);
+ long t1 = System.currentTimeMillis();
+ if (me.getError() != null) {
+ throw me.getError();
+ }
+ assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
+ String out = new SourceTransformer().contentToString(me.getMessage("out"));
+ System.err.println(out);
+ System.err.println("Time: " + (t1 - t0));
+ client.done(me);
+ }
+
+ protected AbstractXmlApplicationContext createBeanFactory() {
+ return new ClassPathXmlApplicationContext("org/apache/servicemix/bpe/spring.xml");
+ }
+
+}
Propchange: incubator/servicemix/trunk/servicemix-bpe/src/test/java/org/apache/servicemix/bpe/BPESpringComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/bank.wsdl
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/bank.wsdl?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/bank.wsdl (original)
+++ incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/bank.wsdl Thu Jul 27 22:49:32 2006
@@ -1,48 +1,48 @@
-<definitions targetNamespace="urn:logicblaze:soa:bank"
- xmlns:tns="urn:logicblaze:soa:bank"
- xmlns:typens="urn:logicblaze:soa:bank:types"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
-
- <types>
- <xsd:schema
- targetNamespace="urn:logicblaze:soa:bank:types"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="getLoanQuoteRequest">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- <xsd:element name="amount" type="xsd:double" />
- <xsd:element name="duration" type="xsd:int" />
- <xsd:element name="score" type="xsd:int" />
- <xsd:element name="length" type="xsd:int" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="getLoanQuoteResponse">
- <xsd:sequence>
- <xsd:element name="rate" type="xsd:double" />
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:schema>
- </types>
-
- <message name="getLoanQuoteRequest">
- <part name="payload" type="typens:getLoanQuoteRequest" />
- </message>
-
- <message name="getLoanQuoteResponse">
- <part name="payload" type="typens:getLoanQuoteResponse" />
- </message>
-
- <portType name="Bank">
- <operation name="getLoanQuote">
- <input message="tns:getLoanQuoteRequest" />
- <output message="tns:getLoanQuoteResponse" />
- </operation>
- </portType>
-
-</definitions>
+<definitions targetNamespace="urn:logicblaze:soa:bank"
+ xmlns:tns="urn:logicblaze:soa:bank"
+ xmlns:typens="urn:logicblaze:soa:bank:types"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
+
+ <types>
+ <xsd:schema
+ targetNamespace="urn:logicblaze:soa:bank:types"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:complexType name="getLoanQuoteRequest">
+ <xsd:sequence>
+ <xsd:element name="ssn" type="xsd:string" />
+ <xsd:element name="amount" type="xsd:double" />
+ <xsd:element name="duration" type="xsd:int" />
+ <xsd:element name="score" type="xsd:int" />
+ <xsd:element name="length" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="getLoanQuoteResponse">
+ <xsd:sequence>
+ <xsd:element name="rate" type="xsd:double" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ </xsd:schema>
+ </types>
+
+ <message name="getLoanQuoteRequest">
+ <part name="payload" type="typens:getLoanQuoteRequest" />
+ </message>
+
+ <message name="getLoanQuoteResponse">
+ <part name="payload" type="typens:getLoanQuoteResponse" />
+ </message>
+
+ <portType name="Bank">
+ <operation name="getLoanQuote">
+ <input message="tns:getLoanQuoteRequest" />
+ <output message="tns:getLoanQuoteResponse" />
+ </operation>
+ </portType>
+
+</definitions>
Propchange: incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/bank.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/creditagency.wsdl
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/creditagency.wsdl?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/creditagency.wsdl (original)
+++ incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/creditagency.wsdl Thu Jul 27 22:49:32 2006
@@ -1,88 +1,88 @@
-<definitions targetNamespace="urn:logicblaze:soa:creditagency"
- xmlns:tns="urn:logicblaze:soa:creditagency"
- xmlns:typens="urn:logicblaze:soa:creditagency:types"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
-
- <types>
- <xsd:schema
- targetNamespace="urn:logicblaze:soa:creditagency:types"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="getCreditScoreRequest">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="getCreditScoreResponse">
- <xsd:sequence>
- <xsd:element name="score" type="xsd:int" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="getCreditHistoryLengthRequest">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="getCreditHistoryLengthResponse">
- <xsd:sequence>
- <xsd:element name="length" type="xsd:int" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="unknownSSNFault">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:schema>
- </types>
-
- <message name="getCreditScoreRequest">
- <part name="request" type="typens:getCreditScoreRequest" />
- </message>
-
- <message name="getCreditScoreResponse">
- <part name="response" type="typens:getCreditScoreResponse" />
- </message>
-
- <message name="getCreditHistoryLengthRequest">
- <part name="payload"
- type="typens:getCreditHistoryLengthRequest" />
- </message>
-
- <message name="getCreditHistoryLengthResponse">
- <part name="payload"
- type="typens:getCreditHistoryLengthResponse" />
- </message>
-
- <message name="unknownSSNFault">
- <part name="payload" type="typens:unknownSSNFault" />
- </message>
-
- <message name="invalidSSNFault">
- <part name="payload" type="typens:invalidSSNFault" />
- </message>
-
- <portType name="CreditAgency">
- <operation name="getCreditScore">
- <input message="tns:getCreditScoreRequest" />
- <output message="tns:getCreditScoreResponse" />
- <fault name="UnknownSSN" message="tns:unknownSSNFault" />
- <fault name="InvalidSSN" message="tns:invalidSSNFault" />
- </operation>
- <operation name="getCreditHistoryLength">
- <input message="tns:getCreditHistoryLengthRequest" />
- <output message="tns:getCreditHistoryLengthResponse" />
- <fault name="UnknownSSN" message="tns:unknownSSNFault">
- </fault>
- </operation>
- </portType>
-
-</definitions>
+<definitions targetNamespace="urn:logicblaze:soa:creditagency"
+ xmlns:tns="urn:logicblaze:soa:creditagency"
+ xmlns:typens="urn:logicblaze:soa:creditagency:types"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
+
+ <types>
+ <xsd:schema
+ targetNamespace="urn:logicblaze:soa:creditagency:types"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:complexType name="getCreditScoreRequest">
+ <xsd:sequence>
+ <xsd:element name="ssn" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="getCreditScoreResponse">
+ <xsd:sequence>
+ <xsd:element name="score" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="getCreditHistoryLengthRequest">
+ <xsd:sequence>
+ <xsd:element name="ssn" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="getCreditHistoryLengthResponse">
+ <xsd:sequence>
+ <xsd:element name="length" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="unknownSSNFault">
+ <xsd:sequence>
+ <xsd:element name="ssn" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ </xsd:schema>
+ </types>
+
+ <message name="getCreditScoreRequest">
+ <part name="request" type="typens:getCreditScoreRequest" />
+ </message>
+
+ <message name="getCreditScoreResponse">
+ <part name="response" type="typens:getCreditScoreResponse" />
+ </message>
+
+ <message name="getCreditHistoryLengthRequest">
+ <part name="payload"
+ type="typens:getCreditHistoryLengthRequest" />
+ </message>
+
+ <message name="getCreditHistoryLengthResponse">
+ <part name="payload"
+ type="typens:getCreditHistoryLengthResponse" />
+ </message>
+
+ <message name="unknownSSNFault">
+ <part name="payload" type="typens:unknownSSNFault" />
+ </message>
+
+ <message name="invalidSSNFault">
+ <part name="payload" type="typens:invalidSSNFault" />
+ </message>
+
+ <portType name="CreditAgency">
+ <operation name="getCreditScore">
+ <input message="tns:getCreditScoreRequest" />
+ <output message="tns:getCreditScoreResponse" />
+ <fault name="UnknownSSN" message="tns:unknownSSNFault" />
+ <fault name="InvalidSSN" message="tns:invalidSSNFault" />
+ </operation>
+ <operation name="getCreditHistoryLength">
+ <input message="tns:getCreditHistoryLengthRequest" />
+ <output message="tns:getCreditHistoryLengthResponse" />
+ <fault name="UnknownSSN" message="tns:unknownSSNFault">
+ </fault>
+ </operation>
+ </portType>
+
+</definitions>
Propchange: incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/creditagency.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/loanbroker.wsdl
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/loanbroker.wsdl?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/loanbroker.wsdl (original)
+++ incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/loanbroker.wsdl Thu Jul 27 22:49:32 2006
@@ -1,95 +1,95 @@
-<definitions targetNamespace="urn:logicblaze:soa:loanbroker"
- xmlns:tns="urn:logicblaze:soa:loanbroker"
- xmlns:typens="urn:logicblaze:soa:loanbroker:types"
- xmlns="http://schemas.xmlsoap.org/wsdl/"
- xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
-
- <import namespace="urn:logicblaze:soa:creditagency"
- location="creditagency.wsdl" />
-
- <import namespace="urn:logicblaze:soa:bank"
- location="bank.wsdl" />
-
- <!-- type defs -->
- <types>
- <xsd:schema
- targetNamespace="urn:logicblaze:soa:loanbroker:types"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-
- <xsd:complexType name="getLoanQuoteRequest">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- <xsd:element name="amount" type="xsd:double" />
- <xsd:element name="duration" type="xsd:int" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="getLoanQuoteResponse">
- <xsd:sequence>
- <xsd:element name="rate" type="xsd:double" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="unknownSSNFault">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="invalidSSNFault">
- <xsd:sequence>
- <xsd:element name="ssn" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
-
- </xsd:schema>
- </types>
-
- <message name="getLoanQuoteRequest">
- <part name="payload" type="typens:getLoanQuoteRequest" />
- </message>
-
- <message name="getLoanQuoteResponse">
- <part name="payload" type="typens:getLoanQuoteResponse" />
- </message>
-
- <message name="unknownSSNFault">
- <part name="payload" type="typens:unknownSSNFault" />
- </message>
-
- <message name="invalidSSNFault">
- <part name="payload" type="typens:invalidSSNFault" />
- </message>
-
- <portType name="LoanBroker">
- <operation name="getLoanQuote">
- <input message="tns:getLoanQuoteRequest" />
- <output message="tns:getLoanQuoteResponse" />
- <fault name="UnknownSSN" message="tns:unknownSSNFault" />
- <fault name="InvalidSSN" message="tns:invalidSSNFault" />
- </operation>
- </portType>
-
- <!--
- <plnk:partnerLinkType name="test1Request">
- <plnk:role name="test1Service">
- <plnk:portType name="test1PT"/>
- </plnk:role>
- </plnk:partnerLinkType>
-
- <plnk:partnerLinkType name="probeRequest">
- <plnk:role name="probeService">
- <plnk:portType name="prb:probeMessagePT"/>
- </plnk:role>
- </plnk:partnerLinkType>
- -->
-
- <binding name="LoanBroker" type="tns:LoanBroker">
- <operation name="request"></operation>
- </binding>
- <service name="LoanBrokerService">
- <port name="loanbroker" binding="tns:LoanBroker" />
- </service>
-</definitions>
+<definitions targetNamespace="urn:logicblaze:soa:loanbroker"
+ xmlns:tns="urn:logicblaze:soa:loanbroker"
+ xmlns:typens="urn:logicblaze:soa:loanbroker:types"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
+
+ <import namespace="urn:logicblaze:soa:creditagency"
+ location="creditagency.wsdl" />
+
+ <import namespace="urn:logicblaze:soa:bank"
+ location="bank.wsdl" />
+
+ <!-- type defs -->
+ <types>
+ <xsd:schema
+ targetNamespace="urn:logicblaze:soa:loanbroker:types"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+ <xsd:complexType name="getLoanQuoteRequest">
+ <xsd:sequence>
+ <xsd:element name="ssn" type="xsd:string" />
+ <xsd:element name="amount" type="xsd:double" />
+ <xsd:element name="duration" type="xsd:int" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="getLoanQuoteResponse">
+ <xsd:sequence>
+ <xsd:element name="rate" type="xsd:double" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="unknownSSNFault">
+ <xsd:sequence>
+ <xsd:element name="ssn" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ <xsd:complexType name="invalidSSNFault">
+ <xsd:sequence>
+ <xsd:element name="ssn" type="xsd:string" />
+ </xsd:sequence>
+ </xsd:complexType>
+
+ </xsd:schema>
+ </types>
+
+ <message name="getLoanQuoteRequest">
+ <part name="payload" type="typens:getLoanQuoteRequest" />
+ </message>
+
+ <message name="getLoanQuoteResponse">
+ <part name="payload" type="typens:getLoanQuoteResponse" />
+ </message>
+
+ <message name="unknownSSNFault">
+ <part name="payload" type="typens:unknownSSNFault" />
+ </message>
+
+ <message name="invalidSSNFault">
+ <part name="payload" type="typens:invalidSSNFault" />
+ </message>
+
+ <portType name="LoanBroker">
+ <operation name="getLoanQuote">
+ <input message="tns:getLoanQuoteRequest" />
+ <output message="tns:getLoanQuoteResponse" />
+ <fault name="UnknownSSN" message="tns:unknownSSNFault" />
+ <fault name="InvalidSSN" message="tns:invalidSSNFault" />
+ </operation>
+ </portType>
+
+ <!--
+ <plnk:partnerLinkType name="test1Request">
+ <plnk:role name="test1Service">
+ <plnk:portType name="test1PT"/>
+ </plnk:role>
+ </plnk:partnerLinkType>
+
+ <plnk:partnerLinkType name="probeRequest">
+ <plnk:role name="probeService">
+ <plnk:portType name="prb:probeMessagePT"/>
+ </plnk:role>
+ </plnk:partnerLinkType>
+ -->
+
+ <binding name="LoanBroker" type="tns:LoanBroker">
+ <operation name="request"></operation>
+ </binding>
+ <service name="LoanBrokerService">
+ <port name="loanbroker" binding="tns:LoanBroker" />
+ </service>
+</definitions>
Propchange: incubator/servicemix/trunk/servicemix-bpe/src/test/resources/loanbroker/loanbroker.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-bpe/src/test/resources/org/apache/servicemix/bpe/spring.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-bpe/src/test/resources/org/apache/servicemix/bpe/spring.xml?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-bpe/src/test/resources/org/apache/servicemix/bpe/spring.xml (original)
+++ incubator/servicemix/trunk/servicemix-bpe/src/test/resources/org/apache/servicemix/bpe/spring.xml Thu Jul 27 22:49:32 2006
@@ -1,42 +1,42 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
- xmlns:bpe="http://servicemix.apache.org/bpe/1.0"
- xmlns:ca="urn:logicblaze:soa:creditagency">
-
- <!-- the JBI container -->
- <sm:container id="jbi" embedded="true">
- <sm:activationSpecs>
-
- <!-- output using a POJO -->
- <sm:activationSpec>
- <sm:component>
- <bpe:component bpelResource="classpath:loanbroker/loanbroker.bpel" />
- </sm:component>
- </sm:activationSpec>
-
- <sm:activationSpec interfaceName="ca:CreditAgency">
- <sm:component>
- <bean class="loanbroker.CreditAgency" />
- </sm:component>
- </sm:activationSpec>
-
- <sm:activationSpec>
- <sm:component>
- <bean class="loanbroker.Bank">
- <constructor-arg value="1" />
- </bean>
- </sm:component>
- </sm:activationSpec>
-
- <sm:activationSpec>
- <sm:component>
- <bean class="loanbroker.Bank">
- <constructor-arg value="2" />
- </bean>
- </sm:component>
- </sm:activationSpec>
-
- </sm:activationSpecs>
- </sm:container>
-
-</beans>
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns:sm="http://servicemix.apache.org/config/1.0"
+ xmlns:bpe="http://servicemix.apache.org/bpe/1.0"
+ xmlns:ca="urn:logicblaze:soa:creditagency">
+
+ <!-- the JBI container -->
+ <sm:container id="jbi" embedded="true">
+ <sm:activationSpecs>
+
+ <!-- output using a POJO -->
+ <sm:activationSpec>
+ <sm:component>
+ <bpe:component bpelResource="classpath:loanbroker/loanbroker.bpel" />
+ </sm:component>
+ </sm:activationSpec>
+
+ <sm:activationSpec interfaceName="ca:CreditAgency">
+ <sm:component>
+ <bean class="loanbroker.CreditAgency" />
+ </sm:component>
+ </sm:activationSpec>
+
+ <sm:activationSpec>
+ <sm:component>
+ <bean class="loanbroker.Bank">
+ <constructor-arg value="1" />
+ </bean>
+ </sm:component>
+ </sm:activationSpec>
+
+ <sm:activationSpec>
+ <sm:component>
+ <bean class="loanbroker.Bank">
+ <constructor-arg value="2" />
+ </bean>
+ </sm:component>
+ </sm:activationSpec>
+
+ </sm:activationSpecs>
+ </sm:container>
+
+</beans>
Propchange: incubator/servicemix/trunk/servicemix-bpe/src/test/resources/org/apache/servicemix/bpe/spring.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java (original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java Thu Jul 27 22:49:32 2006
@@ -1,460 +1,460 @@
-/*
- * 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.common;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import javax.jbi.JBIException;
-import javax.jbi.component.ComponentContext;
-import javax.jbi.component.ComponentLifeCycle;
-import javax.jbi.messaging.DeliveryChannel;
-import javax.jbi.messaging.ExchangeStatus;
-import javax.jbi.messaging.MessageExchange;
-import javax.jbi.messaging.MessagingException;
-import javax.jbi.messaging.MessageExchange.Role;
-import javax.jbi.servicedesc.ServiceEndpoint;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.resource.spi.work.Work;
-import javax.resource.spi.work.WorkManager;
-import javax.transaction.Status;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.xml.namespace.QName;
-
-import org.apache.commons.logging.Log;
-import org.apache.servicemix.JbiConstants;
-
-import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
-import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
-
-/**
- * Base class for life cycle management of components.
- * This class may be used as is.
- *
- * @author Guillaume Nodet
- * @version $Revision: 399873 $
- * @since 3.0
- */
-public class AsyncBaseLifeCycle implements ComponentLifeCycle {
-
- protected final transient Log logger;
-
- protected BaseComponent component;
- protected ComponentContext context;
- protected ObjectName mbeanName;
- protected WorkManager workManager;
- protected AtomicBoolean running;
- protected DeliveryChannel channel;
- protected Thread poller;
- protected AtomicBoolean polling;
- protected TransactionManager transactionManager;
- protected boolean workManagerCreated;
- protected Map processors = new ConcurrentHashMap();
-
-
- public AsyncBaseLifeCycle(BaseComponent component) {
- this.component = component;
- this.logger = component.logger;
- this.running = new AtomicBoolean(false);
- this.polling = new AtomicBoolean(false);
- this.processors = new ConcurrentHashMap();
- }
-
- /* (non-Javadoc)
- * @see javax.jbi.component.ComponentLifeCycle#getExtensionMBeanName()
- */
- public ObjectName getExtensionMBeanName() {
- return mbeanName;
- }
-
- protected Object getExtensionMBean() throws Exception {
- return null;
- }
-
- protected ObjectName createExtensionMBeanName() throws Exception {
- return this.context.getMBeanNames().createCustomComponentMBeanName("Configuration");
- }
-
- protected QName getEPRServiceName() {
- return null;
- }
-
- /* (non-Javadoc)
- * @see javax.jbi.component.ComponentLifeCycle#init(javax.jbi.component.ComponentContext)
- */
- public void init(ComponentContext context) throws JBIException {
- try {
- if (logger.isDebugEnabled()) {
- logger.debug("Initializing component");
- }
- this.context = context;
- this.channel = context.getDeliveryChannel();
- this.transactionManager = (TransactionManager) context.getTransactionManager();
- doInit();
- if (logger.isDebugEnabled()) {
- logger.debug("Component initialized");
- }
- } catch (JBIException e) {
- throw e;
- } catch (Exception e) {
- throw new JBIException("Error calling init", e);
- }
- }
-
- protected void doInit() throws Exception {
- // Register extension mbean
- Object mbean = getExtensionMBean();
- if (mbean != null) {
- MBeanServer server = this.context.getMBeanServer();
- if (server == null) {
- // TODO: log a warning ?
- //throw new JBIException("null mBeanServer");
- } else {
- this.mbeanName = createExtensionMBeanName();
- if (server.isRegistered(this.mbeanName)) {
- server.unregisterMBean(this.mbeanName);
- }
- server.registerMBean(mbean, this.mbeanName);
- }
- }
- // Obtain or create the work manager
- // When using the WorkManager from ServiceMix,
- // some class loader problems can appear when
- // trying to uninstall the components.
- // Some threads owned by the work manager have a
- // security context referencing the component class loader
- // so that every loaded classes are locked
- //this.workManager = findWorkManager();
- if (this.workManager == null) {
- this.workManagerCreated = true;
- this.workManager = createWorkManager();
- }
- }
-
- /* (non-Javadoc)
- * @see javax.jbi.component.ComponentLifeCycle#shutDown()
- */
- public void shutDown() throws JBIException {
- try {
- if (logger.isDebugEnabled()) {
- logger.debug("Shutting down component");
- }
- doShutDown();
- this.context = null;
- if (logger.isDebugEnabled()) {
- logger.debug("Component shut down");
- }
- } catch (JBIException e) {
- throw e;
- } catch (Exception e) {
- throw new JBIException("Error calling shutdown", e);
- }
- }
-
- protected void doShutDown() throws Exception {
- // Unregister mbean
- if (this.mbeanName != null) {
- MBeanServer server = this.context.getMBeanServer();
- if (server == null) {
- throw new JBIException("null mBeanServer");
- }
- if (server.isRegistered(this.mbeanName)) {
- server.unregisterMBean(this.mbeanName);
- }
- }
- // Destroy work manager, if created
- if (this.workManagerCreated) {
- if (this.workManager instanceof BasicWorkManager) {
- ((BasicWorkManager) this.workManager).shutDown();
- }
- this.workManager = null;
- }
- }
-
- /* (non-Javadoc)
- * @see javax.jbi.component.ComponentLifeCycle#start()
- */
- public void start() throws JBIException {
- try {
- if (logger.isDebugEnabled()) {
- logger.debug("Starting component");
- }
- if (this.running.compareAndSet(false, true)) {
- doStart();
- }
- if (logger.isDebugEnabled()) {
- logger.debug("Component started");
- }
- } catch (JBIException e) {
- throw e;
- } catch (Exception e) {
- throw new JBIException("Error calling start", e);
- }
- }
-
- protected void doStart() throws Exception {
- synchronized (this.polling) {
- workManager.startWork(new Work() {
- public void release() { }
- public void run() {
- poller = Thread.currentThread();
- pollDeliveryChannel();
- }
- });
- polling.wait();
- }
- }
-
- protected void pollDeliveryChannel() {
- synchronized (polling) {
- polling.set(true);
- polling.notify();
- }
- while (running.get()) {
- try {
- final MessageExchange exchange = channel.accept(1000L);
- if (exchange != null) {
- final Transaction tx = (Transaction) exchange.getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME);
- if (tx != null) {
- if (transactionManager == null) {
- throw new IllegalStateException("Exchange is enlisted in a transaction, but no transaction manager is available");
- }
- transactionManager.suspend();
- }
- workManager.scheduleWork(new Work() {
- public void release() {
- }
- public void run() {
- processExchangeInTx(exchange, tx);
- }
- });
- }
- } catch (Throwable t) {
- if (running.get() == false) {
- // Should have been interrupted, discard the throwable
- if (logger.isDebugEnabled()) {
- logger.debug("Polling thread will stop");
- }
- } else {
- logger.error("Error polling delivery channel", t);
- }
- }
- }
- synchronized (polling) {
- polling.set(false);
- polling.notify();
- }
- }
-
- /* (non-Javadoc)
- * @see javax.jbi.component.ComponentLifeCycle#stop()
- */
- public void stop() throws JBIException {
- try {
- if (logger.isDebugEnabled()) {
- logger.debug("Stopping component");
- }
- if (this.running.compareAndSet(true, false)) {
- doStop();
- }
- if (logger.isDebugEnabled()) {
- logger.debug("Component stopped");
- }
- } catch (JBIException e) {
- throw e;
- } catch (Exception e) {
- throw new JBIException("Error calling stop", e);
- }
- }
-
- protected void doStop() throws Exception {
- // Interrupt the polling thread and await termination
- try {
- synchronized (polling) {
- if (polling.get()) {
- poller.interrupt();
- polling.wait();
- }
- }
- } finally {
- poller = null;
- }
- }
-
- /**
- * @return Returns the context.
- */
- public ComponentContext getContext() {
- return context;
- }
-
- public WorkManager getWorkManager() {
- return workManager;
- }
-
- protected WorkManager createWorkManager() {
- // Create a very simple one
- return new BasicWorkManager();
- }
-
- protected WorkManager findWorkManager() {
- // If inside ServiceMix, retrieve its work manager
- try {
- Method getContainerMth = context.getClass().getMethod("getContainer", new Class[0]);
- Object container = getContainerMth.invoke(context, new Object[0]);
- Method getWorkManagerMth = container.getClass().getMethod("getWorkManager", new Class[0]);
- return (WorkManager) getWorkManagerMth.invoke(container, new Object[0]);
- } catch (Throwable t) {
- if (logger.isDebugEnabled()) {
- logger.debug("JBI container is not ServiceMix. Will create our own WorkManager", t);
- }
- }
- // TODO: should look in jndi for an existing work manager
- return null;
- }
-
- protected void processExchangeInTx(MessageExchange exchange, Transaction tx) {
- try {
- if (tx != null) {
- transactionManager.resume(tx);
- }
- processExchange(exchange);
- } catch (Exception e) {
- logger.error("Error processing exchange " + exchange, e);
- try {
- // If we are transacted and this is a runtime exception
- // try to mark transaction as rollback
- if (tx != null && e instanceof RuntimeException) {
- transactionManager.setRollbackOnly();
- } else {
- exchange.setError(e);
- channel.send(exchange);
- }
- } catch (Exception inner) {
- logger.error("Error setting exchange status to ERROR", inner);
- }
- } finally {
- try {
- // Check transaction status
- if (tx != null) {
- int status = transactionManager.getStatus();
- // We use pull delivery, so the transaction should already
- // have been transfered to another thread because the component
- // must have answered.
- if (status != Status.STATUS_NO_TRANSACTION) {
- logger.error("Transaction is still active after exchange processing. Trying to rollback transaction.");
- try {
- transactionManager.rollback();
- } catch (Throwable t) {
- logger.error("Error trying to rollback transaction.", t);
- }
- }
- }
- } catch (Throwable t) {
- logger.error("Error checking transaction status.", t);
- }
- }
- }
-
- public void processExchange(MessageExchange exchange) throws Exception {
- if (logger.isDebugEnabled()) {
- logger.debug("Received exchange: status: " + exchange.getStatus() + ", role: " + exchange.getRole());
- }
- if (exchange.getRole() == Role.PROVIDER) {
- boolean dynamic = false;
- ServiceEndpoint endpoint = exchange.getEndpoint();
- String key = EndpointSupport.getKey(exchange.getEndpoint());
- Endpoint ep = (Endpoint) this.component.getRegistry().getEndpoint(key);
- if (ep == null) {
- if (endpoint.getServiceName().equals(getEPRServiceName())) {
- ep = getResolvedEPR(exchange.getEndpoint());
- dynamic = true;
- }
- if (ep == null) {
- throw new IllegalStateException("Endpoint not found: " + key);
- }
- }
- ExchangeProcessor processor = ep.getProcessor();
- if (processor == null) {
- throw new IllegalStateException("No processor found for endpoint: " + key);
- }
- try {
- processor.process(exchange);
- } finally {
- // If the endpoint is dynamic, deactivate it
- if (dynamic) {
- ep.deactivate();
- }
- }
- } else {
- ExchangeProcessor processor = null;
- if (exchange.getProperty(JbiConstants.SENDER_ENDPOINT) != null) {
- String key = exchange.getProperty(JbiConstants.SENDER_ENDPOINT).toString();
- Endpoint ep = (Endpoint) this.component.getRegistry().getEndpoint(key);
- if (ep != null) {
- processor = ep.getProcessor();
- }
- } else {
- processor = (ExchangeProcessor) processors.remove(exchange.getExchangeId());
- }
- if (processor == null) {
- throw new IllegalStateException("No processor found for: " + exchange.getExchangeId());
- }
- processor.process(exchange);
- }
- }
-
- /**
- *
- * @param exchange
- * @param processor
- * @throws MessagingException
- * @deprecated use sendConsumerExchange(MessageExchange, Endpoint) instead
- */
- public void sendConsumerExchange(MessageExchange exchange, ExchangeProcessor processor) throws MessagingException {
- // If the exchange is not ACTIVE, no answer is expected
- if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
- processors.put(exchange.getExchangeId(), processor);
- }
- channel.send(exchange);
- }
-
- /**
- * This method allows the component to keep no state in memory so that
- * components can be clustered and provide fail-over and load-balancing.
- * @param exchange
- * @param endpoint
- * @throws MessagingException
- */
- public void sendConsumerExchange(MessageExchange exchange, Endpoint endpoint) throws MessagingException {
- String key = EndpointSupport.getKey(endpoint);
- exchange.setProperty(JbiConstants.SENDER_ENDPOINT, key);
- channel.send(exchange);
- }
-
- /**
- * Handle an exchange sent to an EPR resolved by this component
- * @param exchange
- * @return an endpoint to use for handling the exchange
- * @throws Exception
- */
- protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception {
- throw new UnsupportedOperationException("Component does not handle EPR exchanges");
- }
-
-}
+/*
+ * 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.common;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import javax.jbi.JBIException;
+import javax.jbi.component.ComponentContext;
+import javax.jbi.component.ComponentLifeCycle;
+import javax.jbi.messaging.DeliveryChannel;
+import javax.jbi.messaging.ExchangeStatus;
+import javax.jbi.messaging.MessageExchange;
+import javax.jbi.messaging.MessagingException;
+import javax.jbi.messaging.MessageExchange.Role;
+import javax.jbi.servicedesc.ServiceEndpoint;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import javax.resource.spi.work.Work;
+import javax.resource.spi.work.WorkManager;
+import javax.transaction.Status;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.xml.namespace.QName;
+
+import org.apache.commons.logging.Log;
+import org.apache.servicemix.JbiConstants;
+
+import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
+import edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Base class for life cycle management of components.
+ * This class may be used as is.
+ *
+ * @author Guillaume Nodet
+ * @version $Revision: 399873 $
+ * @since 3.0
+ */
+public class AsyncBaseLifeCycle implements ComponentLifeCycle {
+
+ protected final transient Log logger;
+
+ protected BaseComponent component;
+ protected ComponentContext context;
+ protected ObjectName mbeanName;
+ protected WorkManager workManager;
+ protected AtomicBoolean running;
+ protected DeliveryChannel channel;
+ protected Thread poller;
+ protected AtomicBoolean polling;
+ protected TransactionManager transactionManager;
+ protected boolean workManagerCreated;
+ protected Map processors = new ConcurrentHashMap();
+
+
+ public AsyncBaseLifeCycle(BaseComponent component) {
+ this.component = component;
+ this.logger = component.logger;
+ this.running = new AtomicBoolean(false);
+ this.polling = new AtomicBoolean(false);
+ this.processors = new ConcurrentHashMap();
+ }
+
+ /* (non-Javadoc)
+ * @see javax.jbi.component.ComponentLifeCycle#getExtensionMBeanName()
+ */
+ public ObjectName getExtensionMBeanName() {
+ return mbeanName;
+ }
+
+ protected Object getExtensionMBean() throws Exception {
+ return null;
+ }
+
+ protected ObjectName createExtensionMBeanName() throws Exception {
+ return this.context.getMBeanNames().createCustomComponentMBeanName("Configuration");
+ }
+
+ protected QName getEPRServiceName() {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see javax.jbi.component.ComponentLifeCycle#init(javax.jbi.component.ComponentContext)
+ */
+ public void init(ComponentContext context) throws JBIException {
+ try {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Initializing component");
+ }
+ this.context = context;
+ this.channel = context.getDeliveryChannel();
+ this.transactionManager = (TransactionManager) context.getTransactionManager();
+ doInit();
+ if (logger.isDebugEnabled()) {
+ logger.debug("Component initialized");
+ }
+ } catch (JBIException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new JBIException("Error calling init", e);
+ }
+ }
+
+ protected void doInit() throws Exception {
+ // Register extension mbean
+ Object mbean = getExtensionMBean();
+ if (mbean != null) {
+ MBeanServer server = this.context.getMBeanServer();
+ if (server == null) {
+ // TODO: log a warning ?
+ //throw new JBIException("null mBeanServer");
+ } else {
+ this.mbeanName = createExtensionMBeanName();
+ if (server.isRegistered(this.mbeanName)) {
+ server.unregisterMBean(this.mbeanName);
+ }
+ server.registerMBean(mbean, this.mbeanName);
+ }
+ }
+ // Obtain or create the work manager
+ // When using the WorkManager from ServiceMix,
+ // some class loader problems can appear when
+ // trying to uninstall the components.
+ // Some threads owned by the work manager have a
+ // security context referencing the component class loader
+ // so that every loaded classes are locked
+ //this.workManager = findWorkManager();
+ if (this.workManager == null) {
+ this.workManagerCreated = true;
+ this.workManager = createWorkManager();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.jbi.component.ComponentLifeCycle#shutDown()
+ */
+ public void shutDown() throws JBIException {
+ try {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Shutting down component");
+ }
+ doShutDown();
+ this.context = null;
+ if (logger.isDebugEnabled()) {
+ logger.debug("Component shut down");
+ }
+ } catch (JBIException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new JBIException("Error calling shutdown", e);
+ }
+ }
+
+ protected void doShutDown() throws Exception {
+ // Unregister mbean
+ if (this.mbeanName != null) {
+ MBeanServer server = this.context.getMBeanServer();
+ if (server == null) {
+ throw new JBIException("null mBeanServer");
+ }
+ if (server.isRegistered(this.mbeanName)) {
+ server.unregisterMBean(this.mbeanName);
+ }
+ }
+ // Destroy work manager, if created
+ if (this.workManagerCreated) {
+ if (this.workManager instanceof BasicWorkManager) {
+ ((BasicWorkManager) this.workManager).shutDown();
+ }
+ this.workManager = null;
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.jbi.component.ComponentLifeCycle#start()
+ */
+ public void start() throws JBIException {
+ try {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Starting component");
+ }
+ if (this.running.compareAndSet(false, true)) {
+ doStart();
+ }
+ if (logger.isDebugEnabled()) {
+ logger.debug("Component started");
+ }
+ } catch (JBIException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new JBIException("Error calling start", e);
+ }
+ }
+
+ protected void doStart() throws Exception {
+ synchronized (this.polling) {
+ workManager.startWork(new Work() {
+ public void release() { }
+ public void run() {
+ poller = Thread.currentThread();
+ pollDeliveryChannel();
+ }
+ });
+ polling.wait();
+ }
+ }
+
+ protected void pollDeliveryChannel() {
+ synchronized (polling) {
+ polling.set(true);
+ polling.notify();
+ }
+ while (running.get()) {
+ try {
+ final MessageExchange exchange = channel.accept(1000L);
+ if (exchange != null) {
+ final Transaction tx = (Transaction) exchange.getProperty(MessageExchange.JTA_TRANSACTION_PROPERTY_NAME);
+ if (tx != null) {
+ if (transactionManager == null) {
+ throw new IllegalStateException("Exchange is enlisted in a transaction, but no transaction manager is available");
+ }
+ transactionManager.suspend();
+ }
+ workManager.scheduleWork(new Work() {
+ public void release() {
+ }
+ public void run() {
+ processExchangeInTx(exchange, tx);
+ }
+ });
+ }
+ } catch (Throwable t) {
+ if (running.get() == false) {
+ // Should have been interrupted, discard the throwable
+ if (logger.isDebugEnabled()) {
+ logger.debug("Polling thread will stop");
+ }
+ } else {
+ logger.error("Error polling delivery channel", t);
+ }
+ }
+ }
+ synchronized (polling) {
+ polling.set(false);
+ polling.notify();
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see javax.jbi.component.ComponentLifeCycle#stop()
+ */
+ public void stop() throws JBIException {
+ try {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Stopping component");
+ }
+ if (this.running.compareAndSet(true, false)) {
+ doStop();
+ }
+ if (logger.isDebugEnabled()) {
+ logger.debug("Component stopped");
+ }
+ } catch (JBIException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new JBIException("Error calling stop", e);
+ }
+ }
+
+ protected void doStop() throws Exception {
+ // Interrupt the polling thread and await termination
+ try {
+ synchronized (polling) {
+ if (polling.get()) {
+ poller.interrupt();
+ polling.wait();
+ }
+ }
+ } finally {
+ poller = null;
+ }
+ }
+
+ /**
+ * @return Returns the context.
+ */
+ public ComponentContext getContext() {
+ return context;
+ }
+
+ public WorkManager getWorkManager() {
+ return workManager;
+ }
+
+ protected WorkManager createWorkManager() {
+ // Create a very simple one
+ return new BasicWorkManager();
+ }
+
+ protected WorkManager findWorkManager() {
+ // If inside ServiceMix, retrieve its work manager
+ try {
+ Method getContainerMth = context.getClass().getMethod("getContainer", new Class[0]);
+ Object container = getContainerMth.invoke(context, new Object[0]);
+ Method getWorkManagerMth = container.getClass().getMethod("getWorkManager", new Class[0]);
+ return (WorkManager) getWorkManagerMth.invoke(container, new Object[0]);
+ } catch (Throwable t) {
+ if (logger.isDebugEnabled()) {
+ logger.debug("JBI container is not ServiceMix. Will create our own WorkManager", t);
+ }
+ }
+ // TODO: should look in jndi for an existing work manager
+ return null;
+ }
+
+ protected void processExchangeInTx(MessageExchange exchange, Transaction tx) {
+ try {
+ if (tx != null) {
+ transactionManager.resume(tx);
+ }
+ processExchange(exchange);
+ } catch (Exception e) {
+ logger.error("Error processing exchange " + exchange, e);
+ try {
+ // If we are transacted and this is a runtime exception
+ // try to mark transaction as rollback
+ if (tx != null && e instanceof RuntimeException) {
+ transactionManager.setRollbackOnly();
+ } else {
+ exchange.setError(e);
+ channel.send(exchange);
+ }
+ } catch (Exception inner) {
+ logger.error("Error setting exchange status to ERROR", inner);
+ }
+ } finally {
+ try {
+ // Check transaction status
+ if (tx != null) {
+ int status = transactionManager.getStatus();
+ // We use pull delivery, so the transaction should already
+ // have been transfered to another thread because the component
+ // must have answered.
+ if (status != Status.STATUS_NO_TRANSACTION) {
+ logger.error("Transaction is still active after exchange processing. Trying to rollback transaction.");
+ try {
+ transactionManager.rollback();
+ } catch (Throwable t) {
+ logger.error("Error trying to rollback transaction.", t);
+ }
+ }
+ }
+ } catch (Throwable t) {
+ logger.error("Error checking transaction status.", t);
+ }
+ }
+ }
+
+ public void processExchange(MessageExchange exchange) throws Exception {
+ if (logger.isDebugEnabled()) {
+ logger.debug("Received exchange: status: " + exchange.getStatus() + ", role: " + exchange.getRole());
+ }
+ if (exchange.getRole() == Role.PROVIDER) {
+ boolean dynamic = false;
+ ServiceEndpoint endpoint = exchange.getEndpoint();
+ String key = EndpointSupport.getKey(exchange.getEndpoint());
+ Endpoint ep = (Endpoint) this.component.getRegistry().getEndpoint(key);
+ if (ep == null) {
+ if (endpoint.getServiceName().equals(getEPRServiceName())) {
+ ep = getResolvedEPR(exchange.getEndpoint());
+ dynamic = true;
+ }
+ if (ep == null) {
+ throw new IllegalStateException("Endpoint not found: " + key);
+ }
+ }
+ ExchangeProcessor processor = ep.getProcessor();
+ if (processor == null) {
+ throw new IllegalStateException("No processor found for endpoint: " + key);
+ }
+ try {
+ processor.process(exchange);
+ } finally {
+ // If the endpoint is dynamic, deactivate it
+ if (dynamic) {
+ ep.deactivate();
+ }
+ }
+ } else {
+ ExchangeProcessor processor = null;
+ if (exchange.getProperty(JbiConstants.SENDER_ENDPOINT) != null) {
+ String key = exchange.getProperty(JbiConstants.SENDER_ENDPOINT).toString();
+ Endpoint ep = (Endpoint) this.component.getRegistry().getEndpoint(key);
+ if (ep != null) {
+ processor = ep.getProcessor();
+ }
+ } else {
+ processor = (ExchangeProcessor) processors.remove(exchange.getExchangeId());
+ }
+ if (processor == null) {
+ throw new IllegalStateException("No processor found for: " + exchange.getExchangeId());
+ }
+ processor.process(exchange);
+ }
+ }
+
+ /**
+ *
+ * @param exchange
+ * @param processor
+ * @throws MessagingException
+ * @deprecated use sendConsumerExchange(MessageExchange, Endpoint) instead
+ */
+ public void sendConsumerExchange(MessageExchange exchange, ExchangeProcessor processor) throws MessagingException {
+ // If the exchange is not ACTIVE, no answer is expected
+ if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
+ processors.put(exchange.getExchangeId(), processor);
+ }
+ channel.send(exchange);
+ }
+
+ /**
+ * This method allows the component to keep no state in memory so that
+ * components can be clustered and provide fail-over and load-balancing.
+ * @param exchange
+ * @param endpoint
+ * @throws MessagingException
+ */
+ public void sendConsumerExchange(MessageExchange exchange, Endpoint endpoint) throws MessagingException {
+ String key = EndpointSupport.getKey(endpoint);
+ exchange.setProperty(JbiConstants.SENDER_ENDPOINT, key);
+ channel.send(exchange);
+ }
+
+ /**
+ * Handle an exchange sent to an EPR resolved by this component
+ * @param exchange
+ * @return an endpoint to use for handling the exchange
+ * @throws Exception
+ */
+ protected Endpoint getResolvedEPR(ServiceEndpoint ep) throws Exception {
+ throw new UnsupportedOperationException("Component does not handle EPR exchanges");
+ }
+
+}
Propchange: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/AsyncBaseLifeCycle.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/Schema.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/Schema.java?rev=426392&r1=426391&r2=426392&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/Schema.java (original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/Schema.java Thu Jul 27 22:49:32 2006
@@ -1,103 +1,103 @@
-/*
- * 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.common.tools.wsdl;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.w3c.dom.Element;
-
-/**
- * Contains informations related to a schema.
- *
- * @author gnodet
- */
-public class Schema {
-
- private Element root;
- private String namespace;
- private List imports;
- private URI sourceUri;
-
- /**
- * Add a reference to an imported namespace.
- * @param namespace the namespace to reference
- */
- public void addImport(String namespace) {
- if (imports == null) {
- imports = new ArrayList();
- }
- imports.add(namespace);
- }
-
- /**
- * @return Returns the imports.
- */
- public List getImports() {
- return imports;
- }
-
- /**
- * @param imports The imports to set.
- */
- public void setImports(List imports) {
- this.imports = imports;
- }
-
- /**
- * @return Returns the root.
- */
- public Element getRoot() {
- return root;
- }
-
- /**
- * @param root The root to set.
- */
- public void setRoot(Element root) {
- this.root = root;
- }
-
- /**
- * @return Returns the namespace.
- */
- public String getNamespace() {
- return namespace;
- }
-
- /**
- * @param namespace The namespace to set.
- */
- public void setNamespace(String namespace) {
- this.namespace = namespace;
- }
-
- /**
- * @return Returns the sourceUri.
- */
- public URI getSourceUri() {
- return sourceUri;
- }
-
- /**
- * @param sourceUri The sourceUri to set.
- */
- public void setSourceUri(URI sourceUri) {
- this.sourceUri = sourceUri;
- }
-
-}
+/*
+ * 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.common.tools.wsdl;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.w3c.dom.Element;
+
+/**
+ * Contains informations related to a schema.
+ *
+ * @author gnodet
+ */
+public class Schema {
+
+ private Element root;
+ private String namespace;
+ private List imports;
+ private URI sourceUri;
+
+ /**
+ * Add a reference to an imported namespace.
+ * @param namespace the namespace to reference
+ */
+ public void addImport(String namespace) {
+ if (imports == null) {
+ imports = new ArrayList();
+ }
+ imports.add(namespace);
+ }
+
+ /**
+ * @return Returns the imports.
+ */
+ public List getImports() {
+ return imports;
+ }
+
+ /**
+ * @param imports The imports to set.
+ */
+ public void setImports(List imports) {
+ this.imports = imports;
+ }
+
+ /**
+ * @return Returns the root.
+ */
+ public Element getRoot() {
+ return root;
+ }
+
+ /**
+ * @param root The root to set.
+ */
+ public void setRoot(Element root) {
+ this.root = root;
+ }
+
+ /**
+ * @return Returns the namespace.
+ */
+ public String getNamespace() {
+ return namespace;
+ }
+
+ /**
+ * @param namespace The namespace to set.
+ */
+ public void setNamespace(String namespace) {
+ this.namespace = namespace;
+ }
+
+ /**
+ * @return Returns the sourceUri.
+ */
+ public URI getSourceUri() {
+ return sourceUri;
+ }
+
+ /**
+ * @param sourceUri The sourceUri to set.
+ */
+ public void setSourceUri(URI sourceUri) {
+ this.sourceUri = sourceUri;
+ }
+
+}
Propchange: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/Schema.java
------------------------------------------------------------------------------
svn:eol-style = native