summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/implementation-web/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-23 22:48:13 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-23 22:48:13 +0000
commit90ba7b1a18706b434520d531358619438a43b4f0 (patch)
tree4c571d7829da8a0df07368ac51292bc07db5526e /java/sca/modules/implementation-web/src
parent40ddf83655bc926c1babc72ba36a1c658eadb516 (diff)
Add a QName as the type for binding/implementation and use it to compare model types instead of class
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@787865 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/implementation-web/src')
-rw-r--r--java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java26
1 files changed, 15 insertions, 11 deletions
diff --git a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
index 0495ccb600..d8a5935bea 100644
--- a/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
+++ b/java/sca/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
@@ -6,15 +6,15 @@
* to you 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.
+ * under the License.
*/
package org.apache.tuscany.sca.implementation.web.impl;
@@ -22,6 +22,8 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
+import javax.xml.namespace.QName;
+
import org.apache.tuscany.sca.assembly.Component;
import org.apache.tuscany.sca.assembly.ConstrainingType;
import org.apache.tuscany.sca.assembly.Property;
@@ -37,18 +39,20 @@ import org.apache.tuscany.sca.runtime.RuntimeComponent;
* The model representing an Web implementation in an SCA assembly model.
*/
class WebImplementationImpl extends ImplementationImpl implements WebImplementation, ComponentPreProcessor {
+ private static final QName TYPE = new QName(SCA11_NS, "implementation.web");
- private List<Property> properties = new ArrayList<Property>();
- private List<Reference> references = new ArrayList<Reference>();
+ private List<Property> properties = new ArrayList<Property>();
+ private List<Reference> references = new ArrayList<Reference>();
private String uri;
private boolean unresolved;
-
+
private String webURI;
/**
* Constructs a new Web implementation.
*/
WebImplementationImpl() {
+ super(TYPE);
}
public ConstrainingType getConstrainingType() {
@@ -64,7 +68,7 @@ class WebImplementationImpl extends ImplementationImpl implements WebImplementat
// The Web implementation does not offer services
return Collections.emptyList();
}
-
+
public List<Reference> getReferences() {
return references;
}
@@ -76,11 +80,11 @@ class WebImplementationImpl extends ImplementationImpl implements WebImplementat
public String getURI() {
return uri;
}
-
+
public void setURI(String uri) {
this.uri = uri;
}
-
+
public boolean isUnresolved() {
return unresolved;
}
@@ -99,14 +103,14 @@ class WebImplementationImpl extends ImplementationImpl implements WebImplementat
/**
* Use preProcess to add any references and properties dynamically
- * TODO: also support introspection and handle WEB-INF/web.componentType (spec line 503)
+ * TODO: also support introspection and handle WEB-INF/web.componentType (spec line 503)
*/
public void preProcess(Component component) {
if (!(component instanceof RuntimeComponent)) {
return;
}
RuntimeComponent rtc = (RuntimeComponent) component;
-
+
for (Reference reference : rtc.getReferences()) {
if (getReference(reference.getName()) == null) {
getReferences().add(createReference(reference));