ws-wsrf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r325926 - in /webservices/wsrf/trunk/src: examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/ examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/ java/org/apache/ws/resource/ java/org/ap...
Date Mon, 17 Oct 2005 16:50:33 GMT
Author: ips
Date: Mon Oct 17 09:50:16 2005
New Revision: 325926

URL: http://svn.apache.org/viewcvs?rev=325926&view=rev
Log:
improved some error handling code; renamed abstract getNamespaceVersionHolder method in AbstractResourceHome
to getNamespaceSet for consistency with Resource interface

Modified:
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java
    webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java
    webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/i18n/Keys.java
    webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
    webservices/wsrf/trunk/src/templates/Home.vm
    webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/AbstractFilesystemService.java
Mon Oct 17 09:50:16 2005
@@ -1,11 +1,11 @@
 
 package org.apache.ws.resource.example.filesystem;
 
-import org.apache.ws.resource.ResourceContext;
-import org.apache.ws.resource.handler.SoapMethodNameMap;
-import org.apache.ws.resource.handler.WsrfService;
 import org.apache.ws.resource.AbstractPortType;
+import org.apache.ws.resource.ResourceContext;
 import org.apache.ws.resource.handler.ServiceSoapMethodNameMap;
+import org.apache.ws.resource.handler.SoapMethodNameMap;
+
 import javax.xml.namespace.QName;
 
 /**
@@ -50,7 +50,6 @@
       {
          init(  );
       }
-
       return m_methodNameMap.getMethodName( requestQname );
    }
 

Modified: webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
(original)
+++ webservices/wsrf/trunk/src/examples/filesystem/src/java/org/apache/ws/resource/example/filesystem/FilesystemHome.java
Mon Oct 17 09:50:16 2005
@@ -16,27 +16,27 @@
     /**
      * The service endpoint name as registered with the SOAP Platform.  This is useful for
building EPR's. *
      */
-    public static final QName SERVICE_NAME = javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/example/filesystem}filesystem"
);
+    private static final QName SERVICE_NAME = javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/example/filesystem}filesystem"
);
 
     /**
      * The management PortType associated with this resource. This is useful for building
EPR's.*
      */
-    public static final QName PORT_TYPE = javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/example/filesystem}FileSystemPortType"
);
+    private static final QName PORT_TYPE = javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/example/filesystem}FileSystemPortType"
);
 
     /**
      * The WSDL Port name associated with the resource. This is useful for building EPR's.
*
      */
-    public static final String PORT_NAME = "filesystem";
+    private static final String PORT_NAME = "filesystem";
 
     /**
      * The name of the resource key for this resource. *
      */
-    public static final QName RESOURCE_KEY_NAME = javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/example/filesystem}ResourceIdentifier"
);
+    private static final QName RESOURCE_KEY_NAME = javax.xml.namespace.QName.valueOf( "{http://ws.apache.org/resource/example/filesystem}ResourceIdentifier"
);
 
     /**
      * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
      */
-    public static final org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl
SPEC_NAMESPACE_SET = new org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl();
+    private static final org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl
SPEC_NAMESPACE_SET = new org.apache.ws.resource.properties.v2004_06.impl.NamespaceVersionHolderImpl();
 
     private static final String LVOL1_ID = "/dev/vg00/lvol1";
     private static final String LVOL2_ID = "/dev/vg00/lvol2";
@@ -73,7 +73,7 @@
         return RESOURCE_KEY_NAME;
     }
 
-    public org.apache.ws.resource.NamespaceVersionHolder getNamespaceVersionHolder()
+    public org.apache.ws.resource.NamespaceVersionHolder getNamespaceSet()
     {
         return SPEC_NAMESPACE_SET;
     }

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java
(original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/JobPortHome.java
Mon Oct 17 09:50:16 2005
@@ -17,7 +17,6 @@
 
 import org.apache.ws.addressing.EndpointReference;
 import org.apache.ws.resource.IllegalResourceTypeException;
-import org.apache.ws.resource.JndiConstants;
 import org.apache.ws.resource.impl.AbstractResourceHome;
 import org.apache.ws.resource.NamespaceVersionHolder;
 import org.oasisOpen.docs.wsrf.x2005.x01.wsrfInterop20Draft03.MimeMediaTypeType;
@@ -120,7 +119,7 @@
         return SERVICE_NAME;
     }
 
