From 4dd27680428008ecffa48da348f9707d57c18a4d Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 3 Apr 2009 18:19:46 +0000 Subject: Merge changes from the trunk git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@761748 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tuscany/sca/interfacedef/Interface.java | 31 ++++++----- .../apache/tuscany/sca/interfacedef/Operation.java | 60 ++++++++++++---------- .../sca/interfacedef/impl/InterfaceImpl.java | 25 +++++---- .../sca/interfacedef/impl/OperationImpl.java | 35 ++++++++----- 4 files changed, 89 insertions(+), 62 deletions(-) (limited to 'branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany') diff --git a/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java b/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java index 1ad7a8f370..24f23e255d 100644 --- a/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java +++ b/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Interface.java @@ -6,19 +6,20 @@ * 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.interfacedef; import java.util.List; +import java.util.Map; import org.apache.tuscany.sca.policy.PolicySubject; @@ -33,35 +34,35 @@ public interface Interface extends Cloneable, PolicySubject { /** * Returns true if the interface is a remotable interface.. - * + * * @return true if the interface is a remotable interface */ boolean isRemotable(); /** * Sets whether the interface is a remotable or local interface. - * + * * @param remotable indicates whether the interface is remotable or local */ void setRemotable(boolean remotable); - - + + // FIXME: [rfeng] We need to re-consider the conversational as an intent /** * Test if the interface is conversational * @return */ boolean isConversational(); - + /** - * Set whether the interface is conversational + * Set whether the interface is conversational * @param conversational */ void setConversational(boolean conversational); /** * Returns the operations defined on this interface. - * + * * @return the operations defined on this interface */ List getOperations(); @@ -73,7 +74,7 @@ public interface Interface extends Cloneable, PolicySubject { */ @Deprecated void setDefaultDataBinding(String dataBinding); - + /** * Reset the databinding for the interface * @param dataBinding @@ -82,11 +83,17 @@ public interface Interface extends Cloneable, PolicySubject { /** * Returns true if the Interface is dynamic. - * + * * @return true if the Interface is dynamic. */ boolean isDynamic(); + /** + * Get a map of attributes assoicated with the interface + * @return A map of attributes + */ + Map getAttributes(); + /** * Implementations must support cloning. */ diff --git a/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java b/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java index e278fe1457..55f00b82c8 100644 --- a/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.java +++ b/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/Operation.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.interfacedef; @@ -35,28 +35,28 @@ import org.apache.tuscany.sca.policy.PolicySubject; public interface Operation extends Cloneable, PolicySubject { /** * Returns the name of the operation. - * + * * @return the name of the operation */ String getName(); /** * Sets the name of the operation. - * + * * @param name the name of the operation */ void setName(String name); /** * Returns true if the model element is unresolved. - * + * * @return true if the model element is unresolved. */ boolean isUnresolved(); /** * Sets whether the model element is unresolved. - * + * * @param unresolved whether the model element is unresolved */ void setUnresolved(boolean unresolved); @@ -64,11 +64,11 @@ public interface Operation extends Cloneable, PolicySubject { /** * Get the data type that represents the input of this operation. The logic * type is a list of data types and each element represents a parameter - * + * * @return the inputType */ DataType> getInputType(); - + /** * @param inputType */ @@ -76,11 +76,11 @@ public interface Operation extends Cloneable, PolicySubject { /** * Get the data type for the output - * + * * @return the outputType */ DataType getOutputType(); - + /** * @param outputType */ @@ -88,51 +88,51 @@ public interface Operation extends Cloneable, PolicySubject { /** * Get a list of data types to represent the faults/exceptions - * + * * @return the faultTypes */ List getFaultTypes(); - + /** * @param faultTypes */ void setFaultTypes(List faultTypes); - + /** * Get the owning interface * @return */ Interface getInterface(); - + /** * Set the owning interface * @param interfaze */ void setInterface(Interface interfaze); - + /** * Get the sequence of the conversation * @return */ ConversationSequence getConversationSequence(); - + /** * Set the sequence of conversation for the operation * @param sequence */ void setConversationSequence(ConversationSequence sequence); - + /** * Indicate if the operation is non-blocking * @return */ boolean isNonBlocking(); - + /** * Set the operation to be non-blocking */ void setNonBlocking(boolean nonBlocking); - + /** * @return the wrapperInfo */ @@ -152,7 +152,7 @@ public interface Operation extends Cloneable, PolicySubject { * @param wrapperStyle the wrapperStyle to set */ void setWrapperStyle(boolean wrapperStyle); - + /** * @deprecated This should be the WrapperInfo.getDataBinding() * Get the databinding for the operation @@ -160,7 +160,7 @@ public interface Operation extends Cloneable, PolicySubject { */ @Deprecated String getDataBinding(); - + /** * @deprecated This should be the WrapperInfo.setDataBinding() * Set the databinding for the operation @@ -168,10 +168,10 @@ public interface Operation extends Cloneable, PolicySubject { */ @Deprecated void setDataBinding(String dataBinding); - + /** * Returns true if the operation is dynamic. - * + * * @return true if the operation is dynamic otherwise false */ boolean isDynamic(); @@ -184,20 +184,26 @@ public interface Operation extends Cloneable, PolicySubject { /** * Get the synthesized fault beans for this operation - * + * * @return the fault beans */ Map>> getFaultBeans(); - + /** * Set the synthesized fault beans for this operation * @param faultBeans */ void setFaultBeans(Map>> faultBeans); + /** + * Get a map of attributes assoicated with the operation + * @return A map of attributes + */ + Map getAttributes(); + /** * Implementations must support cloning. */ Object clone() throws CloneNotSupportedException; - + } diff --git a/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java b/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java index 0890ca1664..966e1358de 100644 --- a/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java +++ b/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/InterfaceImpl.java @@ -6,33 +6,35 @@ * 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.interfacedef.impl; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import org.apache.tuscany.sca.interfacedef.DataType; import org.apache.tuscany.sca.interfacedef.Interface; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.util.WrapperInfo; -import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.ExtensionType; +import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.PolicySet; /** * Represents a service interface. - * + * * @version $Rev$ $Date$ */ public class InterfaceImpl implements Interface { @@ -42,11 +44,10 @@ public class InterfaceImpl implements Interface { private OperationList operations = new OperationList(); private boolean unresolved; - private List applicablePolicySets = new ArrayList(); private ExtensionType type; private List policySets = new ArrayList(); private List requiredIntents = new ArrayList(); - + private Map attributes = new ConcurrentHashMap(); public boolean isRemotable() { return remotable; @@ -221,10 +222,6 @@ public class InterfaceImpl implements Interface { public boolean isDynamic() { return false; } - - public List getApplicablePolicySets() { - return applicablePolicySets; - } public List getPolicySets() { return policySets; @@ -250,6 +247,8 @@ public class InterfaceImpl implements Interface { Operation clonedOperation = (Operation)operation.clone(); copy.operations.add(clonedOperation); } + copy.attributes = new ConcurrentHashMap(); + copy.attributes.putAll(attributes); return copy; } @@ -293,4 +292,8 @@ public class InterfaceImpl implements Interface { return true; } + public Map getAttributes() { + return attributes; + } + } diff --git a/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java b/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java index 2e0902e1bb..5074afc84b 100644 --- a/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.java +++ b/branches/sca-java-2.0-M2/modules/interface/src/main/java/org/apache/tuscany/sca/interfacedef/impl/OperationImpl.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.interfacedef.impl; @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import javax.xml.namespace.QName; @@ -31,13 +32,13 @@ import org.apache.tuscany.sca.interfacedef.Interface; import org.apache.tuscany.sca.interfacedef.Operation; import org.apache.tuscany.sca.interfacedef.util.WrapperInfo; import org.apache.tuscany.sca.interfacedef.util.XMLType; -import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.ExtensionType; +import org.apache.tuscany.sca.policy.Intent; import org.apache.tuscany.sca.policy.PolicySet; /** * Represents an operation on a service interface. - * + * * @version $Rev$ $Date$ */ public class OperationImpl implements Operation { @@ -53,8 +54,11 @@ public class OperationImpl implements Operation { private boolean wrapperStyle; private WrapperInfo wrapper; private boolean dynamic; + + private Map attributes = new ConcurrentHashMap(); + private Map>> faultBeans; - + private List applicablePolicySets = new ArrayList(); private List policySets = new ArrayList(); private List requiredIntents = new ArrayList(); @@ -280,11 +284,11 @@ public class OperationImpl implements Operation { public void setDynamic(boolean b) { this.dynamic = b; } - + public Map>> getFaultBeans() { return faultBeans; } - + public void setFaultBeans(Map>> faultBeans) { this.faultBeans = faultBeans; } @@ -292,7 +296,7 @@ public class OperationImpl implements Operation { @Override public OperationImpl clone() throws CloneNotSupportedException { OperationImpl copy = (OperationImpl) super.clone(); - + final List clonedFaultTypes = new ArrayList(this.faultTypes.size()); for (DataType t : this.faultTypes) { clonedFaultTypes.add((DataType) t.clone()); @@ -308,11 +312,14 @@ public class OperationImpl implements Operation { new DataTypeImpl>(inputType.getPhysical(), clonedLogicalTypes); clonedInputType.setDataBinding(inputType.getDataBinding()); copy.inputType = clonedInputType; - + if (this.outputType != null) { copy.outputType = (DataType) this.outputType.clone(); } - + + copy.attributes = new ConcurrentHashMap(); + copy.attributes.putAll(attributes); + return copy; } @@ -335,5 +342,9 @@ public class OperationImpl implements Operation { public void setType(ExtensionType type) { this.type = type; } - + + public Map getAttributes() { + return attributes; + } + } -- cgit v1.2.3