You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by jb...@apache.org on 2006/08/12 02:42:51 UTC
svn commit: r430931 -
/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java
Author: jboynes
Date: Fri Aug 11 17:42:51 2006
New Revision: 430931
URL: http://svn.apache.org/viewvc?rev=430931&view=rev
Log:
fix sourcecheck problems in ServiceLoader
Modified:
incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java
Modified: incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java?rev=430931&r1=430930&r2=430931&view=diff
==============================================================================
--- incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java (original)
+++ incubator/tuscany/java/sca/core/src/main/java/org/apache/tuscany/core/loader/ServiceLoader.java Fri Aug 11 17:42:51 2006
@@ -27,6 +27,7 @@
import static org.osoa.sca.Version.XML_NAMESPACE_1_0;
import org.osoa.sca.annotations.Constructor;
+import org.apache.tuscany.spi.annotation.Autowire;
import org.apache.tuscany.spi.component.CompositeComponent;
import org.apache.tuscany.spi.deployer.DeploymentContext;
import org.apache.tuscany.spi.extension.LoaderExtension;
@@ -38,9 +39,6 @@
import org.apache.tuscany.spi.model.ModelObject;
import org.apache.tuscany.spi.model.ServiceContract;
import org.apache.tuscany.spi.model.ServiceDefinition;
-import org.apache.tuscany.spi.annotation.Autowire;
-
-import static org.osoa.sca.Version.XML_NAMESPACE_1_0;
/**
* Loads a service definition from an XML-based assembly file
@@ -60,8 +58,10 @@
return SERVICE;
}
- public ServiceDefinition load(CompositeComponent parent, XMLStreamReader reader, DeploymentContext deploymentContext) throws XMLStreamException,
- LoaderException {
+ public ServiceDefinition load(CompositeComponent parent,
+ XMLStreamReader reader,
+ DeploymentContext deploymentContext)
+ throws XMLStreamException, LoaderException {
assert SERVICE.equals(reader.getName());
String name = reader.getAttributeValue(null, "name");
String target = null;
@@ -70,46 +70,51 @@
while (true) {
int i = reader.next();
switch (i) {
- case START_ELEMENT:
+ case START_ELEMENT:
- // there is a reference already using this qname which doesn't seem appropriate.
- if (REFERENCE.equals(reader.getName())) {
- String text = reader.getElementText();
- target = text != null ? text.trim() : null;
- } else {
-
- ModelObject o = registry.load(parent, reader, deploymentContext);
- if (o instanceof ServiceContract) {
- serviceContract = (ServiceContract) o;
- } else if (o instanceof Binding) {
- binding = (Binding) o;
- }
- }
- break;
- case END_ELEMENT:
- if (SERVICE.equals(reader.getName())) {
- if (binding != null) {
- if (target == null) {
- InvalidReferenceException e = new InvalidReferenceException("No target for service ");
- e.setIdentifier(name);
- throw e;
+ // there is a reference already using this qname which doesn't seem appropriate.
+ if (REFERENCE.equals(reader.getName())) {
+ String text = reader.getElementText();
+ target = text != null ? text.trim() : null;
+ } else {
+
+ ModelObject o = registry.load(parent, reader, deploymentContext);
+ if (o instanceof ServiceContract) {
+ serviceContract = (ServiceContract) o;
+ } else if (o instanceof Binding) {
+ binding = (Binding) o;
}
- URI targetURI;
- try {
- targetURI = new URI(target);
- } catch (URISyntaxException e) {
- InvalidReferenceException ire = new InvalidReferenceException(target);
- ire.setIdentifier(name);
- throw ire;
+ }
+ break;
+ case END_ELEMENT:
+ if (SERVICE.equals(reader.getName())) {
+ if (binding != null) {
+ if (target == null) {
+ InvalidReferenceException e = new InvalidReferenceException("No target for service ");
+ e.setIdentifier(name);
+ throw e;
+ }
+ URI targetURI;
+ try {
+ targetURI = new URI(target);
+ } catch (URISyntaxException e) {
+ InvalidReferenceException ire = new InvalidReferenceException(target);
+ ire.setIdentifier(name);
+ throw ire;
+ }
+
+ // FIXME need a way to specify "remotable" on a service
+ return new BoundServiceDefinition<Binding>(name,
+ serviceContract,
+ false,
+ binding,
+ targetURI);
+ } else {
+ // FIXME need a way to specify "remotable" on a service
+ return new ServiceDefinition(name, serviceContract, false);
}
-
- // FIXME need a way to specify "remotable" on a service
- return new BoundServiceDefinition<Binding>(name, serviceContract, false, binding, targetURI);
- } else {
- // FIXME need a way to specify "remotable" on a service
- return new ServiceDefinition(name, serviceContract, false);
}
- }
+ break;
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org