abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r547103 - in /incubator/abdera/java/trunk: examples/src/main/java/org/apache/abdera/examples/appserver/ server/src/main/java/org/apache/abdera/protocol/server/provider/ server/src/main/java/org/apache/abdera/protocol/server/servlet/ server/...
Date Thu, 14 Jun 2007 03:41:32 GMT
Author: jmsnell
Date: Wed Jun 13 20:41:32 2007
New Revision: 547103

URL: http://svn.apache.org/viewvc?view=rev&rev=547103
Log:
Pass RequestContext in to ProviderManager so Provider selection can be conditional based on
the request.
Patch provided by Brian Moseley. thanks!

Modified:
    incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProviderManager.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractProviderManager.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/ProviderManager.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbstractRequestHandler.java
    incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractSingletonProviderManager.java

Modified: incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProviderManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProviderManager.java?view=diff&rev=547103&r1=547102&r2=547103
==============================================================================
--- incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProviderManager.java
(original)
+++ incubator/abdera/java/trunk/examples/src/main/java/org/apache/abdera/examples/appserver/SimpleProviderManager.java
Wed Jun 13 20:41:32 2007
@@ -19,13 +19,14 @@
 
 import org.apache.abdera.protocol.server.provider.Provider;
 import org.apache.abdera.protocol.server.provider.ProviderManager;
+import org.apache.abdera.protocol.server.provider.RequestContext;
 
 public class SimpleProviderManager 
   implements ProviderManager {
 
   private static Provider provider = null; 
 
-  public synchronized Provider getProvider() {
+  public synchronized Provider getProvider(RequestContext request) {
     if (provider == null)
       provider = new SimpleProvider();
     return provider;

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractProviderManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractProviderManager.java?view=diff&rev=547103&r1=547102&r2=547103
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractProviderManager.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/AbstractProviderManager.java
Wed Jun 13 20:41:32 2007
@@ -23,8 +23,7 @@
   extends PoolManager<Provider>
   implements ProviderManager {
 
-  public Provider getProvider() {
-    return getInstance();
+  public Provider getProvider(RequestContext request) {
+      return getInstance();
   }
-
 }

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/ProviderManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/ProviderManager.java?view=diff&rev=547103&r1=547102&r2=547103
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/ProviderManager.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/provider/ProviderManager.java
Wed Jun 13 20:41:32 2007
@@ -19,7 +19,7 @@
 
 public interface ProviderManager {
 
-  Provider getProvider();
+  Provider getProvider(RequestContext request);
   
   void release(Provider provider);
   

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbstractRequestHandler.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbstractRequestHandler.java?view=diff&rev=547103&r1=547102&r2=547103
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbstractRequestHandler.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/servlet/AbstractRequestHandler.java
Wed Jun 13 20:41:32 2007
@@ -51,8 +51,8 @@
       throws IOException {
     
     ProviderManager manager = context.getProviderManager();
-    Provider provider = manager.getProvider();
     RequestContext requestContext = getRequestContext(context,request);
+    Provider provider = manager.getProvider(requestContext);
     
     try {
       if (preconditions(provider, requestContext, response)) {

Modified: incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractSingletonProviderManager.java
URL: http://svn.apache.org/viewvc/incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractSingletonProviderManager.java?view=diff&rev=547103&r1=547102&r2=547103
==============================================================================
--- incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractSingletonProviderManager.java
(original)
+++ incubator/abdera/java/trunk/server/src/main/java/org/apache/abdera/protocol/server/util/AbstractSingletonProviderManager.java
Wed Jun 13 20:41:32 2007
@@ -19,13 +19,14 @@
 
 import org.apache.abdera.protocol.server.provider.Provider;
 import org.apache.abdera.protocol.server.provider.ProviderManager;
+import org.apache.abdera.protocol.server.provider.RequestContext;
 
 public abstract class AbstractSingletonProviderManager 
   implements ProviderManager {
 
   protected Provider provider;
   
-  public Provider getProvider() {
+  public Provider getProvider(RequestContext request) {
     if (provider == null) {
       synchronized(this) {
         provider = initProvider();



Mime
View raw message