-    public NamespaceVersionHolder getNamespaceVersionHolder()
+    public NamespaceVersionHolder getNamespaceSet()
     {
         return SPEC_NAMESPACE_SET;
     }

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java
(original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterFactoryHome.java
Mon Oct 17 09:50:16 2005
@@ -17,7 +17,6 @@
 
 import org.apache.ws.resource.impl.AbstractResourceHome;
 import org.apache.ws.resource.NamespaceVersionHolder;
-import org.apache.ws.resource.NamespaceVersionHolder;
 
 import javax.xml.namespace.QName;
 import java.io.Serializable;
@@ -65,7 +64,7 @@
         return "PrinterFactory";
     }
 
-    public NamespaceVersionHolder getNamespaceVersionHolder()
+    public NamespaceVersionHolder getNamespaceSet()
     {
         return SPEC_NAMESPACE_SET;
     }

Modified: webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java
(original)
+++ webservices/wsrf/trunk/src/examples/interop/src/java/org/oasisOpen/docs/wsrf/x2005/x01/wsrfInterop20Draft03Wsdl/PrinterPortHome.java
Mon Oct 17 09:50:16 2005
@@ -23,7 +23,6 @@
 import org.apache.ws.resource.ResourceUnknownException;
 import org.apache.ws.resource.NamespaceVersionHolder;
 import org.apache.ws.resource.impl.AbstractResourceHome;
-import org.apache.ws.resource.NamespaceVersionHolder;
 
 import javax.xml.namespace.QName;
 import java.io.Serializable;
@@ -91,7 +90,7 @@
         return "PrinterPort";
     }
 
-    public NamespaceVersionHolder getNamespaceVersionHolder()
+    public NamespaceVersionHolder getNamespaceSet()
     {
         return SPEC_NAMESPACE_SET;
     }

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/AbstractPortType.java Mon Oct 17
09:50:16 2005
@@ -17,9 +17,8 @@
 
 import org.apache.ws.Soap1_1Constants;
 import org.apache.ws.resource.faults.FaultException;
-import org.apache.ws.resource.i18n.MessagesImpl;
+import org.apache.ws.resource.impl.AbstractResourceHome;
 import org.apache.ws.resource.properties.faults.ResourceUnknownFaultException;
-import org.apache.ws.util.i18n.Messages;
 
 /**
  * A base class that can be extended by portType implementations.
@@ -28,8 +27,7 @@
  */
 public abstract class AbstractPortType
 {
-   /** DOCUMENT_ME */
-   public static final Messages MSG               = MessagesImpl.getInstance(  );
+
    private ResourceContext      m_resourceContext;
    private Resource             m_resource;
 
@@ -47,7 +45,7 @@
       }
       catch ( ResourceUnknownException rue )
       {
-         throw new ResourceUnknownFaultException( m_resource.getNamespaceSet(), rue );
+         throw new ResourceUnknownFaultException( ((AbstractResourceHome)m_resourceContext.getResourceHome()).getNamespaceSet(),
rue );
       }
       catch ( ResourceException re )
       {

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/handler/ResourceHandler.java Mon
Oct 17 09:50:16 2005
@@ -554,12 +554,7 @@
       }
       else
       {
-         if ( LOG.isDebugEnabled(  ) )
-         {
-            LOG.debug( MSG.getMessage( Keys.INTERNAL_SERVER_ERROR ) );
-            e.printStackTrace(  );
-         }
-
+         LOG.error( MSG.getMessage( Keys.UNEXPECTED_ERROR ), e );
          throw new FaultException( Soap1_1Constants.FAULT_SERVER,
                                    MSG.getMessage( Keys.INTERNAL_SERVER_ERROR ) );
       }
@@ -677,9 +672,13 @@
       }
       catch ( InvocationTargetException ite )
       {
-         throw (Exception) ite.getCause(  );
+          Throwable cause = ite.getCause();
+          if ( cause instanceof Exception )
+          {
+              throw (Exception)cause;
+          }
+          throw ite;
       }
