Author: rfeng
Date: Wed Dec 5 12:34:09 2007
New Revision: 601509
URL: http://svn.apache.org/viewvc?rev=601509&view=rev
Log:
Minor cleanup
Modified:
incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeWireBuilderImpl.java
Modified:
incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java?rev=601509&r1=601508&r2=601509&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
(original)
+++
incubator/tuscany/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/BaseAssemblyProcessor.java
Wed Dec 5 12:34:09 2007
@@ -156,7 +156,7 @@
}
}
}
-
+
/**
* Write a list of targets into an attribute
* @param reference
@@ -164,7 +164,7 @@
*/
protected XAttr writeTargets(Reference reference) {
List<String> targets = new ArrayList<String>();
- for (Service target: reference.getTargets()) {
+ for (Service target : reference.getTargets()) {
targets.add(target.getName());
}
return new XAttr(TARGET, targets);
@@ -210,9 +210,9 @@
* @throws XMLStreamException
* @throws ContributionReadException
*/
- protected void readAbstractProperty(AbstractProperty property,
XMLStreamReader reader)
- throws XMLStreamException, ContributionReadException {
-
+ protected void readAbstractProperty(AbstractProperty property,
XMLStreamReader reader) throws XMLStreamException,
+ ContributionReadException {
+
property.setName(getString(reader, NAME));
property.setMany(getBoolean(reader, MANY));
property.setMustSupply(getBoolean(reader, MUST_SUPPLY));
@@ -273,7 +273,7 @@
}
if (binding instanceof OperationsConfigurator) {
OperationsConfigurator opConfigurator =
(OperationsConfigurator)binding;
- for ( ConfiguredOperation confOp :
opConfigurator.getConfiguredOperations() ) {
+ for (ConfiguredOperation confOp :
opConfigurator.getConfiguredOperations()) {
resolveIntents(confOp.getRequiredIntents(), resolver);
resolvePolicySets(confOp.getPolicySets(), resolver);
}
@@ -298,7 +298,7 @@
}
if (binding instanceof OperationsConfigurator) {
OperationsConfigurator opConfigurator =
(OperationsConfigurator)binding;
- for ( ConfiguredOperation confOp :
opConfigurator.getConfiguredOperations() ) {
+ for (ConfiguredOperation confOp :
opConfigurator.getConfiguredOperations()) {
resolveIntents(confOp.getRequiredIntents(),
resolver);
resolvePolicySets(confOp.getPolicySets(),
resolver);
}
@@ -308,7 +308,7 @@
resolveIntents(contract.getRequiredIntents(), resolver);
resolvePolicySets(contract.getPolicySets(), resolver);
- for ( ConfiguredOperation confOp :
contract.getConfiguredOperations() ) {
+ for (ConfiguredOperation confOp :
contract.getConfiguredOperations()) {
resolveIntents(confOp.getRequiredIntents(), resolver);
resolvePolicySets(confOp.getPolicySets(), resolver);
}
@@ -355,8 +355,8 @@
* @throws ContributionReadException
* @throws ParserConfigurationException
*/
- protected Document readPropertyValue(QName element, QName type,
XMLStreamReader reader)
- throws XMLStreamException, ContributionReadException {
+ protected Document readPropertyValue(QName element, QName type,
XMLStreamReader reader) throws XMLStreamException,
+ ContributionReadException {
Document document;
try {
@@ -475,8 +475,9 @@
declareNamespace(child, prefix, ns);
}
- if(!"".equals(name.getNamespaceURI()))
- declareNamespace(child, name.getPrefix(),
name.getNamespaceURI());
+ if (!"".equals(name.getNamespaceURI())) {
+ declareNamespace(child, name.getPrefix(),
name.getNamespaceURI());
+ }
// add the attributes for this element
count = reader.getAttributeCount();
@@ -544,7 +545,7 @@
policySets.clear();
policySets.addAll(resolvedPolicySets);
}
-
+
/**
* Write the value of a property
* @param document
@@ -553,8 +554,9 @@
* @param writer
* @throws XMLStreamException
*/
- protected void writePropertyValue(Object propertyValue, QName element,
QName type, XMLStreamWriter writer) throws XMLStreamException {
-
+ protected void writePropertyValue(Object propertyValue, QName element,
QName type, XMLStreamWriter writer)
+ throws XMLStreamException {
+
if (propertyValue instanceof Document) {
Document document = (Document)propertyValue;
NodeList nodeList = document.getDocumentElement().getChildNodes();
Modified:
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeWireBuilderImpl.java
URL:
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeWireBuilderImpl.java?rev=601509&r1=601508&r2=601509&view=diff
==============================================================================
---
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeWireBuilderImpl.java
(original)
+++
incubator/tuscany/java/sca/modules/assembly/src/main/java/org/apache/tuscany/sca/assembly/builder/impl/CompositeWireBuilderImpl.java
Wed Dec 5 12:34:09 2007
@@ -1172,13 +1172,21 @@
IntentAttachPointType
attachPointType) {
//FIXME: For now do a simple check and later implement whatever is
mentioned in the next comment
- if ( xpath != null && attachPointType != null &&
xpath.indexOf(attachPointType.getName().getLocalPart()) != -1) {
- return true;
- } else {
- return false;
- }
-
-
+ if (xpath != null && attachPointType != null) {
+ if (xpath.indexOf(attachPointType.getName().getLocalPart()) != -1)
{
+ return true;
+ }
+ // FIXME: [rfeng] Need to handle xml inheritance
+
if(attachPointType.getName().getLocalPart().startsWith("binding.")) {
+ return xpath.endsWith("binding");
+ }
+
if(attachPointType.getName().getLocalPart().startsWith("implementation.")) {
+ return xpath.endsWith("implementation");
+ }
+ }
+
+ return false;
+
//create a xml node out of the parent object.. i.e. write the parent
object as scdl fragment
//invoke PropertyUtil.evaluate(null, node, xpath)
//verify the result Node's QName against the bindingType's name
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]