Author: vamsic007
Date: Thu Nov 20 06:50:18 2008
New Revision: 719244
URL: http://svn.apache.org/viewvc?rev=719244&view=rev
Log:
Preprocess properties as well.
Modified:
tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
Modified:
tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
URL:
http://svn.apache.org/viewvc/tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java?rev=719244&r1=719243&r2=719244&view=diff
==============================================================================
---
tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
(original)
+++
tuscany/branches/sca-java-1.x/modules/implementation-web/src/main/java/org/apache/tuscany/sca/implementation/web/impl/WebImplementationImpl.java
Thu Nov 20 06:50:18 2008
@@ -97,7 +97,7 @@
}
/**
- * Use preProcess to add any references dynamically
+ * Use preProcess to add any references and properties dynamically
* TODO: also support introspection and handle WEB-INF/web.componentType
(spec line 503)
*/
public void preProcess(Component component) {
@@ -111,6 +111,12 @@
getReferences().add(createReference(reference));
}
}
+
+ for (Property property : rtc.getProperties()) {
+ if (getProperty(property.getName()) == null) {
+ getProperties().add(createProperty(property));
+ }
+ }
}
protected Reference getReference(String name) {
@@ -132,4 +138,23 @@
return newReference;
}
+ protected Property getProperty(String name) {
+ for (Property property : getProperties()) {
+ if (property.getName().equals(name)) {
+ return property;
+ }
+ }
+ return null;
+ }
+
+ protected Property createProperty(Property property) {
+ Property newProperty;
+ try {
+ newProperty = (Property)property.clone();
+ } catch (CloneNotSupportedException e) {
+ throw new AssertionError(e); // should not ever happen
+ }
+ return newProperty;
+ }
+
}