axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdani...@apache.org
Subject svn commit: r594273 - in /webservices/axis2/trunk/java/modules: addressing/src/org/apache/axis2/handlers/addressing/ kernel/src/org/apache/axis2/dataretrieval/ kernel/src/org/apache/axis2/dataretrieval/client/ kernel/src/org/apache/axis2/deployment/ ke...
Date Mon, 12 Nov 2007 19:52:21 GMT
Author: gdaniels
Date: Mon Nov 12 11:52:19 2007
New Revision: 594273

URL: http://svn.apache.org/viewvc?rev=594273&view=rev
Log:
Checking in some stuff that was building up in my working copy.

Code cleanup, spelling corrections, etc.

Modified:
    webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java

Modified: webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java?rev=594273&r1=594272&r2=594273&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
(original)
+++ webservices/axis2/trunk/java/modules/addressing/src/org/apache/axis2/handlers/addressing/AddressingInHandler.java
Mon Nov 12 11:52:19 2007
@@ -53,24 +53,26 @@
 
     protected String addressingNamespace = Final.WSA_NAMESPACE;  // defaulting to final version
     protected String addressingVersion = null;
-    
-	public static final String DISABLE_REF_PARAMETER_EXTRACT = "disableRefParamExtract";
-    
+
+    public static final String DISABLE_REF_PARAMETER_EXTRACT = "disableRefParamExtract";
+
     private static final Log log = LogFactory.getLog(AddressingInHandler.class);
 
     private boolean disableRefparamExtract = false;
-        	  	 
+
     public void init(HandlerDescription handlerdesc) {
-    	super.init(handlerdesc);
-    	disableRefparamExtract = JavaUtils.isTrueExplicitly(Utils.getParameterValue(handlerdesc.getParameter(DISABLE_REF_PARAMETER_EXTRACT)));
-    	if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
-    		log.debug("AddressingInHandler.init disableRefparamExtract="+disableRefparamExtract);
-    	}
+        super.init(handlerdesc);
+        disableRefparamExtract = JavaUtils.isTrueExplicitly(
+                Utils.getParameterValue(handlerdesc.getParameter(DISABLE_REF_PARAMETER_EXTRACT)));
+        if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
+            log.debug("AddressingInHandler.init disableRefparamExtract=" + disableRefparamExtract);
+        }
     }
-    
+
     public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
         // if another handler has already processed the addressing headers, do not do anything
here.
-        if (JavaUtils.isTrueExplicitly(msgContext.getLocalProperty(IS_ADDR_INFO_ALREADY_PROCESSED),
false)) {
+        if (JavaUtils.isTrueExplicitly(msgContext.getLocalProperty(IS_ADDR_INFO_ALREADY_PROCESSED),
+                                       false)) {
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(
                         "Another handler has processed the addressing headers. Nothing to
do here.");
@@ -79,13 +81,13 @@
         }
 
         // check whether someone has explicitly set which addressing handler should run.
-        String namespace = (String)msgContext.getProperty(WS_ADDRESSING_VERSION);
+        String namespace = (String) msgContext.getProperty(WS_ADDRESSING_VERSION);
         if (namespace == null) {
             namespace = addressingNamespace;
         } else if (!namespace.equals(addressingNamespace)) {
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug("This addressing handler does not match the specified namespace,
" +
-                        namespace);
+                          namespace);
             }
 
             return InvocationResponse.CONTINUE;
@@ -112,10 +114,10 @@
 
             if (LoggingControl.debugLoggingAllowed && log.isDebugEnabled()) {
                 log.debug(addressingVersion +
-                        " Headers present in the SOAP message. Starting to process ...");
+                          " Headers present in the SOAP message. Starting to process ...");
             }
-            if(extractAddressingInformation(header, msgContext, addressingHeaders, namespace)){
-            	msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, Boolean.TRUE);
+            if (extractAddressingInformation(header, msgContext, addressingHeaders, namespace))
{
+                msgContext.setProperty(IS_ADDR_INFO_ALREADY_PROCESSED, Boolean.TRUE);
             }
         } else {
             msgContext.setProperty(DISABLE_ADDRESSING_FOR_OUT_MESSAGES, Boolean.TRUE);
@@ -126,110 +128,125 @@
 
         return InvocationResponse.CONTINUE;
     }
