summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java b/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java
index 45fdb73f67..1a2b5bfe89 100644
--- a/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java
+++ b/branches/sca-java-1.x/samples/binding-echo-extension/src/main/java/echo/impl/EchoBindingProcessor.java
@@ -34,10 +34,10 @@ import org.apache.tuscany.sca.contribution.service.ContributionReadException;
import org.apache.tuscany.sca.contribution.service.ContributionResolveException;
import org.apache.tuscany.sca.contribution.service.ContributionWriteException;
import org.apache.tuscany.sca.policy.Intent;
+import org.apache.tuscany.sca.policy.IntentAttachPointType;
import org.apache.tuscany.sca.policy.PolicyFactory;
import org.apache.tuscany.sca.policy.PolicySet;
import org.apache.tuscany.sca.policy.PolicySetAttachPoint;
-import org.apache.tuscany.sca.policy.IntentAttachPointType;
import org.apache.tuscany.sca.policy.impl.IntentAttachPointTypeFactoryImpl;
import echo.EchoBinding;
@@ -49,7 +49,7 @@ import echo.EchoBindingFactory;
public class EchoBindingProcessor implements StAXArtifactProcessor<EchoBinding> {
private QName BINDING_ECHO = new QName("http://echo", "binding.echo");
-
+
private final EchoBindingFactory factory;
private PolicyAttachPointProcessor policyProcessor;
@@ -68,7 +68,7 @@ public class EchoBindingProcessor implements StAXArtifactProcessor<EchoBinding>
public EchoBinding read(XMLStreamReader reader) throws ContributionReadException, XMLStreamException {
EchoBinding echoBinding = factory.createEchoBinding();
- IntentAttachPointType bindingType = new IntentAttachPointTypeFactoryImpl().createBindingType();
+ IntentAttachPointType bindingType = new IntentAttachPointTypeFactoryImpl().createBindingType();
bindingType.setName(getArtifactType());
bindingType.setUnresolved(true);
((PolicySetAttachPoint)echoBinding).setType(bindingType);
@@ -82,26 +82,27 @@ public class EchoBindingProcessor implements StAXArtifactProcessor<EchoBinding>
if (uri != null) {
echoBinding.setURI(uri);
}
-
+
policyProcessor.readPolicies(echoBinding, reader);
return echoBinding;
}
-
- public void write(EchoBinding echoBinding, XMLStreamWriter writer) throws ContributionWriteException, XMLStreamException {
+
+ public void write(EchoBinding echoBinding, XMLStreamWriter writer) throws ContributionWriteException,
+ XMLStreamException {
policyProcessor.writePolicyPrefixes(echoBinding, writer);
writer.writeStartElement(BINDING_ECHO.getNamespaceURI(), BINDING_ECHO.getLocalPart());
policyProcessor.writePolicyAttributes(echoBinding, writer);
-
+
if (echoBinding.getName() != null) {
writer.writeAttribute("name", echoBinding.getName());
}
-
+
if (echoBinding.getURI() != null) {
writer.writeAttribute("uri", echoBinding.getURI());
}
-
+
writer.writeEndElement();
}
@@ -109,16 +110,16 @@ public class EchoBindingProcessor implements StAXArtifactProcessor<EchoBinding>
PolicySetAttachPoint policySetAttachPoint = (PolicySetAttachPoint)echoBinding;
List<Intent> requiredIntents = new ArrayList<Intent>();
Intent resolvedIntent = null;
- for ( Intent intent : policySetAttachPoint.getRequiredIntents() ) {
+ for (Intent intent : policySetAttachPoint.getRequiredIntents()) {
resolvedIntent = resolver.resolveModel(Intent.class, intent);
requiredIntents.add(resolvedIntent);
}
policySetAttachPoint.getRequiredIntents().clear();
policySetAttachPoint.getRequiredIntents().addAll(requiredIntents);
-
+
List<PolicySet> resolvedPolicySets = new ArrayList<PolicySet>();
PolicySet resolvedPolicySet = null;
- for ( PolicySet policySet : policySetAttachPoint.getPolicySets() ) {
+ for (PolicySet policySet : policySetAttachPoint.getPolicySets()) {
resolvedPolicySet = resolver.resolveModel(PolicySet.class, policySet);
resolvedPolicySets.add(resolvedPolicySet);
}