cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gma...@apache.org
Subject svn commit: r1078208 - in /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs: AbstractJAXRSFactoryBean.java JAXRSInvoker.java JAXRSServerFactoryBean.java
Date Fri, 04 Mar 2011 23:15:25 GMT
Author: gmazza
Date: Fri Mar  4 23:15:25 2011
New Revision: 1078208

URL: http://svn.apache.org/viewvc?rev=1078208&view=rev
Log:
Moved default JAXRSInvoker creation from JAXRSServerFactoryBean to JAXRSServiceFactoryBean;
Javadoc updates

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java?rev=1078208&r1=1078207&r2=1078208&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/AbstractJAXRSFactoryBean.java
Fri Mar  4 23:15:25 2011
@@ -60,15 +60,8 @@ import org.apache.cxf.transport.Destinat
 
 
 /**
- * Bean to help easily create Server endpoints for JAX-RS. Example:
- * <pre>
- * JAXRSServerFactoryBean sf = JAXRSServerFactoryBean();
- * sf.setResourceClasses(Book.class);
- * sf.setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
- * sf.setAddress("http://localhost:9080/");
- * sf.create();
- * </pre>
- * This will start a server for you and register it with the ServerManager.
+ * Abstract bean holding functionality common for creating 
+ * JAX-RS Server and Client objects.
  */
 public class AbstractJAXRSFactoryBean extends AbstractEndpointFactory {
     

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java?rev=1078208&r1=1078207&r2=1078208&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSInvoker.java Fri Mar
 4 23:15:25 2011
@@ -56,7 +56,7 @@ import org.apache.cxf.message.MessageCon
 import org.apache.cxf.service.invoker.AbstractInvoker;
 
 public class JAXRSInvoker extends AbstractInvoker {
-    private static final Logger LOG = LogUtils.getL7dLogger(JAXRSServiceFactoryBean.class);
+    private static final Logger LOG = LogUtils.getL7dLogger(JAXRSInvoker.class);
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(JAXRSInvoker.class);
     private static final String SERVICE_LOADER_AS_CONTEXT = "org.apache.cxf.serviceloader-context";
     private static final String SERVICE_OBJECT_SCOPE = "org.apache.cxf.service.scope";
@@ -211,10 +211,10 @@ public class JAXRSInvoker extends Abstra
 
                 exchange.put(OperationResourceInfo.class, subOri);
                 msg.put(URITemplate.TEMPLATE_PARAMETERS, values);
-                // work out request parameters for the sub-resouce class. Here we
-                // presume Inputstream has not been consumed yet by the root resource class.
-                //I.e., only one place either in the root resource or sub-resouce class can
-                //have a parameter that read from entitybody.
+                // work out request parameters for the sub-resource class. Here we
+                // presume InputStream has not been consumed yet by the root resource class.
+                //I.e., only one place either in the root resource or sub-resource class
can
+                //have a parameter that read from entity body.
                 List<Object> newParams = JAXRSUtils.processParameters(subOri, values,
msg);
                 msg.setContent(List.class, newParams);
 

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java?rev=1078208&r1=1078207&r2=1078208&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
Fri Mar  4 23:15:25 2011
@@ -51,9 +51,15 @@ import org.apache.cxf.service.invoker.In
  * sf.setResourceClasses(Book.class);
  * sf.setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
  * sf.setAddress("http://localhost:9080/");
- * sf.create();
+ * Server myServer = sf.create();
  * </pre>
- * This will start a server for you and register it with the ServerManager.
+ * This will start a server for you and register it with the ServerManager.  Note 
+ * you should explicitly close the {@link org.apache.cxf.endpoint.Server} created
+ * when finished with it:
+ * <pre>
+ * myServer.close();
+ * myServer.destroy(); // closes first if close() not previously called
+ * </pre> 
  */
 public class JAXRSServerFactoryBean extends AbstractJAXRSFactoryBean {
     
@@ -160,8 +166,10 @@ public class JAXRSServerFactoryBean exte
         }
     }
 
+    // TODO: deprecate?  default invoker can be changed by subclassing
+    // JAXRSServiceFactoryBean
     protected Invoker createInvoker() {
-        return new JAXRSInvoker();
+        return serviceFactory.createInvoker();
     }
 
     /**
@@ -294,9 +302,9 @@ public class JAXRSServerFactoryBean exte
     }
 
     /**
-     * Can be used to postpone starting the Server instance during the create() call.
-     * @param start Server instance will not be started during the create() call if set to
false
-     *        default is true.  
+     * Determines whether Services are automatically started during the create() call.  Default
is true.
+     * If false will need to call start() method on Server to activate it.
+     * @param start Whether (true) or not (false) to start the Server during Server creation.
      */
     public void setStart(boolean start) {
         this.start = start;



Mime
View raw message