-    
+
     protected static final int TO_FLAG = 1, FROM_FLAG = 2, REPLYTO_FLAG = 3,
-	FAULTO_FLAG = 4, MESSAGEID_FLAG = 6, ACTION_FLAG = 0;
-    /** @return true if addressing information was found */
+            FAULTO_FLAG = 4, MESSAGEID_FLAG = 6, ACTION_FLAG = 0;
+
+    /**
+     * Pull addressing headers out from the SOAP message.
+     *
+     * @param header the header of the SOAP message
+     * @param messageContext the active MessageContext
+     * @param addressingHeaders a place to put the extracted headers
+     * @param namespace the addressing namespace
+     * @return true if addressing information was found
+     * @throws AxisFault if an error occurs
+     */
     protected boolean extractAddressingInformation(SOAPHeader header, MessageContext messageContext,
                                                    ArrayList addressingHeaders, String namespace)
             throws AxisFault {
 
-    	RolePlayer rolePlayer = (RolePlayer)messageContext.getConfigurationContext().getAxisConfiguration().getParameterValue(Constants.SOAP_ROLE_PLAYER_PARAMETER);
+        RolePlayer rolePlayer = (RolePlayer) messageContext.getConfigurationContext()
+                .getAxisConfiguration().getParameterValue(Constants.SOAP_ROLE_PLAYER_PARAMETER);
         Options messageContextOptions = messageContext.getOptions();
-      
+
         ArrayList duplicateHeaderNames = new ArrayList(1); // Normally will not be used for
more than 1 header
 
         ArrayList relatesToHeaders = null;
-        SOAPHeaderBlock actionBlock = null, toBlock = null, messageIDBlock = null, replyToBlock
= null, faultToBlock = null, fromBlock = null;
-        
+        SOAPHeaderBlock actionBlock = null, toBlock = null, messageIDBlock = null, replyToBlock
=
+                null, faultToBlock = null, fromBlock = null;
+
         // Per the SOAP Binding spec "headers with an incorrect cardinality MUST NOT be used"
So these variables
         // are used to keep track of invalid cardinality headers so they are not deserialised.
         boolean[] ignoreHeaders = new boolean[7];
         boolean[] checkedHeaderNames = new boolean[7];
-        
+
         // First pass just check for duplicates
-        for(int i=0;i<addressingHeaders.size();i++){
-        	SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) addressingHeaders.get(i);
-        	if (isInRole(soapHeaderBlock, rolePlayer, messageContext.isSOAP11())) {
-        		String localName = soapHeaderBlock.getLocalName();
-        		if (WSA_ACTION.equals(localName)) {
-        			actionBlock = soapHeaderBlock;
-        			checkDuplicateHeaders(WSA_ACTION, ACTION_FLAG,
-        					checkedHeaderNames, ignoreHeaders,
-        					duplicateHeaderNames);
-        		} else if (WSA_TO.equals(localName)) {
-        			toBlock = soapHeaderBlock;
-        			checkDuplicateHeaders(WSA_TO, TO_FLAG, checkedHeaderNames, ignoreHeaders, duplicateHeaderNames);
-        		} else if (WSA_MESSAGE_ID.equals(localName)) {
-        			messageIDBlock = soapHeaderBlock;
-        			checkDuplicateHeaders(WSA_MESSAGE_ID, MESSAGEID_FLAG, 
-        					checkedHeaderNames, ignoreHeaders,
-        					duplicateHeaderNames);
-        		} else if (WSA_REPLY_TO.equals(localName)) {
-        			replyToBlock = soapHeaderBlock;
-        			checkDuplicateHeaders(WSA_REPLY_TO, REPLYTO_FLAG,
-        					checkedHeaderNames, ignoreHeaders,
-        					duplicateHeaderNames);
-        		} else if (WSA_FAULT_TO.equals(localName)) {
-        			faultToBlock = soapHeaderBlock;
-        			checkDuplicateHeaders(WSA_FAULT_TO,FAULTO_FLAG,
-        					checkedHeaderNames, ignoreHeaders,
-        					duplicateHeaderNames);
-        		} else if (WSA_FROM.equals(localName)) {
-        			fromBlock = soapHeaderBlock;
-        			checkDuplicateHeaders(WSA_FROM,FROM_FLAG,
-        					checkedHeaderNames, ignoreHeaders,
-        					duplicateHeaderNames);
-        		} else if(WSA_RELATES_TO.equals(localName)){
-        			if(relatesToHeaders == null){
-        				relatesToHeaders = new ArrayList(1);
-        			}
-        			relatesToHeaders.add(soapHeaderBlock);
-        		}
-        	}
+        for (int i = 0; i < addressingHeaders.size(); i++) {
+            SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) addressingHeaders.get(i);
+            if (isInRole(soapHeaderBlock, rolePlayer, messageContext.isSOAP11())) {
+                String localName = soapHeaderBlock.getLocalName();
+                if (WSA_ACTION.equals(localName)) {
+                    actionBlock = soapHeaderBlock;
+                    checkDuplicateHeaders(WSA_ACTION, ACTION_FLAG,
+                                          checkedHeaderNames, ignoreHeaders,
+                                          duplicateHeaderNames);
+                } else if (WSA_TO.equals(localName)) {
+                    toBlock = soapHeaderBlock;
+                    checkDuplicateHeaders(WSA_TO, TO_FLAG, checkedHeaderNames, ignoreHeaders,
+                                          duplicateHeaderNames);
+                } else if (WSA_MESSAGE_ID.equals(localName)) {
+                    messageIDBlock = soapHeaderBlock;
+                    checkDuplicateHeaders(WSA_MESSAGE_ID, MESSAGEID_FLAG,
+                                          checkedHeaderNames, ignoreHeaders,
+                                          duplicateHeaderNames);
+                } else if (WSA_REPLY_TO.equals(localName)) {
+                    replyToBlock = soapHeaderBlock;
+                    checkDuplicateHeaders(WSA_REPLY_TO, REPLYTO_FLAG,
+                                          checkedHeaderNames, ignoreHeaders,
+                                          duplicateHeaderNames);
+                } else if (WSA_FAULT_TO.equals(localName)) {
+                    faultToBlock = soapHeaderBlock;
+                    checkDuplicateHeaders(WSA_FAULT_TO, FAULTO_FLAG,
+                                          checkedHeaderNames, ignoreHeaders,
+                                          duplicateHeaderNames);
+                } else if (WSA_FROM.equals(localName)) {
+                    fromBlock = soapHeaderBlock;
+                    checkDuplicateHeaders(WSA_FROM, FROM_FLAG,
+                                          checkedHeaderNames, ignoreHeaders,
+                                          duplicateHeaderNames);
+                } else if (WSA_RELATES_TO.equals(localName)) {
+                    if (relatesToHeaders == null) {
+                        relatesToHeaders = new ArrayList(1);
+                    }
+                    relatesToHeaders.add(soapHeaderBlock);
+                }
+            }
         }