-
       return service;
    }
 

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/i18n/Keys.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/i18n/Keys.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/i18n/Keys.java (original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/i18n/Keys.java Mon Oct 17 09:50:16
2005
@@ -172,6 +172,11 @@
     */
    String INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR";
 
+    /**
+     * @msg An unexpected error occured during processing of a request.
+     */
+    String UNEXPECTED_ERROR = "UNEXPECTED_ERROR";
+
    /**
     * @msg Handling response...
     */

Modified: webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
(original)
+++ webservices/wsrf/trunk/src/java/org/apache/ws/resource/impl/AbstractResourceHome.java
Mon Oct 17 09:50:16 2005
@@ -189,7 +189,7 @@
      *
      * @return DOCUMENT_ME
      */
-    public abstract org.apache.ws.resource.NamespaceVersionHolder getNamespaceVersionHolder();
+    public abstract org.apache.ws.resource.NamespaceVersionHolder getNamespaceSet();
 
     /**
      * Returns the EndpointReference associated with this Resource. Only the required fields
will be filled in (i.e.
@@ -206,7 +206,7 @@
         String endpointAddress =
                 JaxRpcPlatform.getJaxRpcPlatform().getEndpointUrl( getBaseWebappUrl(),
                         getServiceName().getLocalPart() );
-        String wsAddressingURI = getNamespaceVersionHolder().getAddressingNamespace();
+        String wsAddressingURI = getNamespaceSet().getAddressingNamespace();
 
         XmlBeansEndpointReference xBeansEPR =
                 new XmlBeansEndpointReference( endpointAddress, wsAddressingURI );
@@ -972,13 +972,10 @@
         {
             if ( !m_resourceIsPersistent )
             {
-                throw new ResourceUnknownException( resourceId,
-                        getServicePortName() );
+                throw new ResourceUnknownException( resourceId, getServicePortName() );
             }
-
             add( createNewInstanceAndLoad( resourceId ) );
         }
-
         return resource;
     }
 

Modified: webservices/wsrf/trunk/src/templates/Home.vm
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/templates/Home.vm?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/templates/Home.vm (original)
+++ webservices/wsrf/trunk/src/templates/Home.vm Mon Oct 17 09:50:16 2005
@@ -33,21 +33,21 @@
         implements Serializable
 {
 
-    /**  The service endpoint name as registered with the SOAP Platform.  This is useful
for building EPR's. **/
-    public static final QName SERVICE_NAME = javax.xml.namespace.QName.valueOf("${endpointServiceName}");
+    /*  The service endpoint name as registered with the SOAP Platform.  This is useful for
building EPR's. */
+    private static final QName SERVICE_NAME = QName.valueOf("${endpointServiceName}");
        
-    /** The management PortType associated with this resource. This is useful for building
EPR's.**/ 
-    public static final QName PORT_TYPE = javax.xml.namespace.QName.valueOf("${portTypeName}");
   
+    /* The management PortType associated with this resource. This is useful for building
EPR's. */
+    private static final QName PORT_TYPE = QName.valueOf("${portTypeName}");
         
-    /** The WSDL Port name associated with the resource. This is useful for building EPR's.
**/
-    public static final String PORT_NAME = "${portName}";
+    /* The WSDL Port name associated with the resource. This is useful for building EPR's.
*/
+    private static final String PORT_NAME = "${portName}";
         
-    /** The name of the resource key for this resource. **/
-    public static final QName RESOURCE_KEY_NAME = javax.xml.namespace.QName.valueOf("{${resourcekey.NamespaceURI}}${resourcekey.LocalPart}");
+    /* The name of the resource key for this resource. */
+    private static final QName RESOURCE_KEY_NAME = QName.valueOf("{${resourcekey.NamespaceURI}}${resourcekey.LocalPart}");
     
     #if($namespaceVersionHolder)    
-    /**
-     * A NamespaceVerionHolder which maintains the QNames of Spec Wsdls
+    /*
+     * A NamespaceVerionHolder which maintains the namespace URI of specification XSDs.
      */
      $namespaceVersionHolder
     #end
@@ -88,7 +88,7 @@
         return RESOURCE_KEY_NAME;
     }
     
-    public NamespaceVersionHolder getNamespaceVersionHolder()
+    public NamespaceVersionHolder getNamespaceSet()
     {
         return SPEC_NAMESPACE_SET; 
     }

Modified: webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java
URL: http://svn.apache.org/viewcvs/webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java?rev=325926&r1=325925&r2=325926&view=diff
==============================================================================
--- webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java (original)
+++ webservices/wsrf/trunk/src/test/org/apache/ws/resource/properties/SushiHome.java Mon Oct
17 09:50:16 2005
@@ -180,7 +180,7 @@
     *
     * @return DOCUMENT_ME
     */
-   public org.apache.ws.resource.NamespaceVersionHolder getNamespaceVersionHolder(  )
+   public org.apache.ws.resource.NamespaceVersionHolder getNamespaceSet(  )
    {
       return SPEC_NAMESPACE_SET;
    }



Mime
View raw message