axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davidills...@apache.org
Subject svn commit: r719054 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: addressing/ client/ description/
Date Wed, 19 Nov 2008 20:22:07 GMT
Author: davidillsley
Date: Wed Nov 19 12:22:06 2008
New Revision: 719054

URL: http://svn.apache.org/viewvc?rev=719054&view=rev
Log:
Make the client apis that bit simpler to understand


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java?rev=719054&r1=719053&r2=719054&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/addressing/EndpointReference.java
Wed Nov 19 12:22:06 2008
@@ -78,7 +78,7 @@
      * The list of URIs that should be considered equivalent to 
      * the WS-Addressing anonymous URI
      */
-    private static volatile List anonymousEquivalentURIs = new ArrayList();
+    private static volatile List<String> anonymousEquivalentURIs = new ArrayList<String>();
 
 
     /**
@@ -92,12 +92,12 @@
 
     private String name;
     private String address;
-    private ArrayList addressAttributes;
-    private ArrayList metaData;
-    private ArrayList metaDataAttributes;
-    private Map referenceParameters;
-    private ArrayList extensibleElements;
-    private ArrayList attributes;
+    private ArrayList<OMAttribute> addressAttributes;
+    private ArrayList<OMNode> metaData;
+    private ArrayList<OMAttribute> metaDataAttributes;
+    private Map<QName, OMElement> referenceParameters;
+    private ArrayList<OMElement> extensibleElements;
+    private ArrayList<OMAttribute> attributes;
 
     /**
      * No-Arg Constructor
@@ -117,7 +117,7 @@
         // Avoid synchronization in hasAnonymousAddress by using the
         // technique outlined at http://is.gd/gv3
         synchronized (anonymousEquivalentURIs) {
-        	ArrayList newList = new ArrayList(anonymousEquivalentURIs);
+        	ArrayList<String> newList = new ArrayList<String>(anonymousEquivalentURIs);
         	newList.add(anonymousEquivalentURI);
             anonymousEquivalentURIs = newList;
         }
@@ -139,7 +139,7 @@
             return;
         }
         if (referenceParameters == null) {
-            referenceParameters = new HashMap();
+            referenceParameters = new HashMap<QName, OMElement>();
         }
         referenceParameters.put(omElement.getQName(), omElement);
     }
@@ -165,7 +165,7 @@
      * @return - map of the reference parameters, where the key is the QName of the reference
parameter
      *         and the value is an OMElement
      */
-    public Map getAllReferenceParameters() {
+    public Map<QName, OMElement> getAllReferenceParameters() {
         return referenceParameters;
     }
 
@@ -180,19 +180,19 @@
         this.address = address;
     }
 