-        
+
         if (actionBlock == null && toBlock == null && messageIDBlock == null
-				&& replyToBlock == null && faultToBlock == null
-				&& fromBlock == null && relatesToHeaders == null) {
-			// All of the headers must have had the non local roles so further
-			// processing should be skipped.
-			return false;
-		}
+            && replyToBlock == null && faultToBlock == null
+            && fromBlock == null && relatesToHeaders == null) {
+            // All of the headers must have had the non local roles so further
+            // processing should be skipped.
+            return false;
+        }
 
-        if (actionBlock!=null && !ignoreHeaders[ACTION_FLAG]) {
+        if (actionBlock != null && !ignoreHeaders[ACTION_FLAG]) {
             extractActionInformation(actionBlock, messageContext);
         }
-        if (toBlock != null &&!ignoreHeaders[TO_FLAG]) {
+        if (toBlock != null && !ignoreHeaders[TO_FLAG]) {
             extractToEPRInformation(toBlock,
                                     messageContextOptions,
                                     header,
                                     namespace);
-        } 
-        if (messageIDBlock!=null && !ignoreHeaders[MESSAGEID_FLAG]) {
+        }
+        if (messageIDBlock != null && !ignoreHeaders[MESSAGEID_FLAG]) {
             extractMessageIDInformation(messageIDBlock, messageContext);
-        } 
-        if (relatesToHeaders!=null) {
-        	for(int i=0;i<relatesToHeaders.size();i++){
-        		extractRelatesToInformation((SOAPHeaderBlock)relatesToHeaders.get(i), messageContextOptions);
-        	}
-        } 
-        if (replyToBlock!=null && !ignoreHeaders[REPLYTO_FLAG]) {
+        }
+        if (relatesToHeaders != null) {
+            for (int i = 0; i < relatesToHeaders.size(); i++) {
+                extractRelatesToInformation((SOAPHeaderBlock) relatesToHeaders.get(i),
+                                            messageContextOptions);
+            }
+        }
+        if (replyToBlock != null && !ignoreHeaders[REPLYTO_FLAG]) {
             extractReplyToEPRInformation(replyToBlock, namespace, messageContext);
         }
-        if (faultToBlock!=null && !ignoreHeaders[FAULTO_FLAG]) {
+        if (faultToBlock != null && !ignoreHeaders[FAULTO_FLAG]) {
             extractFaultToEPRInformation(faultToBlock, namespace, messageContext);
         }
-        if (fromBlock!=null && !ignoreHeaders[FROM_FLAG]) {
+        if (fromBlock != null && !ignoreHeaders[FROM_FLAG]) {
             extractFromEPRInformation(fromBlock, namespace, messageContext);
         }
-        
+
         // Now that all the valid wsa headers have been read, throw an exception if there
was an invalid cardinality
         // This means that if for example there are multiple MessageIDs and a FaultTo, the
FaultTo will be respected.
         if (!duplicateHeaderNames.isEmpty()) {
             // Simply choose the first problem header we came across as we can only fault
for one of them.
             AddressingFaultsHelper.triggerInvalidCardinalityFault(messageContext,
-                                                                  (String) duplicateHeaderNames.get(0));
+                                                                  (String) duplicateHeaderNames
+                                                                          .get(0));
         }
 
         // check for the presence of madatory addressing headers
@@ -242,61 +259,63 @@
     }
 
     // Copied from SOAPHeaderImpl.java - some reconciliation probably a good idea....
-    protected boolean isInRole(SOAPHeaderBlock soapHeaderBlock, RolePlayer rolePlayer, boolean
isSOAP11){
-    	String role = soapHeaderBlock.getRole();
-
-    	// 1. If role is ultimatedest, go by what the rolePlayer says
-    	if (role == null || role.equals("") ||
-    			(!isSOAP11 &&
-    					role.equals(SOAP12Constants.SOAP_ROLE_ULTIMATE_RECEIVER))) {
-    		return (rolePlayer == null || rolePlayer.isUltimateDestination());
-    	}
-
-    	// 2. If role is next, always return true
-    	if (role.equals(soapHeaderBlock.getVersion().getNextRoleURI())) return true;
-
-    	// 3. If role is none, always return false
-    	if (!isSOAP11 && role.equals(SOAP12Constants.SOAP_ROLE_NONE)) {
-    		return false;
-    	}
-
-    	// 4. Return t/f depending on match
-    	List roles = (rolePlayer == null) ? null : rolePlayer.getRoles();
-    	if (roles != null) {
-    		for (int i=0;i<roles.size();i++) {
-    			String thisRole = (String) roles.get(i);
-    			if (thisRole.equals(role)) return true;
-    		}
-    	}
+    protected boolean isInRole(SOAPHeaderBlock soapHeaderBlock,
+                               RolePlayer rolePlayer,
+                               boolean isSOAP11) {
+        String role = soapHeaderBlock.getRole();
+
+        // 1. If role is ultimatedest, go by what the rolePlayer says
+        if (role == null || role.equals("") ||
+            (!isSOAP11 &&
+             role.equals(SOAP12Constants.SOAP_ROLE_ULTIMATE_RECEIVER))) {
+            return (rolePlayer == null || rolePlayer.isUltimateDestination());
+        }
+
+        // 2. If role is next, always return true
+        if (role.equals(soapHeaderBlock.getVersion().getNextRoleURI())) return true;
+
+        // 3. If role is none, always return false
+        if (!isSOAP11 && role.equals(SOAP12Constants.SOAP_ROLE_NONE)) {
+            return false;
+        }
+
+        // 4. Return t/f depending on match
+        List roles = (rolePlayer == null) ? null : rolePlayer.getRoles();
+        if (roles != null) {
+            for (int i = 0; i < roles.size(); i++) {
+                String thisRole = (String) roles.get(i);
+                if (thisRole.equals(role)) return true;
+            }
+        }
 
-    	return false;
+        return false;
     }
-    
+
     protected abstract void checkForMandatoryHeaders(boolean[] alreadyFoundAddrHeader,
-    		MessageContext messageContext)
-    throws AxisFault;
+                                                     MessageContext messageContext)
+            throws AxisFault;
 
     protected abstract void setDefaults(boolean[] alreadyFoundAddrHeader,
-    		MessageContext messageContext) throws AxisFault;
+                                        MessageContext messageContext) throws AxisFault;
 
 
     private void checkDuplicateHeaders(String addressingHeaderName, int headerFlag,
-    		boolean[] checkedHeaderNames, boolean[] ignoreHeaders,
-    		ArrayList duplicateHeaderNames) {//throws AxisFault {
-    	// If the header name has been seen before then we should return true and add it to
the list
-    	// of duplicate header names. Otherwise it is the first time we've seen the header so
add it
-    	// to the checked liat and return false. 
-    	ignoreHeaders[headerFlag] = checkedHeaderNames[headerFlag];
-    	if (ignoreHeaders[headerFlag]) {
-    		duplicateHeaderNames.add(addressingHeaderName);
-    	} else {
-    		checkedHeaderNames[headerFlag] = true;
-    	}
-
-    	if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
-    		log.trace("checkDuplicateHeaders: addressingHeaderName=" + addressingHeaderName
-    				+ " isDuplicate=" + ignoreHeaders[headerFlag]);
-    	}
+                                       boolean[] checkedHeaderNames, boolean[] ignoreHeaders,
+                                       ArrayList duplicateHeaderNames) {//throws AxisFault
{
+        // If the header name has been seen before then we should return true and add it
to the list
+        // of duplicate header names. Otherwise it is the first time we've seen the header
so add it
+        // to the checked liat and return false.
+        ignoreHeaders[headerFlag] = checkedHeaderNames[headerFlag];
+        if (ignoreHeaders[headerFlag]) {
+            duplicateHeaderNames.add(addressingHeaderName);
+        } else {
+            checkedHeaderNames[headerFlag] = true;
+        }
+
+        if (LoggingControl.debugLoggingAllowed && log.isTraceEnabled()) {
+            log.trace("checkDuplicateHeaders: addressingHeaderName=" + addressingHeaderName
+                      + " isDuplicate=" + ignoreHeaders[headerFlag]);
+        }
     }
 
     protected abstract void extractToEprReferenceParameters(EndpointReference toEPR,
@@ -317,7 +336,7 @@
 
         if (log.isTraceEnabled()) {
             log.trace("extractRelatesToInformation: Extracted Relationship. Value=" + address
+
-                    " RelationshipType=" + relationshipTypeString);
+                      " RelationshipType=" + relationshipTypeString);
         }
 
         RelatesTo relatesTo = new RelatesTo(address, relationshipTypeString);
@@ -395,15 +414,15 @@
         if (addressAttributes != null && addressAttributes.hasNext()) {
             ArrayList attributes = new ArrayList();
             while (addressAttributes.hasNext()) {
-                OMAttribute attr = (OMAttribute)addressAttributes.next();
+                OMAttribute attr = (OMAttribute) addressAttributes.next();
                 attributes.add(attr);
             }
             epr.setAddressAttributes(attributes);
         }
 
         // check for reference parameters
-        if(!disableRefparamExtract){
-        	extractToEprReferenceParameters(epr, header, namespace);
+        if (!disableRefparamExtract) {
+            extractToEprReferenceParameters(epr, header, namespace);
         }
         soapHeaderBlock.setProcessed();
 
@@ -424,7 +443,7 @@
 
         if (log.isTraceEnabled()) {
             log.trace("extractActionInformation: soapAction='" + soapAction + "' wsa:Action='"
+
-                    wsaAction + "'");
+                      wsaAction + "'");
         }
 
         // Need to validate that the content of the wsa:Action header is not null or whitespace
@@ -469,10 +488,10 @@
     /**
      * Given the soap header block, this should extract the information within EPR.
      *
-     * @param headerBlock a SOAP header which is of type EndpointReference
-     * @param epr the EndpointReference to fill in with the extracted data
+     * @param headerBlock         a SOAP header which is of type EndpointReference
+     * @param epr                 the EndpointReference to fill in with the extracted data
      * @param addressingNamespace the WSA namespace URI
-     * @param messageContext the active MessageContext
+     * @param messageContext      the active MessageContext
      * @throws AxisFault if there is a problem
      */
     private void extractEPRInformation(SOAPHeaderBlock headerBlock, EndpointReference epr,
@@ -496,7 +515,7 @@
         if (actionAttributes != null && actionAttributes.hasNext()) {
             ArrayList attributes = new ArrayList();
             while (actionAttributes.hasNext()) {
-                OMAttribute attr = (OMAttribute)actionAttributes.next();
+                OMAttribute attr = (OMAttribute) actionAttributes.next();
                 attributes.add(attr);
             }
             return attributes;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java?rev=594273&r1=594272&r2=594273&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/WSDLDataLocator.java
Mon Nov 12 11:52:19 2007
@@ -23,7 +23,6 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisService2WSDL11;
-import org.apache.axis2.AxisFault;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java?rev=594273&r1=594272&r2=594273&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/dataretrieval/client/MexClient.java
Mon Nov 12 11:52:19 2007
@@ -69,22 +69,19 @@
 
         OMFactory fac = OMAbstractFactory.getOMFactory();
 
-        OMNamespace omNs = fac.createOMNamespace(
-                DRConstants.SPEC.NS_URI, DRConstants.SPEC.NS_PREFIX);
+        OMNamespace omNs = fac.createOMNamespace(DRConstants.SPEC.NS_URI,
+                                                 DRConstants.SPEC.NS_PREFIX);
 
-        OMElement method = fac.createOMElement(DRConstants.SPEC.GET_METADATA,
-                                               omNs);
+        OMElement method = fac.createOMElement(DRConstants.SPEC.GET_METADATA, omNs);
         if (dialect != null) {
-            OMElement dialect_Elem = fac.createOMElement(
-                    DRConstants.SPEC.DIALET, omNs);
+            OMElement dialectElem = fac.createOMElement(DRConstants.SPEC.DIALET, omNs);
 
-            dialect_Elem.setText(dialect);
-            method.addChild(dialect_Elem);
+            dialectElem.setText(dialect);
+            method.addChild(dialectElem);
         }
         // create Identifier element
         if (identifier != null) {
-            OMElement id_Elem = fac.createOMElement(
-                    DRConstants.SPEC.IDENTIFIER, omNs);
+            OMElement id_Elem = fac.createOMElement(DRConstants.SPEC.IDENTIFIER, omNs);
             id_Elem.setText(identifier);
             method.addChild(id_Elem);
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java?rev=594273&r1=594272&r2=594273&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
Mon Nov 12 11:52:19 2007
@@ -30,7 +30,11 @@
 
 import java.io.File;
 import java.io.UnsupportedEncodingException;
-import java.net.*;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashMap;
@@ -51,7 +55,8 @@
      * then creates a WSInfoList to store information about available modules and services.
      *
      * @param deploymentEngine reference to engine registry for updates
-     * @param isClasspath true if this RepositoryListener should scan the classpath for Modules
+     * @param isClasspath      true if this RepositoryListener should scan the classpath
for
+     *                         Modules
      */
     public RepositoryListener(DeploymentEngine deploymentEngine, boolean isClasspath) {
         this.deploymentEngine = deploymentEngine;
@@ -79,11 +84,13 @@
                 }
                 if (!file.isDirectory()) {
                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
-                        addFileToDeploy(file, deploymentEngine.getModuleDeployer() , WSInfo.TYPE_MODULE);
+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer(),
+                                        WSInfo.TYPE_MODULE);
                     }
                 } else {
                     if (!"lib".equalsIgnoreCase(file.getName())) {
-                        addFileToDeploy(file, deploymentEngine.getModuleDeployer() ,WSInfo.TYPE_MODULE);
+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer(),
+                                        WSInfo.TYPE_MODULE);
                     }
                 }
             }
