From a3c182d923b874384be0be21e900e205a2692cba Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 20 Nov 2009 00:53:01 +0000 Subject: Add and support for the composite (binding and implementation levels need be to implemented by binding/impl processors) git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@882372 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/assembly/xml/PolicySubjectProcessor.java | 78 +++++++++++----------- 1 file changed, 39 insertions(+), 39 deletions(-) (limited to 'java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicySubjectProcessor.java') diff --git a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicySubjectProcessor.java b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicySubjectProcessor.java index b47be74712..6fd12b21c4 100644 --- a/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicySubjectProcessor.java +++ b/java/sca/modules/assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/PolicySubjectProcessor.java @@ -62,14 +62,14 @@ public class PolicySubjectProcessor extends BaseStAXArtifactProcessor { /** * Read policy intents associated with an operation. - * @param attachPoint + * @param subject * @param operation * @param reader */ - private void readIntents(Object attachPoint, Operation operation, XMLStreamReader reader) { - if (!(attachPoint instanceof PolicySubject)) + private void readIntents(Object subject, Operation operation, XMLStreamReader reader) { + if (!(subject instanceof PolicySubject)) return; - PolicySubject intentAttachPoint = (PolicySubject)attachPoint; + PolicySubject intentAttachPoint = (PolicySubject)subject; String value = reader.getAttributeValue(null, REQUIRES); if (value != null) { List requiredIntents = intentAttachPoint.getRequiredIntents(); @@ -89,35 +89,35 @@ public class PolicySubjectProcessor extends BaseStAXArtifactProcessor { /** * Reads policy intents and policy sets associated with an operation. - * @param attachPoint + * @param subject * @param operation * @param reader */ - public void readPolicies(Object attachPoint, Operation operation, XMLStreamReader reader) { - readIntents(attachPoint, operation, reader); - readPolicySets(attachPoint, operation, reader); + public void readPolicies(Object subject, Operation operation, XMLStreamReader reader) { + readIntents(subject, operation, reader); + readPolicySets(subject, operation, reader); } /** * Reads policy intents and policy sets. - * @param attachPoint + * @param subject * @param reader */ - public void readPolicies(Object attachPoint, XMLStreamReader reader) { - readPolicies(attachPoint, null, reader); + public void readPolicies(Object subject, XMLStreamReader reader) { + readPolicies(subject, null, reader); } /** * Reads policy sets associated with an operation. - * @param attachPoint + * @param subject * @param operation * @param reader */ - private void readPolicySets(Object attachPoint, Operation operation, XMLStreamReader reader) { - if (!(attachPoint instanceof PolicySubject)) { + private void readPolicySets(Object subject, Operation operation, XMLStreamReader reader) { + if (!(subject instanceof PolicySubject)) { return; } - PolicySubject policySubject = (PolicySubject)attachPoint; + PolicySubject policySubject = (PolicySubject)subject; String value = reader.getAttributeValue(null, POLICY_SETS); if (value != null) { List policySets = policySubject.getPolicySets(); @@ -137,55 +137,55 @@ public class PolicySubjectProcessor extends BaseStAXArtifactProcessor { /** * Write policies - * @param attachPoint + * @param subject * @return */ - XAttr writePolicies(Object attachPoint) throws XMLStreamException { - return writePolicies(attachPoint, (Operation)null); + XAttr writePolicies(Object subject) throws XMLStreamException { + return writePolicies(subject, (Operation)null); } /** * Write policies - * @param attachPoint + * @param subject * @return */ - public void writePolicyAttributes(Object attachPoint, XMLStreamWriter writer) throws XMLStreamException { - writePolicyAttributes(attachPoint, (Operation)null, writer); + public void writePolicyAttributes(Object subject, XMLStreamWriter writer) throws XMLStreamException { + writePolicyAttributes(subject, (Operation)null, writer); } /** * Write policies associated with an operation - * @param attachPoint + * @param subject * @param operation * @return */ - XAttr writePolicies(Object attachPoint, Operation operation) { + XAttr writePolicies(Object subject, Operation operation) { List attrs =new ArrayList(); - attrs.add(writeIntents(attachPoint, operation)); - attrs.add(writePolicySets(attachPoint, operation)); + attrs.add(writeIntents(subject, operation)); + attrs.add(writePolicySets(subject, operation)); return new XAttr(null, attrs); } /** * Write policies - * @param attachPoint + * @param subject * @return */ - public void writePolicyAttributes(Object attachPoint, Operation operation, XMLStreamWriter writer) throws XMLStreamException { - XAttr attr = writePolicies(attachPoint, operation); + public void writePolicyAttributes(Object subject, Operation operation, XMLStreamWriter writer) throws XMLStreamException { + XAttr attr = writePolicies(subject, operation); attr.write(writer); } /** * Write policy intents associated with an operation. - * @param attachPoint + * @param subject * @param operation */ - private XAttr writeIntents(Object attachPoint, Operation operation) { - if (!(attachPoint instanceof PolicySubject)) { + private XAttr writeIntents(Object subject, Operation operation) { + if (!(subject instanceof PolicySubject)) { return null; } - PolicySubject intentAttachPoint = (PolicySubject)attachPoint; + PolicySubject intentAttachPoint = (PolicySubject)subject; List qnames = new ArrayList(); for (Intent intent: intentAttachPoint.getRequiredIntents()) { qnames.add(intent.getName()); @@ -195,14 +195,14 @@ public class PolicySubjectProcessor extends BaseStAXArtifactProcessor { /** * Write policy sets associated with an operation. - * @param attachPoint + * @param subject * @param operation */ - private XAttr writePolicySets(Object attachPoint, Operation operation) { - if (!(attachPoint instanceof PolicySubject)) { + private XAttr writePolicySets(Object subject, Operation operation) { + if (!(subject instanceof PolicySubject)) { return null; } - PolicySubject policySetAttachPoint = (PolicySubject)attachPoint; + PolicySubject policySetAttachPoint = (PolicySubject)subject; List qnames = new ArrayList(); for (PolicySet policySet: policySetAttachPoint.getPolicySets()) { qnames.add(policySet.getName()); @@ -210,9 +210,9 @@ public class PolicySubjectProcessor extends BaseStAXArtifactProcessor { return new XAttr(Constants.POLICY_SETS, qnames); } - public void resolvePolicies(Object attachPoint, ModelResolver resolver, ProcessorContext context) { - if ( attachPoint instanceof PolicySubject ) { - PolicySubject policySetAttachPoint = (PolicySubject)attachPoint; + public void resolvePolicies(Object subject, ModelResolver resolver, ProcessorContext context) { + if ( subject instanceof PolicySubject ) { + PolicySubject policySetAttachPoint = (PolicySubject)subject; List requiredIntents = new ArrayList(); Intent resolvedIntent = null; -- cgit v1.2.3