-    public ArrayList getAddressAttributes() {
+    public ArrayList<OMAttribute> getAddressAttributes() {
         return addressAttributes;
     }
 
-    public void setAddressAttributes(ArrayList al) {
+    public void setAddressAttributes(ArrayList<OMAttribute> al) {
         addressAttributes = al;
     }
 
-    public ArrayList getMetadataAttributes() {
+    public ArrayList<OMAttribute> getMetadataAttributes() {
         return metaDataAttributes;
     }
 
-    public void setMetadataAttributes(ArrayList al) {
+    public void setMetadataAttributes(ArrayList<OMAttribute> al) {
         metaDataAttributes = al;
     }
     
@@ -226,9 +226,9 @@
         	// If the address is not WS-A anonymous it might still be considered anonymous
         	// Avoid synchronization by using the
             // technique outlined at http://is.gd/gv3
-        	List localList = anonymousEquivalentURIs;
+        	List<String> localList = anonymousEquivalentURIs;
         	if(!localList.isEmpty()){
-        		Iterator it = localList.iterator();
+        		Iterator<String> it = localList.iterator();
         		while(it.hasNext()){
         			result = address.startsWith((String)it.next());
         			if(result){
@@ -265,12 +265,12 @@
      */
     public void addAttribute(String localName, OMNamespace ns, String value) {
         if (attributes == null) {
-            attributes = new ArrayList();
+            attributes = new ArrayList<OMAttribute>();
         }
         attributes.add(OMAbstractFactory.getOMFactory().createOMAttribute(localName, ns,
value));
     }
 
-    public ArrayList getAttributes() {
+    public ArrayList<OMAttribute> getAttributes() {
         return attributes;
     }
 
@@ -280,12 +280,12 @@
      */
     public void addAttribute(OMAttribute omAttribute) {
         if (attributes == null) {
-            attributes = new ArrayList();
+            attributes = new ArrayList<OMAttribute>();
         }
         attributes.add(omAttribute);
     }
 
-    public ArrayList getExtensibleElements() {
+    public ArrayList<OMElement> getExtensibleElements() {
         return extensibleElements;
     }
 
@@ -294,27 +294,27 @@
      *
      * @param extensibleElements
      */
-    public void setExtensibleElements(ArrayList extensibleElements) {
+    public void setExtensibleElements(ArrayList<OMElement> extensibleElements) {
         this.extensibleElements = extensibleElements;
     }
 
     public void addExtensibleElement(OMElement extensibleElement) {
         if (extensibleElement != null) {
             if (this.extensibleElements == null) {
-                this.extensibleElements = new ArrayList();
+                this.extensibleElements = new ArrayList<OMElement>();
             }
             this.extensibleElements.add(extensibleElement);
         }
     }
 
-    public ArrayList getMetaData() {
+    public ArrayList<OMNode> getMetaData() {
         return metaData;
     }
 
     public void addMetaData(OMNode metaData) {
         if (metaData != null) {
             if (this.metaData == null) {
-                this.metaData = new ArrayList();
+                this.metaData = new ArrayList<OMNode>();
             }
             this.metaData.add(metaData);
         }
@@ -342,7 +342,7 @@
      *
      * @param referenceParameters
      */
-    public void setReferenceParameters(Map referenceParameters) {
+    public void setReferenceParameters(Map<QName, OMElement> referenceParameters) {
         this.referenceParameters = referenceParameters;
     }
 
@@ -389,7 +389,7 @@
         setAddress(addressElement.getText());
         Iterator allAddrAttributes = addressElement.getAllAttributes();
         if (addressAttributes == null) {
-            addressAttributes = new ArrayList();
+            addressAttributes = new ArrayList<OMAttribute>();
         }
 
         while (allAddrAttributes.hasNext()) {
@@ -555,7 +555,7 @@
 
         // TODO: is a strict test ok to use?
 
-        ArrayList eprMetaData = epr.getMetaData();
+        ArrayList<OMNode> eprMetaData = epr.getMetaData();
 
         if ((this.metaData != null) && (eprMetaData != null)) {
             if (!this.metaData.equals(eprMetaData)) {
@@ -576,7 +576,7 @@
         }
 
 
-        ArrayList eprExtensibleElements = epr.getExtensibleElements();
+        ArrayList<OMElement> eprExtensibleElements = epr.getExtensibleElements();
 
         if ((this.extensibleElements != null) && (eprExtensibleElements != null))
{
             if (!this.extensibleElements.equals(eprExtensibleElements)) {
@@ -597,7 +597,7 @@
         }
 
 
-        ArrayList eprAttributes = epr.getAttributes();
+        ArrayList<OMAttribute> eprAttributes = epr.getAttributes();
 
         if ((this.attributes != null) && (eprAttributes != null)) {
             if (!this.attributes.equals(eprAttributes)) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java?rev=719054&r1=719053&r2=719054&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/OperationClient.java
Wed Nov 19 12:22:06 2008
@@ -39,6 +39,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.xml.namespace.QName;
+
 /**
  * An operation client is the way an advanced user interacts with Axis2. Actual
  * operation clients understand a specific MEP and hence their behavior is
@@ -254,9 +256,9 @@
                 options.getParent().isManageSession())) {
             EndpointReference tepr = sc.getTargetEPR();
             if (tepr != null) {
-                Map map = tepr.getAllReferenceParameters();
+                Map<QName, OMElement> map = tepr.getAllReferenceParameters();
                 if (map != null) {
-                    Iterator valuse = map.values().iterator();
+                    Iterator<OMElement> valuse = map.values().iterator();
                     while (valuse.hasNext()) {
                         Object refparaelement = valuse.next();
                         if (refparaelement instanceof OMElement) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java?rev=719054&r1=719053&r2=719054&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/Options.java Wed
Nov 19 12:22:06 2008
@@ -127,7 +127,7 @@
     /**
      * @serial properties
      */
-    private Map properties;
+    private Map<String, Object> properties;
 
     // ==========================================================================
     //                  Parameters that can be set via Options
@@ -159,11 +159,11 @@
     private String messageId;
 
     // Array of RelatesTo objects
-    private List relationships;
+    private List<RelatesTo> relationships;
 
     private EndpointReference replyTo;
 
-    private ArrayList referenceParameters;
+    private ArrayList<OMElement> referenceParameters;
 
     /**
      * This is used for sending and receiving messages.
@@ -333,16 +333,16 @@
      *
      * @return copy of general properties
      */
-    public Map getProperties() {
+    public Map<String, Object> getProperties() {
         // make sure that the Options properties exists
         if (this.properties == null) {
-            this.properties = new HashMap();
+            this.properties = new HashMap<String, Object>();
         }
 
         if (parent == null) {
-            return new HashMap(properties);
+            return new HashMap<String, Object>(properties);
         } else {
-            Map props = parent.getProperties();
+            Map<String, Object> props = parent.getProperties();
             props.putAll(properties);
             return props;
         }
@@ -443,7 +443,7 @@
         relationships = null;
     }
         else{
-            ArrayList arraylist = new ArrayList(list.length);
+            ArrayList<RelatesTo> arraylist = new ArrayList<RelatesTo>(list.length);
             for(int i = 0 ; i < list.length ; i++){
                    arraylist.add(list[i]);
             }
@@ -662,14 +662,14 @@
      *
      * @param properties
      */
-    public void setProperties(Map properties) {
+    public void setProperties(Map<String, Object> properties) {
         
         if (this.properties != properties) {
             if (DEBUG_ENABLED) {
-                for (Iterator iterator = properties.entrySet().iterator();
+                for (Iterator<Entry<String, Object>> iterator = properties.entrySet().iterator();
                 iterator.hasNext();) {
-                    Entry entry = (Entry) iterator.next();
-                    debugPropertySet((String) entry.getKey(), entry.getValue());
+                    Entry<String, Object> entry = iterator.next();
+                    debugPropertySet(entry.getKey(), entry.getValue());
 
                 }
             }
@@ -864,7 +864,7 @@
     public void setProperty(String propertyKey, Object property) {
         // make sure that the Options properties exists
         if (this.properties == null) {
-            this.properties = new HashMap();
+            this.properties = new HashMap<String, Object>();
         }
         properties.put(propertyKey, property);
         if (DEBUG_ENABLED) {
@@ -879,7 +879,7 @@
      */
     public void addRelatesTo(RelatesTo relatesTo) {
         if (relationships == null) {
-            relationships = new ArrayList(5);
+            relationships = new ArrayList<RelatesTo>(5);
         }
         relationships.add(relatesTo);
     }
@@ -1029,7 +1029,7 @@
      */
     public void addReferenceParameter(OMElement referenceParameter) {
         if (referenceParameters == null) {
-            referenceParameters = new ArrayList(5);
+            referenceParameters = new ArrayList<OMElement>(5);
         }
 
         referenceParameters.add(referenceParameter);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java?rev=719054&r1=719053&r2=719054&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/client/ServiceClient.java
Wed Nov 19 12:22:06 2008
@@ -114,7 +114,7 @@
     private Options overrideOptions;
 
     // list of headers to be sent with the simple APIs
-    private ArrayList headers;
+    private ArrayList<OMElement> headers;
 
     //whether we create configctx or not
     private boolean createConfigCtx;
@@ -394,7 +394,7 @@
      */
     public void addHeader(OMElement header) {
         if (headers == null) {
-            headers = new ArrayList();
+            headers = new ArrayList<OMElement>();
         }
         headers.add(header);
     }
@@ -406,7 +406,7 @@
      */
     public void addHeader(SOAPHeaderBlock header) {
         if (headers == null) {
-            headers = new ArrayList();
+            headers = new ArrayList<OMElement>();
         }
         headers.add(header);
     }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?rev=719054&r1=719053&r2=719054&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
Wed Nov 19 12:22:06 2008
@@ -58,7 +58,7 @@
 
     private Map children;
 
-    protected Map engagedModules;
+    protected Map<String, AxisModule> engagedModules;
 
     /** List of ParameterObservers who want to be notified of changes */
     protected List parameterObservers = null;
@@ -444,7 +444,7 @@
      * @throws AxisFault if there's a problem engaging
      */
     public void engageModule(AxisModule axisModule, AxisDescription source) throws AxisFault
{
-        if (engagedModules == null) engagedModules = new ConcurrentHashMap();
+        if (engagedModules == null) engagedModules = new ConcurrentHashMap<String, AxisModule>();
         String moduleName = axisModule.getName();
         for (Object o : engagedModules.values()) {
             AxisModule tempAxisModule = ((AxisModule)o);
@@ -480,9 +480,9 @@
         // Default version does nothing, feel free to override
     }
 
-    static Collection NULL_MODULES = new ArrayList(0);
+    static Collection<AxisModule> NULL_MODULES = new ArrayList<AxisModule>(0);
 
-    public Collection getEngagedModules() {
+    public Collection<AxisModule> getEngagedModules() {
         return engagedModules == null ? NULL_MODULES : engagedModules.values();
     }
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?rev=719054&r1=719053&r2=719054&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
Wed Nov 19 12:22:06 2008
@@ -592,7 +592,7 @@
             }
         }
 
-		Iterator modules = getEngagedModules().iterator();
+		Iterator<AxisModule> modules = getEngagedModules().iterator();
 
 		while (modules.hasNext()) {
 			AxisModule module = (AxisModule) modules.next();
@@ -1785,7 +1785,7 @@
 	 * 
 	 * @return Returns HashMap
 	 */
-	public Iterator getOperations() {
+	public Iterator<AxisOperation> getOperations() {
 		return getChildren();
 	}
 



Mime
View raw message