@@ -115,15 +122,16 @@
                     URL url = (URL)moduleURLs.nextElement();
                     String fileName = url.toString();
                     if (fileName.startsWith("jar")) {
-                        url = ((java.net.JarURLConnection) url.openConnection()).getJarFileURL();
+                        url = ((java.net.JarURLConnection)url.openConnection()).getJarFileURL();
                         fileName = url.toString();
-                         File f = new File(new URI(fileName));
-                        addFileToDeploy(f, deployer ,WSInfo.TYPE_MODULE);
                     } else if (fileName.startsWith("file")) {
-                        fileName = fileName.substring(0, fileName.lastIndexOf("/META-INF/module.xml"));
-                        File f = new File(new URI(fileName));
-                        addFileToDeploy(f, deployer ,WSInfo.TYPE_MODULE);
-                    } 
+                        fileName =
+                                fileName.substring(0, fileName.lastIndexOf("/META-INF/module.xml"));
+                    } else continue;
+
+                    log.debug("Deploying module from classpath at '" + fileName + "'");
+                    File f = new File(new URI(fileName));
+                    addFileToDeploy(f, deployer, WSInfo.TYPE_MODULE);
 
                 } catch (URISyntaxException e) {
                     log.info(e);
@@ -161,7 +169,7 @@
         ClassLoader cl = deploymentEngine.getAxisConfig().getModuleClassLoader();
         while (cl != null) {
             if (cl instanceof URLClassLoader) {
-                URL[] urls = ((URLClassLoader) cl).getURLs();
+                URL[] urls = ((URLClassLoader)cl).getURLs();
                 for (int i = 0; (urls != null) && i < urls.length; i++) {
                     String path = urls[i].getPath();
                     //If it is a drive letter, adjust accordingly.
@@ -177,7 +185,7 @@
                     if (file.isFile()) {
                         if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
                             //adding modules in the class path
-                            addFileToDeploy(file, deployer,WSInfo.TYPE_MODULE);
+                            addFileToDeploy(file, deployer, WSInfo.TYPE_MODULE);
                         }
                     }
                 }
@@ -199,7 +207,7 @@
             java.net.URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
             String location = url.toString();
             if (location.startsWith("jar")) {
-                url = ((java.net.JarURLConnection) url.openConnection()).getJarFileURL();
+                url = ((java.net.JarURLConnection)url.openConnection()).getJarFileURL();
                 location = url.toString();
             }
             if (location.startsWith("file")) {
@@ -237,10 +245,10 @@
         if (directoryToExtensionMappingMap.size() > 0) {
             Iterator keys = directoryToExtensionMappingMap.keySet().iterator();
             while (keys.hasNext()) {
-                String s = (String) keys.next();
-                ArrayList list = (ArrayList) directoryToExtensionMappingMap.get(s);
+                String s = (String)keys.next();
+                ArrayList list = (ArrayList)directoryToExtensionMappingMap.get(s);
                 for (int i = 0; i < list.size(); i++) {
-                    String extension = (String) list.get(i);
+                    String extension = (String)list.get(i);
                     findFileForGivenDirectory(s, extension);
                 }
 
@@ -259,8 +267,8 @@
                         if (isSourceControlDir(file)) {
                             continue;
                         }
-                        if (!file.isDirectory() && extension.equals(
-                                DeploymentFileData.getFileExtension(file.getName()))) {
+                        if (!file.isDirectory() && extension
+                                .equals(DeploymentFileData.getFileExtension(file.getName())))
{
                             addFileToDeploy(file,
                                             deploymentEngine.getDeployerForExtension(extension),
                                             WSInfo.TYPE_CUSTOM);
@@ -323,7 +331,7 @@
         update();
     }
 
-    public void addFileToDeploy(File file, Deployer deployer , int type) {
-        wsInfoList.addWSInfoItem(file, deployer ,type);
+    public void addFileToDeploy(File file, Deployer deployer, int type) {
+        wsInfoList.addWSInfoItem(file, deployer, type);
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java?rev=594273&r1=594272&r2=594273&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
Mon Nov 12 11:52:19 2007
@@ -64,7 +64,7 @@
      * @param file actual jar files for either Module or service
      */
     public synchronized void addWSInfoItem(File file, Deployer deployer , int type) {
-        WSInfo info = (WSInfo) currentJars.get(file.getName());
+        WSInfo info = (WSInfo) currentJars.get(file.getAbsolutePath());
         if (info != null) {
             if (deploymentEngine.isHotUpdate() && isModified(file, info)) {
 //            info.setLastModifiedDate(file.lastModified());
@@ -74,8 +74,8 @@
                 deploymentEngine.addWSToDeploy(deploymentFileData);    // add entry to deploylist
             }
         } else {
-            info = getFileItem(file,deployer,type);
-            setLastModifiedDate(file,info);
+            info = getFileItem(file, deployer, type);
+            setLastModifiedDate(file, info);
         }
 
         jarList.add(info.getFileName());

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=594273&r1=594272&r2=594273&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
Mon Nov 12 11:52:19 2007
@@ -79,7 +79,6 @@
 import java.io.*;
 import java.net.SocketException;
 import java.net.URL;
-import java.net.URISyntaxException;
 import java.security.PrivilegedAction;
 import java.util.*;
 
@@ -1966,20 +1965,20 @@
 
         //populate the axis service with the necessary schema references
         ArrayList schema = this.schemaList;
-        Map changedScheamLocations = null;
+        Map changedSchemaLocations = null;
         if (!this.schemaLocationsAdjusted) {
             Hashtable nameTable = new Hashtable();
             Hashtable sourceURIToNewLocationMap = new Hashtable();
             //calculate unique names for the schemas
-            calcualteSchemaNames(schema, nameTable, sourceURIToNewLocationMap);
+            calculateSchemaNames(schema, nameTable, sourceURIToNewLocationMap);
             //adjust the schema locations as per the calculated names
-            changedScheamLocations = adjustSchemaNames(schema, nameTable,sourceURIToNewLocationMap);
+            changedSchemaLocations = adjustSchemaNames(schema, nameTable,sourceURIToNewLocationMap);
             //reverse the nametable so that there is a mapping from the
             //name to the schemaObject
             setSchemaMappingTable(swapMappingTable(nameTable));
             setSchemaLocationsAdjusted(true);
         }
-        return changedScheamLocations;
+        return changedSchemaLocations;
     }
 
 
@@ -1988,7 +1987,7 @@
      *
      * @param schemas
      */
-    private void calcualteSchemaNames(List schemas, Hashtable nameTable, Hashtable sourceURIToNewLocationMap)
{
+    private void calculateSchemaNames(List schemas, Hashtable nameTable, Hashtable sourceURIToNewLocationMap)
{
         //first traversal - fill the hashtable
         for (int i = 0; i < schemas.size(); i++) {
             XmlSchema schema = (XmlSchema) schemas.get(i);
@@ -2005,7 +2004,7 @@
                         //insert the name into the table
                         insertIntoNameTable(nameTable, s, sourceURIToNewLocationMap);
                         //recursively call the same procedure
-                        calcualteSchemaNames(Arrays.asList(new XmlSchema[]{s}), nameTable,
sourceURIToNewLocationMap);
+                        calculateSchemaNames(Arrays.asList(new XmlSchema[]{s}), nameTable,
sourceURIToNewLocationMap);
                     }
                 }
             }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java?rev=594273&r1=594272&r2=594273&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/java2wsdl/DefaultSchemaGenerator.java
Mon Nov 12 11:52:19 2007
@@ -387,9 +387,8 @@
     }
 
     /**
-     * JAM convert first name of an attribute into UpperCase as an example if there is a
instance
-     * variable called foo in a bean , then Jam give that as Foo so this method is to correct
that
-     * error
+     * JAM converts the first letter of a field into uppercase, so field "foo" would end
up
+     * called "Foo".  This method corrects that problem.
      *
      * @param wrongName
      * @return the right name, using english as the locale for case conversion
@@ -690,12 +689,8 @@
         if ("javax.activation.DataHandler".equals(classType)) {
             return true;
         } else {
-            JClass supuerClass = clazz.getSuperclass();
-            if (supuerClass != null) {
-                return isDataHandler(supuerClass);
-            } else {
-                return false;
-            }
+            JClass superClass = clazz.getSuperclass();
+            return superClass != null && isDataHandler(superClass);
         }
     }
 
@@ -779,7 +774,7 @@
         XmlSchema xmlSchema;
 
         if ((xmlSchema = (XmlSchema) schemaMap.get(targetNamespace)) == null) {
-            String targetNamespacePrefix = null;
+            String targetNamespacePrefix;
 
             if (targetNamespace.equals(schemaTargetNameSpace) &&
                     schema_namespace_prefix != null) {



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message