abdera-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmsn...@apache.org
Subject svn commit: r1189362 [2/2] - in /abdera/abdera2: ./ activities/src/main/java/org/apache/abdera2/activities/model/ activities/src/main/java/org/apache/abdera2/activities/protocol/ activities/src/main/java/org/apache/abdera2/activities/protocol/basic/ co...
Date Wed, 26 Oct 2011 18:26:58 GMT
Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/AbstractAbderaServlet.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/AbstractAbderaServlet.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/AbstractAbderaServlet.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/AbstractAbderaServlet.java Wed Oct 26 18:26:55 2011
@@ -43,10 +43,11 @@ public abstract class AbstractAbderaServ
   extends HttpServlet {
 
   private static final long serialVersionUID = 2722733242417632126L;
+  
+    private final static Log log = 
+      LogFactory.getLog(AbstractAbderaServlet.class);
 
-    private final static Log log = LogFactory.getLog(AbstractAbderaServlet.class);
-
-    protected ServiceManager<Provider> manager;
+    protected ServiceManager manager;
     protected Provider provider;
 
     @Override
@@ -58,12 +59,11 @@ public abstract class AbstractAbderaServ
         log.debug("Using provider - " + provider);
     }
 
-    protected ServiceManager<Provider> getServiceManager() {
+    protected ServiceManager getServiceManager() {
         return manager;
     }
 
-    @SuppressWarnings("unchecked")
-    protected ServiceManager<Provider> createServiceManager() {
+    protected ServiceManager createServiceManager() {
         String prop = this.getInitParameter(ServiceManager.class.getName());
         return prop != null ? 
           ServiceManager.Factory.getInstance(prop) :  
@@ -71,14 +71,18 @@ public abstract class AbstractAbderaServ
     }
 
     protected Provider createProvider() {
-        return manager.newProvider(getProperties(getServletConfig()));
+        return manager.newProvider(
+          getProperties(
+            getServletConfig()));
     }
 
     protected void process(
       HttpServletRequest request,
       HttpServletResponse response,
       ServletContext context) {
-      RequestContext reqcontext = new ServletRequestContext(provider, request, context);
+      RequestContext reqcontext = 
+        new ServletRequestContext(
+          provider, request, context);
       try {
           output(request, response, provider.apply(reqcontext));
       } catch (Throwable t) {
@@ -88,7 +92,10 @@ public abstract class AbstractAbderaServ
       log.debug("Request complete");
     }
     
-    protected void output(HttpServletRequest request, HttpServletResponse response, ResponseContext context)
+    protected void output(
+      HttpServletRequest request, 
+      HttpServletResponse response, 
+      ResponseContext context)
         throws IOException {
         if (context != null) {
             response.setStatus(context.getStatus());
@@ -102,8 +109,7 @@ public abstract class AbstractAbderaServ
                 MimeType ct = context.getContentType();
                 if (ct != null)
                     response.setContentType(ct.toString());
-            } catch (Exception e) {
-            }
+            } catch (Exception e) {}
             Iterable<String> names = context.getHeaderNames();
             for (String name : names) {
                 Iterable<Object> headers = context.getHeaders(name);
@@ -122,29 +128,28 @@ public abstract class AbstractAbderaServ
         }
     }
 
-    protected void error(String message, Throwable t, HttpServletResponse response) {
+    protected void error(
+      String message, 
+      Throwable t, 
+      HttpServletResponse response) {
       try {
-        if (t != null)
-            log.error(message, t);
-        else
-            log.error(message);
-
-        if (response.isCommitted()) {
-            log.error("Could not write an error message as the headers & HTTP status were already committed!");
-        } else {
-            ResponseContext resp = 
-              provider.createErrorResponse(500, message, t);
-            response.setStatus(500);
+        if (t != null) log.error(message, t);
+        else log.error(message);
+        if (response.isCommitted())
+          log.error("Could not write an error message as the headers & HTTP status were already committed!");
+        else {
             response.setCharacterEncoding("UTF-8");
-            resp.writeTo(response.getOutputStream());
+            response.setStatus(500);
+            provider.createErrorResponse(500, message, t)
+             .writeTo(response.getOutputStream());
         }
       } catch (IOException e) {
         log.error("Error writing to output stream",e);
       }
     }
 
-    protected Map<String, String> getProperties(ServletConfig config) {
-        Map<String, String> properties = new HashMap<String, String>();
+    protected Map<String, Object> getProperties(ServletConfig config) {
+        Map<String, Object> properties = new HashMap<String, Object>();
         Enumeration<String> e = config.getInitParameterNames();
         while (e.hasMoreElements()) {
             String key = e.nextElement();

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/ServletRequestContext.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/ServletRequestContext.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/ServletRequestContext.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/ServletRequestContext.java Wed Oct 26 18:26:55 2011
@@ -20,11 +20,11 @@ package org.apache.abdera2.common.protoc
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.Reader;
-import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Enumeration;
-import java.util.List;
+import java.util.Iterator;
 import java.util.Locale;
 
 import javax.servlet.ServletContext;
@@ -38,6 +38,8 @@ import org.apache.abdera2.common.protoco
 import org.apache.abdera2.common.protocol.Provider;
 import org.joda.time.DateTime;
 
+import com.google.common.collect.Iterators;
+
 @SuppressWarnings({ "unchecked" })
 public class ServletRequestContext 
   extends AbstractBaseRequestContext {
@@ -46,12 +48,19 @@ public class ServletRequestContext 
     private final ServletContext servletContext;
     private HttpSession session;
 
-    public ServletRequestContext(Provider provider, HttpServletRequest request, ServletContext servletContext) {
-        super(provider, request.getMethod(), initRequestUri(request), initBaseUri(provider, request));
+    public ServletRequestContext(
+      Provider provider, 
+      HttpServletRequest request, 
+      ServletContext servletContext) {
+        super(
+          provider, 
+          request.getMethod(), 
+          initRequestUri(request), 
+          initBaseUri(provider, request),
+          request.getUserPrincipal());
         this.request = request;
         this.servletContext = servletContext;
         this.session = request.getSession(false);
-        this.principal = request.getUserPrincipal();
         this.subject = provider.resolveSubject(this);
         this.target = initTarget();
     }
@@ -99,15 +108,15 @@ public class ServletRequestContext 
         return this;
     }
 
-    public Object getAttribute(Scope scope, String name) {
+    public <T>T getAttribute(Scope scope, String name) {
         switch (scope) {
             case REQUEST:
-                return request.getAttribute(name);
+                return (T)request.getAttribute(name);
             case SESSION:
-                return (session != null) ? session.getAttribute(name) : null;
+                return session != null ? (T)session.getAttribute(name) : null;
             case CONTAINER: {
                 ServletContext scontext = getServletContext();
-                return scontext != null ? scontext.getAttribute(name) : null;
+                return scontext != null ? (T)scontext.getAttribute(name) : null;
             }
         }
         return null;
@@ -135,9 +144,9 @@ public class ServletRequestContext 
         return enum2array(request.getParameterNames());
     }
 
-    public List<String> getParameters(String name) {
+    public Iterable<String> getParameters(String name) {
         String[] values = request.getParameterValues(name);
-        return values != null ? java.util.Arrays.asList(values) : null;
+        return values != null ? Arrays.<String>asList(values) : null;
     }
 
     public DateTime getDateHeader(String name) {
@@ -153,16 +162,18 @@ public class ServletRequestContext 
         return enum2array(request.getHeaderNames());
     }
 
+    @SuppressWarnings("rawtypes")
     public Iterable<Object> getHeaders(String name) {
-        Enumeration<?> e = request.getHeaders(name);
-        List<Object> list = new ArrayList<Object>();
-        while(e.hasMoreElements())
-          list.add(e.nextElement());
-        return list;
+        final Enumeration e = request.getHeaders(name);
+        return new Iterable<Object>() {
+          public Iterator<Object> iterator() {
+            return Iterators.<Object>forEnumeration(e);
+          }
+        };
     }
 
     private static Iterable<String> enum2array(Enumeration<String> e) {
-        return java.util.Collections.list(e);
+        return Collections.<String>list(e);
     }
 
     private static String getHost(Provider provider, HttpServletRequest request) {

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaAsyncService.java Wed Oct 26 18:26:55 2011
@@ -32,6 +32,9 @@ import org.apache.abdera2.common.pusher.
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import com.google.common.base.Predicate;
+import static com.google.common.base.Preconditions.*;
+
 @WebListener
 public class AbderaAsyncService 
   implements ServletContextListener, Runnable {
@@ -53,15 +56,14 @@ public class AbderaAsyncService 
     private TaskExecutor exec;
     private ProcessorQueue queue;
     private ChannelManager cm;
-    private boolean deployAtompubService;
-    private boolean deployChannelService;
+    private Map<String,Object> properties;
   
     public AbderaAsyncService() {
       log.debug("Abdera Async Service Created");
     }
     
-    protected Map<String, String> getProperties(ServletContext context) {
-      Map<String, String> properties = new HashMap<String, String>();
+    protected Map<String, Object> getProperties(ServletContext context) {
+      Map<String, Object> properties = new HashMap<String, Object>();
       Enumeration<String> e = context.getInitParameterNames();
       while (e.hasMoreElements()) {
           String key = e.nextElement();
@@ -71,36 +73,56 @@ public class AbderaAsyncService 
       return properties;
     }
     
-    private int worker_threads(Map<String,String> properties) {
+    private int worker_threads(Map<String,Object> properties) {
       int c = DEFAULT_WORKER_THREADS;
       if (properties.containsKey(PROPERTY_WORKER_THREADS)) {
-        String val = properties.get(PROPERTY_WORKER_THREADS);
-        c = Math.max(1,Integer.parseInt(val));
+        Object v = properties.get(PROPERTY_WORKER_THREADS);
+        if (v != null) {
+          if (v instanceof Integer) 
+            c = ((Integer)v).intValue();
+          else
+            c = Math.max(1,Integer.parseInt(v.toString()));
+        } 
       }
       return c;
     }
     
-    private boolean getBooleanProperty(Map<String, String> properties, String name, boolean def) {
+    private static boolean getBooleanProperty(Map<String, Object> properties, String name, boolean def) {
       boolean answer = def;
       if (properties.containsKey(name)) {
-        String val = properties.get(name);
-        answer = "TRUE".equalsIgnoreCase(val) || 
-                 "1".equals(val) ||
-                 "YES".equalsIgnoreCase(val);
+        Object v = properties.get(name);
+        if (v == null) answer = false;
+        else if (v instanceof Boolean) answer = ((Boolean)v).booleanValue();
+        else {
+          answer = "TRUE".equalsIgnoreCase(v.toString()) || 
+                   "1".equals(v.toString()) ||
+                   "YES".equalsIgnoreCase(v.toString());
+        }
       }
       return answer;
     }
     
-    public boolean isDeployAtompubService(Map<String,String> properties) {
-      return getBooleanProperty(properties,PROPERTY_ATOMPUB_SERVICE,false);
+    public static final Predicate<Map<String,Object>> DEPLOY_ATOMPUB = 
+      isDeployAtompubService();
+    private static Predicate<Map<String,Object>> isDeployAtompubService() {
+      return new Predicate<Map<String,Object>>() {
+        public boolean apply(Map<String,Object> properties) {
+          return getBooleanProperty(properties,PROPERTY_ATOMPUB_SERVICE,false);
+        }
+      };
     }
     
-    public boolean isDeployChannelService(Map<String,String> properties) {
-      return getBooleanProperty(properties,PROPERTY_CHANNEL_SERVICE,false);
+    public static final Predicate<Map<String,Object>> DEPLOY_CHANNEL =
+      isDeployChannelService();
+    private static Predicate<Map<String,Object>> isDeployChannelService() {
+      return new Predicate<Map<String,Object>>() {
+        public boolean apply(Map<String,Object> properties) {
+          return getBooleanProperty(properties,PROPERTY_CHANNEL_SERVICE,false);
+        }
+      };
     }
     
-    @SuppressWarnings("unchecked")
-    protected ServiceManager<Provider> createServiceManager(ServletContext context) {
+    protected ServiceManager createServiceManager(ServletContext context) {
       String prop = context.getInitParameter(ServiceManager.class.getName());
       return prop != null ? 
         ServiceManager.Factory.getInstance(prop) :  
@@ -110,18 +132,14 @@ public class AbderaAsyncService 
     
     public void contextInitialized(ServletContextEvent event) {   
       this.context = event.getServletContext();
-      Map<String,String> properties = getProperties(context);
-      this.deployAtompubService = isDeployAtompubService(properties);
-      this.deployChannelService = isDeployChannelService(properties);
-      ServiceManager<Provider> manager = 
-        createServiceManager(context);
+      this.properties = getProperties(context);
+      ServiceManager manager = 
+        createServiceManager(context);      
+      checkState(
+        manager != null, 
+        "Service Manager is null");
       
-      if (manager == null) {
-          log.error("Service Manager is null. Application can not function correctly");
-          throw new IllegalStateException("Service Manager is null");
-      }
-      
-      if (deployAtompubService) {
+      if (DEPLOY_ATOMPUB.apply(properties)) {
         log.debug("Initializing Abdera Atompub Service...");
         queue = manager.newProcessorQueue(properties);
         exec = manager.newTaskExecutor(properties);
@@ -134,42 +152,25 @@ public class AbderaAsyncService 
         log.debug(String.format("Service Manager: %s",manager));
         log.debug(String.format("Provider:        %s",provider));
         
-        if (processor != null)
-          context.setAttribute(Processor.NAME, processor);
-        else {
-          log.error("Queue Processor is null. Application can not function correctly");
-          throw new IllegalStateException("Queue Processor is null");
-        }
-        if (exec != null)
-          context.setAttribute(RUNNER, exec);
-        else {
-          log.error("Task Executor is null. Application can not function correctly");
-          throw new IllegalStateException("Task Executor is null");
-        }
-        if (provider != null)
-          context.setAttribute(PROVIDER, provider);
-        else {
-          log.error("Provider is null. Application can not function correctly");
-          throw new IllegalStateException("Provider is null");
-        }
-        if (queue != null)
-          context.setAttribute(QUEUE, queue);
-        else {
-          log.error("Queue is null. Application can not function correctly");
-          throw new IllegalStateException("Queue is null");
-        }
+        checkState(processor != null, "Queue Processor is null");
+        checkState(exec != null, "Task Executor is null");
+        checkState(provider != null, "Provider is null");
+        checkState(queue != null, "Queue is null");
+        
+        context.setAttribute(Processor.NAME, processor);
+        context.setAttribute(RUNNER, exec);
+        context.setAttribute(PROVIDER, provider);
+        context.setAttribute(QUEUE, queue);
         context.setAttribute(SERVICEMANAGER, manager);
-  
         int ct = worker_threads(properties);
         log.debug(String.format("Launching watcher threads [%d]",ct));
         
-        for (int c = 0; c < ct; c++)
-          exec.startWorker(this);
+        exec.startWorker(ct,this);
         
         log.debug("Abdera Atompub Service is ready...");
       }
       
-      if (deployChannelService) {
+      if (DEPLOY_ATOMPUB.apply(properties)) {
         log.debug("Initializing Abdera Channel Service");
         cm = manager.newChannelManager(properties);
         log.debug(String.format("Channel Manager: %s", cm));
@@ -182,7 +183,7 @@ public class AbderaAsyncService 
     
     public void contextDestroyed(ServletContextEvent event) {
       ServletContext context = event.getServletContext();
-      if (deployAtompubService) {
+      if (DEPLOY_ATOMPUB.apply(properties)) {
         log.debug("Shutting down the Abdera Service...");
         if (exec != null)
           exec.shutdown();
@@ -197,7 +198,7 @@ public class AbderaAsyncService 
         context.removeAttribute(PROVIDER);
         context.removeAttribute(QUEUE);
       }
-      if (deployChannelService) {
+      if (DEPLOY_ATOMPUB.apply(properties)) {
         if (cm != null)
           cm.shutdown();
         context.removeAttribute(CM);

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaChannelServlet.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaChannelServlet.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaChannelServlet.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaChannelServlet.java Wed Oct 26 18:26:55 2011
@@ -29,6 +29,7 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.abdera2.common.http.Preference;
 import org.apache.abdera2.common.pusher.ChannelManager;
 import org.apache.abdera2.common.pusher.Listener;
 import org.apache.abdera2.common.pusher.Receiver;
@@ -47,7 +48,28 @@ public abstract class AbderaChannelServl
   
   protected abstract AsyncListener<?> createListener(AsyncContext context);
   
-  protected abstract long getTimeout(ServletConfig config, ServletContext context);
+  protected long getMaxTimeout(ServletConfig config, ServletContext context) {
+    return 30 * 1000;
+  }
+  
+  /**
+   * By default, we look for the Prefer: wait=<n> header to grab the 
+   * wait time, or return -1 to skip setting the timeout
+   */
+  protected long getTimeout(HttpServletRequest req, ServletConfig config, ServletContext context) {
+    return Math.min(getMaxTimeout(config,context),timeout(req));
+  }
+  
+  private static long timeout(HttpServletRequest req) {
+    try {
+      Iterable<Preference> i = Preference.parse(req.getHeader("Prefer"));
+      Preference waitPref = Preference.get(i, Preference.WAIT);
+      long wait = waitPref != null ? waitPref.getLongValue() : -1;
+      return Math.max(0, wait);
+    } catch (Throwable t) {
+      return -1;
+    }
+  }
   
   protected void doGet(
       final HttpServletRequest request, 
@@ -57,7 +79,9 @@ public abstract class AbderaChannelServl
     final ChannelManager cm = (ChannelManager) sc.getAttribute(AbderaAsyncService.CM);
     if (cm == null || !cm.isShutdown()) {
       final AsyncContext context = request.startAsync(request, response);
-      context.setTimeout(getTimeout(getServletConfig(),sc));
+      long timeout = getTimeout(request,getServletConfig(),sc);
+      if (timeout > -1)
+        context.setTimeout(timeout);
       context.start(
         new Runnable() {
           public void run() {

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaTask.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaTask.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaTask.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AbderaTask.java Wed Oct 26 18:26:55 2011
@@ -42,11 +42,14 @@ public class AbderaTask {
   private final RequestContext requestContext;
   private final Provider provider;
   
-  AbderaTask(AsyncContext context, Provider provider, RequestContext requestContext) {
-    this.context = context;
-    this.provider = provider;
-    this.requestContext = requestContext;
-    this.id = UUID.randomUUID().toString();
+  AbderaTask(
+    AsyncContext context, 
+    Provider provider, 
+    RequestContext requestContext) {
+      this.context = context;
+      this.provider = provider;
+      this.requestContext = requestContext;
+      this.id = UUID.randomUUID().toString();
   }
     
   public String getId() {
@@ -159,11 +162,10 @@ public class AbderaTask {
         if (response.isCommitted()) {
             log.error("Could not write an error message as the headers & HTTP status were already committed!");
         } else {
-          ResponseContext resp = 
-            provider.createErrorResponse(500, message, t);
-          response.setStatus(500);
           response.setCharacterEncoding("UTF-8");
-          resp.writeTo(response.getOutputStream());
+          response.setStatus(500);
+          provider.createErrorResponse(500, message, t)
+           .writeTo(response.getOutputStream());
         }
       } catch (IOException e) {
         log.error(String.format("Error writing to output stream (%s)",getId()),e);

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/AsyncAbderaServlet.java Wed Oct 26 18:26:55 2011
@@ -18,7 +18,12 @@
 package org.apache.abdera2.common.protocol.servlet.async;
 
 import java.io.IOException;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
 import javax.servlet.AsyncContext;
+import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
 import javax.servlet.annotation.WebServlet;
@@ -26,13 +31,27 @@ import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.abdera2.common.http.Preference;
 import org.apache.abdera2.common.protocol.Provider;
+import org.apache.abdera2.common.protocol.RequestContext;
+import org.apache.abdera2.common.protocol.ServiceManager;
 import org.apache.abdera2.common.protocol.servlet.ServletRequestContext;
 
 @WebServlet(asyncSupported=true)
 public class AsyncAbderaServlet 
   extends HttpServlet {
 
+      protected Map<String, Object> getProperties(ServletConfig config) {
+        Map<String, Object> properties = new HashMap<String, Object>();
+        Enumeration<String> e = config.getInitParameterNames();
+        while (e.hasMoreElements()) {
+            String key = e.nextElement();
+            String val = config.getInitParameter(key);
+            properties.put(key, val);
+        }
+        return properties;
+    }
+  
     private static final long serialVersionUID = 2086707888078611321L;
     @Override
     protected void service(
@@ -41,10 +60,13 @@ public class AsyncAbderaServlet 
           throws ServletException, IOException {
       ServletContext sc = getServletContext();
       Processor proc = (Processor) sc.getAttribute(Processor.NAME);
-      if (proc == null || !proc.isShutdown()) {
+      if (proc != null && !proc.isShutdown()) {
         final AsyncContext context = request.startAsync(request, response);
-        Provider provider = (Provider) sc.getAttribute(AbderaAsyncService.PROVIDER);
-        ServletRequestContext reqcontext = new ServletRequestContext(provider, request, sc);        
+        ServiceManager sm = (ServiceManager) sc.getAttribute(ServiceManager.class.getName());
+        Provider provider = sm.newProvider(getProperties(getServletConfig()));
+        ServletRequestContext reqcontext = new ServletRequestContext(provider, request, sc);
+        long timeout = getTimeout(reqcontext);
+        if (timeout > -1) context.setTimeout(timeout);
         proc.submit(context,provider,reqcontext);
       } else {
         response.sendError(
@@ -52,4 +74,23 @@ public class AsyncAbderaServlet 
           "Abdera Service in unavailable");
       }
     }
+    
+    public static long getTimeout(RequestContext req) {
+      return Math.min(getMaxTimeout(req),timeout(req));
+    }
+    
+    public static long getMaxTimeout(RequestContext req) {
+      return 30 * 1000;
+    }
+    
+    private static long timeout(RequestContext req) {
+      try {
+        Iterable<Preference> i = req.getPrefer();
+        Preference waitPref = Preference.get(i, Preference.WAIT);
+        long wait = waitPref != null ? waitPref.getLongValue() : -1;
+        return Math.max(0, wait);
+      } catch (Throwable t) {
+        return -1;
+      }
+    }
 }

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/DefaultProcessor.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/DefaultProcessor.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/DefaultProcessor.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/DefaultProcessor.java Wed Oct 26 18:26:55 2011
@@ -17,6 +17,7 @@
  */
 package org.apache.abdera2.common.protocol.servlet.async;
 
+import java.util.Map;
 import java.util.Queue;
 import java.util.concurrent.ConcurrentLinkedQueue;
 
@@ -62,4 +63,6 @@ public class DefaultProcessor 
       next().cancel();
   }
 
+  public void init(Map<String, Object> properties) {}
+
 }

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/DefaultTaskExecutor.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/DefaultTaskExecutor.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/DefaultTaskExecutor.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/DefaultTaskExecutor.java Wed Oct 26 18:26:55 2011
@@ -38,10 +38,10 @@ public class DefaultTaskExecutor 
     exec.execute(task);
   }
 
-  public void init(Map<String, String> properties) {
+  public void init(Map<String, Object> properties) {
     exec = (ThreadPoolExecutor) Executors.newCachedThreadPool();
     if (properties.containsKey(TERMINATION_TIMEOUT)) {
-      String val = properties.get(TERMINATION_TIMEOUT);
+      String val = (String)properties.get(TERMINATION_TIMEOUT);
       terminationTimeout = Math.max(1,Long.parseLong(val));
     }
   }
@@ -49,6 +49,11 @@ public class DefaultTaskExecutor 
   public void startWorker(Runnable worker) {
     exec.execute(worker);
   }
+  
+  public void startWorker(int count, Runnable worker) {
+    for (int n = 0; n < count; n++)
+      startWorker(worker);
+  }
 
   public void shutdown() {
     exec.shutdown();

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/ProcessorQueue.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/ProcessorQueue.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/ProcessorQueue.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/ProcessorQueue.java Wed Oct 26 18:26:55 2011
@@ -17,7 +17,10 @@
  */
 package org.apache.abdera2.common.protocol.servlet.async;
 
-public interface ProcessorQueue {
+import org.apache.abdera2.common.misc.Initializable;
+
+public interface ProcessorQueue 
+  extends Initializable {
 
   boolean hasNext();
   

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/TaskExecutor.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/TaskExecutor.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/TaskExecutor.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/protocol/servlet/async/TaskExecutor.java Wed Oct 26 18:26:55 2011
@@ -17,15 +17,17 @@
  */
 package org.apache.abdera2.common.protocol.servlet.async;
 
-import java.util.Map;
 import java.util.concurrent.Executor;
 
-public interface TaskExecutor extends Executor {
+import org.apache.abdera2.common.misc.Initializable;
 
-  void init(Map<String,String> properties);
+public interface TaskExecutor
+  extends Executor, Initializable {
   
   void startWorker(Runnable runnable);
   
+  void startWorker(int count, Runnable runnable);
+  
   void shutdown();
   
   boolean isRunning();

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/ChannelManager.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/ChannelManager.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/ChannelManager.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/ChannelManager.java Wed Oct 26 18:26:55 2011
@@ -17,7 +17,7 @@
  */
 package org.apache.abdera2.common.pusher;
 
-import java.util.Map;
+import org.apache.abdera2.common.misc.Initializable;
 
 /**
  * A "Channel" is a logical pairing of related Pusher and Receiver interfaces.
@@ -26,14 +26,13 @@ import java.util.Map;
  * generic as possible, allowing channels to be implemented in a broad variety
  * of ways.
  */
-public interface ChannelManager extends Iterable<String> {
+public interface ChannelManager 
+  extends Iterable<String>, Initializable {
 
   <T>Pusher<T> getPusher(String channel);
   
   <T>Receiver<T> getReceiver(String channel);
   
-  void init(Map<String,String> properties);
-  
   void shutdown();
   
   boolean isShutdown();

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/MapChannelManager.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/MapChannelManager.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/MapChannelManager.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/pusher/MapChannelManager.java Wed Oct 26 18:26:55 2011
@@ -98,5 +98,5 @@ public abstract class MapChannelManager 
     return shuttingDown;
   }
   
-  public void init(Map<String,String> properties) {}
+  public void init(Map<String,Object> properties) {}
 }

Modified: abdera/abdera2/common/src/main/java/org/apache/abdera2/common/text/Codec.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/common/src/main/java/org/apache/abdera2/common/text/Codec.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/common/src/main/java/org/apache/abdera2/common/text/Codec.java (original)
+++ abdera/abdera2/common/src/main/java/org/apache/abdera2/common/text/Codec.java Wed Oct 26 18:26:55 2011
@@ -45,7 +45,7 @@ public enum Codec {
           switch (this) {
               case Q: e = new QCodec(charset); break;
               case B: e = new BCodec(charset); break;
-              case STAR: e = new StarCodec(charset); break;
+              default: e = new StarCodec(charset); break;
           }
           return e.encode(value);
       } catch (Exception e) {
@@ -161,6 +161,7 @@ public enum Codec {
       }
     }
   
+  @SuppressWarnings("synthetic-access")
   public static Function<String,String> decode() {
     return new DecodeFunction();
   }

Modified: abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/ActivitiesServlet.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/ActivitiesServlet.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/ActivitiesServlet.java (original)
+++ abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/activities/ActivitiesServlet.java Wed Oct 26 18:26:55 2011
@@ -9,11 +9,7 @@ import org.apache.abdera2.common.protoco
   initParams={
     @WebInitParam(
       name="org.apache.abdera2.common.protocol.ServiceManager",
-      value="org.apache.abdera2.activities.protocol.ActivitiesServiceManager"
-    ),
-    @WebInitParam(
-      name="org.apache.abdera2.common.protocol.Provider", 
-      value="org.apache.abdera2.activities.protocol.basic.BasicProvider"
+      value="org.apache.abdera2.activities.protocol.basic.BasicServiceManager"
     )
   }
 )

Modified: abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/appserver/employee/AppServer.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/appserver/employee/AppServer.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/appserver/employee/AppServer.java (original)
+++ abdera/abdera2/examples/src/main/java/org/apache/abdera2/examples/appserver/employee/AppServer.java Wed Oct 26 18:26:55 2011
@@ -17,7 +17,6 @@
  */
 package org.apache.abdera2.examples.appserver.employee;
 
-import org.apache.abdera2.Abdera;
 import org.apache.abdera2.common.protocol.Provider;
 import org.apache.abdera2.common.protocol.servlet.AbderaServlet;
 import org.apache.abdera2.protocol.server.impl.DefaultAtompubProvider;
@@ -26,7 +25,6 @@ import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
 
-
 public class AppServer {
 
     public static void main(String... args) throws Exception {
@@ -46,10 +44,8 @@ public class AppServer {
         server.join();
     }
 
-    // START SNIPPET: servlet
     public static final class EmployeeProviderServlet extends AbderaServlet {
         private static final long serialVersionUID = -549428240693531463L;
-
         protected Provider createProvider() {
             EmployeeCollectionAdapter ca = new EmployeeCollectionAdapter("employee");
             DefaultAtompubProvider provider = 
@@ -61,10 +57,8 @@ public class AppServer {
                   .title("Employee Directory Workspace")
                   .collection(ca)
                   .get());
-
-            provider.init(Abdera.getInstance(), null);
+            provider.init(null);
             return provider;
         }
     }
-    // END SNIPPET: servlet
 }

Modified: abdera/abdera2/security/src/main/java/org/apache/abdera2/security/Security.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/src/main/java/org/apache/abdera2/security/Security.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/security/src/main/java/org/apache/abdera2/security/Security.java (original)
+++ abdera/abdera2/security/src/main/java/org/apache/abdera2/security/Security.java Wed Oct 26 18:26:55 2011
@@ -128,7 +128,7 @@ public class Security {
     public <T extends Element>Predicate<T> isVerified(final SignatureOptions options) {
       return new Predicate<T>() {
         public boolean apply(T input) {
-          return verifier(options).apply(input);
+          return  verifier(options).apply(input);
         }
       };
     }

Modified: abdera/abdera2/security/src/main/java/org/apache/abdera2/security/xmlsec/XmlSignature.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/security/src/main/java/org/apache/abdera2/security/xmlsec/XmlSignature.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/security/src/main/java/org/apache/abdera2/security/xmlsec/XmlSignature.java (original)
+++ abdera/abdera2/security/src/main/java/org/apache/abdera2/security/xmlsec/XmlSignature.java Wed Oct 26 18:26:55 2011
@@ -214,7 +214,6 @@ public class XmlSignature extends Signat
                 }
             }
         }
-
         return answer;
     }
 

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/AtompubProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/AtompubProvider.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/AtompubProvider.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/AtompubProvider.java Wed Oct 26 18:26:55 2011
@@ -17,8 +17,6 @@
  */
 package org.apache.abdera2.protocol.server;
 
-import java.util.Map;
-
 import org.apache.abdera2.Abdera;
 import org.apache.abdera2.common.protocol.Provider;
 import org.apache.abdera2.common.protocol.TargetType;
@@ -31,11 +29,6 @@ import org.apache.abdera2.common.protoco
 public interface AtompubProvider extends Provider {
 
     /**
-     * Initialize the Provider.
-     */
-    void init(Abdera abdera, Map<String, String> properties);
-
-    /**
      * Retrieve the Abdera instance associated with this provider
      */
     Abdera getAbdera();

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/AtompubServiceManager.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/AtompubServiceManager.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/AtompubServiceManager.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/AtompubServiceManager.java Wed Oct 26 18:26:55 2011
@@ -20,39 +20,36 @@ package org.apache.abdera2.protocol.serv
 import java.util.Map;
 
 import org.apache.abdera2.Abdera;
-import org.apache.abdera2.common.Discover;
-import org.apache.abdera2.common.Localizer;
+import org.apache.abdera2.common.misc.MoreFunctions;
 import org.apache.abdera2.common.protocol.AbstractServiceManager;
+import org.apache.abdera2.common.protocol.Provider;
 import org.apache.abdera2.protocol.server.impl.DefaultAtompubProvider;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 /**
- * The ServiceManager is used by the AbderaServlet to bootstrap the server instance. There should be little to no reason
- * why an end user would need to use this class directly.
+ * The ServiceManager is used by the AbderaServlet to bootstrap the server 
+ * instance. There should be little to no reason why an end user would need 
+ * to use this class directly.
  */
 public class AtompubServiceManager 
-  extends AbstractServiceManager<AtompubProvider> {
+  extends AbstractServiceManager {
 
-    private final static Log log = LogFactory.getLog(AtompubServiceManager.class);
+    private final Abdera abdera;
 
-    private final Abdera abdera = Abdera.getInstance();
-
-    public AtompubServiceManager() {}
-
-    public Abdera getAbdera() {
-        return abdera;
+    public AtompubServiceManager() {
+      this.abdera = Abdera.getInstance();
+    }
+    
+    public AtompubServiceManager(Abdera abdera) {
+      this.abdera = abdera;
     }
 
-    public AtompubProvider newProvider(Map<String, String> properties) {
-        Abdera abdera = getAbdera();
-        String instance = properties.get(PROVIDER);
-        if (instance == null)
-            instance = DefaultAtompubProvider.class.getName();
-        log.debug(Localizer.sprintf("CREATING.NEW.INSTANCE", "Provider"));
-        AtompubProvider provider = (AtompubProvider)Discover.locate(AtompubProvider.class, instance);
-        log.debug(Localizer.sprintf("INITIALIZING.INSTANCE", "Provider"));
-        provider.init(abdera, properties);
-        return provider;
+    @SuppressWarnings("unchecked")
+    public <P extends Provider>P newProvider(
+      Map<String, Object> properties) {
+      properties.put("abdera",abdera);
+      return (P)MoreFunctions
+        .discoverInitializable(
+          Provider.class,
+          DefaultAtompubProvider.class).apply(properties);
     }    
 }

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubProvider.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubProvider.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubProvider.java Wed Oct 26 18:26:55 2011
@@ -124,9 +124,13 @@ public abstract class AbstractAtompubPro
             workspaceManager));
     }
 
-    public void init(Abdera abdera, Map<String, String> properties) {
-        this.abdera = abdera == null ? abdera : Abdera.getInstance();
-        this.init(properties);
+    public void init(Map<String, Object> properties) {
+      this.abdera = 
+        properties != null && 
+        properties.containsKey("abdera") ?
+          (Abdera)properties.get("abdera") :
+          Abdera.getInstance();
+      super.init(properties);
     }
 
     public Abdera getAbdera() {

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubWorkspaceProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubWorkspaceProvider.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubWorkspaceProvider.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/AbstractAtompubWorkspaceProvider.java Wed Oct 26 18:26:55 2011
@@ -70,9 +70,13 @@ public abstract class AbstractAtompubWor
         this));
   }
   
-  public void init(Abdera abdera, Map<String, String> properties) {
+  public void init(Map<String, Object> properties) {
+    this.abdera = 
+      properties != null && 
+      properties.containsKey("abdera") ?
+        (Abdera)properties.get("abdera") :
+        Abdera.getInstance();
     super.init(properties);
-    this.abdera = abdera;
   }
 
   public Abdera getAbdera() {

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/DefaultAtompubProvider.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/DefaultAtompubProvider.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/DefaultAtompubProvider.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/impl/DefaultAtompubProvider.java Wed Oct 26 18:26:55 2011
@@ -21,7 +21,6 @@ import java.util.Collection;
 
 import javax.security.auth.Subject;
 
-import org.apache.abdera2.common.misc.Resolver;
 import org.apache.abdera2.common.protocol.DefaultWorkspaceManager;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.Request;
@@ -32,6 +31,8 @@ import org.apache.abdera2.common.protoco
 import org.apache.abdera2.common.protocol.WorkspaceInfo;
 import org.apache.abdera2.common.protocol.WorkspaceManager;
 
+import com.google.common.base.Function;
+
 /**
  * The DefaultProvider is the default Provider implementation for Abdera. It supports multiple collections and assumes a
  * simple http://.../{collection}/{entry} URL structure. Media-link entries are not supported.
@@ -39,8 +40,8 @@ import org.apache.abdera2.common.protoco
 public class DefaultAtompubProvider 
   extends AbstractAtompubProvider {
 
-    protected Resolver<Target,RequestContext> targetResolver;
-    protected Resolver<Subject,Request> subjectResolver;
+    protected Function<RequestContext,Target> targetResolver;
+    protected Function<Request,Subject> subjectResolver;
     protected TargetBuilder<?> targetBuilder;
     protected RouteManager<TargetType,RequestContext> routeManager;
 
@@ -68,27 +69,27 @@ public class DefaultAtompubProvider 
         return routeManager;
     }
 
-    protected Resolver<Target,RequestContext> getTargetResolver(RequestContext request) {
+    protected Function<RequestContext,Target> getTargetResolver(RequestContext request) {
         return targetResolver;
     }
 
-    public void setTargetResolver(Resolver<Target,RequestContext> targetResolver) {
+    public void setTargetResolver(Function<RequestContext,Target> targetResolver) {
         this.targetResolver = targetResolver;
     }
 
-    protected Resolver<Subject,Request> getSubjectResolver(RequestContext request) {
+    protected Function<Request,Subject> getSubjectResolver(RequestContext request) {
         return subjectResolver;
     }
 
-    public void setSubjectResolver(Resolver<Subject,Request> subjectResolver) {
+    public void setSubjectResolver(Function<Request,Subject> subjectResolver) {
         this.subjectResolver = subjectResolver;
     }
 
-    public Resolver<Target,RequestContext> getTargetResolver() {
+    public Function<RequestContext,Target> getTargetResolver() {
         return targetResolver;
     }
 
-    public Resolver<Subject,Request> getSubjectResolver() {
+    public Function<Request,Subject> getSubjectResolver() {
         return subjectResolver;
     }
 

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/MultipartRelatedServiceRequestProcessor.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/MultipartRelatedServiceRequestProcessor.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/MultipartRelatedServiceRequestProcessor.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/MultipartRelatedServiceRequestProcessor.java Wed Oct 26 18:26:55 2011
@@ -35,6 +35,8 @@ import org.apache.abdera2.protocol.serve
 import org.apache.abdera2.protocol.server.multipart.MultipartRelatedCollectionInfo;
 import org.apache.abdera2.writer.StreamWriter;
 
+import com.google.common.base.Predicate;
+
 /**
  * {@link org.apache.AtompubRequestProcessor.protocol.server.RequestProcessor} implementation which processes requests for service
  * documents. It writes multipart/related accept attributes when is enabled.
@@ -42,11 +44,18 @@ import org.apache.abdera2.writer.StreamW
 public class MultipartRelatedServiceRequestProcessor 
   extends ServiceRequestProcessor {
 
-    protected MultipartRelatedServiceRequestProcessor(
+    public MultipartRelatedServiceRequestProcessor(
       WorkspaceManager workspaceManager, 
       CollectionAdapter adapter) {
         super(workspaceManager, adapter);
     }
+    
+    public MultipartRelatedServiceRequestProcessor(
+        WorkspaceManager workspaceManager, 
+        CollectionAdapter adapter,
+        Predicate<RequestContext> predicate) {
+          super(workspaceManager, adapter, predicate);
+      }
 
     protected ResponseContext getServiceDocument(
       final RequestContext request, 

Modified: abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/ServiceRequestProcessor.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/ServiceRequestProcessor.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/ServiceRequestProcessor.java (original)
+++ abdera/abdera2/server/src/main/java/org/apache/abdera2/protocol/server/processors/ServiceRequestProcessor.java Wed Oct 26 18:26:55 2011
@@ -21,6 +21,7 @@ import java.io.IOException;
 
 import org.apache.abdera2.common.Constants;
 import org.apache.abdera2.common.http.EntityTag;
+import org.apache.abdera2.common.misc.ExceptionHelper;
 import org.apache.abdera2.common.protocol.RequestContext;
 import org.apache.abdera2.common.protocol.ResponseContext;
 import org.apache.abdera2.common.protocol.CollectionAdapter;
@@ -36,6 +37,8 @@ import org.apache.abdera2.protocol.serve
 import org.apache.abdera2.writer.StreamWriter;
 import org.joda.time.DateTime;
 
+import com.google.common.base.Predicate;
+
 /**
  * {@link org.apache.AtompubRequestProcessor.protocol.server.RequestProcessor} implementation which processes requests for service
  * documents.
@@ -43,11 +46,19 @@ import org.joda.time.DateTime;
 public class ServiceRequestProcessor 
   extends RequestProcessor {
 
-    protected ServiceRequestProcessor(
+    public ServiceRequestProcessor(
       WorkspaceManager workspaceManager,
       CollectionAdapter adapter) {
         super(workspaceManager, adapter);
     }
+    
+    public ServiceRequestProcessor(
+        WorkspaceManager workspaceManager,
+        CollectionAdapter adapter,
+        Predicate<RequestContext> predicate) {
+          super(workspaceManager, adapter,predicate);
+      }
+
 
     public ResponseContext apply(
         RequestContext request) {
@@ -59,7 +70,7 @@ public class ServiceRequestProcessor 
         WorkspaceManager workspaceManager) {
         String method = context.getMethod();
         if (method.equalsIgnoreCase("GET")) {
-            return this.getServiceDocument(context, workspaceManager);
+            return getServiceDocument(context, workspaceManager);
         } else {
             return null;
         }

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/AsyncBasicTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/AsyncBasicTest.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/AsyncBasicTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/AsyncBasicTest.java Wed Oct 26 18:26:55 2011
@@ -32,8 +32,6 @@ import org.apache.abdera2.activities.mod
 import org.apache.abdera2.activities.model.Verb;
 import org.apache.abdera2.activities.model.objects.NoteObject;
 import org.apache.abdera2.activities.model.objects.PersonObject;
-import org.apache.abdera2.activities.protocol.ActivitiesServiceManager;
-import org.apache.abdera2.activities.protocol.basic.BasicProvider;
 import org.apache.abdera2.common.http.ResponseType;
 import org.apache.abdera2.protocol.client.BasicClient;
 import org.apache.abdera2.protocol.client.ClientResponse;
@@ -55,8 +53,7 @@ public class AsyncBasicTest {
         if (server == null) {
             server = new JettyServer();
             server.startAsync(
-              ActivitiesServiceManager.class, 
-              BasicProvider.class,
+              BasicActivitiesServiceManager.class,
               new TestChannelServlet());
         }
     }

Added: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicActivitiesServiceManager.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicActivitiesServiceManager.java?rev=1189362&view=auto
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicActivitiesServiceManager.java (added)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicActivitiesServiceManager.java Wed Oct 26 18:26:55 2011
@@ -0,0 +1,21 @@
+package org.apache.abdera2.test.activities.server;
+
+import java.util.Map;
+
+import org.apache.abdera2.activities.protocol.ActivitiesServiceManager;
+import org.apache.abdera2.activities.protocol.basic.BasicProvider;
+import org.apache.abdera2.common.protocol.Provider;
+
+public class BasicActivitiesServiceManager 
+  extends ActivitiesServiceManager {
+
+  public BasicActivitiesServiceManager() {}
+  
+  @SuppressWarnings("unchecked")
+  public <P extends Provider> P newProvider(Map<String, Object> properties) {
+    BasicProvider bp = new BasicProvider();
+    bp.init(properties);
+    return (P)bp;
+  }
+
+}

Propchange: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicActivitiesServiceManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicTest.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/BasicTest.java Wed Oct 26 18:26:55 2011
@@ -32,8 +32,6 @@ import org.apache.abdera2.activities.mod
 import org.apache.abdera2.activities.model.Verb;
 import org.apache.abdera2.activities.model.objects.NoteObject;
 import org.apache.abdera2.activities.model.objects.PersonObject;
-import org.apache.abdera2.activities.protocol.ActivitiesServiceManager;
-import org.apache.abdera2.activities.protocol.basic.BasicProvider;
 import org.apache.abdera2.protocol.client.BasicClient;
 import org.apache.abdera2.protocol.client.ClientResponse;
 import org.apache.abdera2.protocol.client.Client;
@@ -56,7 +54,7 @@ public class BasicTest {
     public static void setUp() throws Exception {
         if (server == null) {
             server = new JettyServer();
-            server.start(ActivitiesServiceManager.class, BasicProvider.class);
+            server.start(BasicActivitiesServiceManager.class);
         }
     }
 

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/TestChannelServlet.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/TestChannelServlet.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/TestChannelServlet.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/activities/server/TestChannelServlet.java Wed Oct 26 18:26:55 2011
@@ -3,8 +3,6 @@ package org.apache.abdera2.test.activiti
 import java.io.Writer;
 
 import javax.servlet.AsyncContext;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -42,9 +40,4 @@ public class TestChannelServlet 
     };
   }
 
-  @Override
-  protected long getTimeout(ServletConfig config, ServletContext context) {
-    return 60 * 1000;
-  }
-
 }

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/common/misc/MiscTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/common/misc/MiscTest.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/common/misc/MiscTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/common/misc/MiscTest.java Wed Oct 26 18:26:55 2011
@@ -8,7 +8,6 @@ import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
-import org.apache.abdera2.common.misc.PoolManager;
 import org.junit.Test;
 
 import com.google.common.collect.Iterators;
@@ -37,23 +36,4 @@ public class MiscTest {
     assertFalse(mi.hasNext());
   }
   
-  @Test
-  public void poolManagerTest() {
-    PoolManager<String,String> pm = 
-      new PoolManager<String,String>(2) {
-        private int c = 0;
-        protected String internalNewInstance() {
-          return "A"+(c++);
-        }
-    };
-    assertEquals("A0",pm.get(""));
-    assertEquals("A1",pm.get(""));
-    pm.release("A0");
-    assertEquals("A0",pm.get(""));
-    pm.release("A0");
-    pm.release("A1");
-    pm.release("A2");
-    assertEquals("A1",pm.get(""));
-    assertEquals("A2",pm.get(""));
-  }
 }

Added: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/CustomAtompubServiceManager.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/CustomAtompubServiceManager.java?rev=1189362&view=auto
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/CustomAtompubServiceManager.java (added)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/CustomAtompubServiceManager.java Wed Oct 26 18:26:55 2011
@@ -0,0 +1,18 @@
+package org.apache.abdera2.test.security.filter;
+
+import java.util.Map;
+
+import org.apache.abdera2.common.protocol.Provider;
+import org.apache.abdera2.protocol.server.AtompubServiceManager;
+
+public class CustomAtompubServiceManager extends AtompubServiceManager {
+
+  @SuppressWarnings("unchecked")
+  @Override
+  public <P extends Provider> P newProvider(Map<String, Object> properties) {
+    CustomProvider cp = new CustomProvider("/");
+    cp.init(properties);
+    return (P)cp;
+  }
+
+}

Propchange: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/CustomAtompubServiceManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/JettyServer.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/JettyServer.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/JettyServer.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/JettyServer.java Wed Oct 26 18:26:55 2011
@@ -18,8 +18,8 @@
 package org.apache.abdera2.test.security.filter;
 
 import org.apache.abdera2.common.protocol.Provider;
+import org.apache.abdera2.common.protocol.ServiceManager;
 import org.apache.abdera2.common.protocol.servlet.AbderaServlet;
-import org.apache.abdera2.protocol.server.AtompubServiceManager;
 import org.eclipse.jetty.server.Server;
 import org.eclipse.jetty.servlet.ServletContextHandler;
 import org.eclipse.jetty.servlet.ServletHolder;
@@ -40,13 +40,13 @@ public class JettyServer {
         this.port = port;
     }
 
-    public void start(Class<? extends Provider> _class) throws Exception {
+    public void start(Class<? extends ServiceManager> _class) throws Exception {
         server = new Server(port);
         ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
         context.setContextPath("/");
         server.setHandler(context);
         ServletHolder servletHolder = new ServletHolder(new AbderaServlet());
-        servletHolder.setInitParameter(AtompubServiceManager.PROVIDER, _class.getName());
+        servletHolder.setInitParameter(ServiceManager.class.getName(), _class.getName());
         context.addServlet(servletHolder, "/*");
         server.start();
     }

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/SecurityFilterTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/SecurityFilterTest.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/SecurityFilterTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/SecurityFilterTest.java Wed Oct 26 18:26:55 2011
@@ -54,7 +54,7 @@ public class SecurityFilterTest {
         try {
 
             server = new JettyServer();
-            server.start(CustomProvider.class);
+            server.start(CustomAtompubServiceManager.class);
         } catch (Exception e) {
             e.printStackTrace();
         }

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/SimpleAdapter.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/SimpleAdapter.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/SimpleAdapter.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/security/filter/SimpleAdapter.java Wed Oct 26 18:26:55 2011
@@ -156,9 +156,17 @@ public class SimpleAdapter extends Abstr
                 feed.setUpdated(DateTime.now());
                 FOMResponseContext<?> rc =
                     (FOMResponseContext<?>)AbstractAtompubProvider.returnBase(entry_doc, 201, entry.getEdited());
-                return rc.setLocation(ProviderHelper.resolveBase(request).resolve(entry.getEditLinkResolvedHref())
-                    .toString()).setContentLocation(rc.getLocation().toString()).setEntityTag(AbstractAtompubProvider
-                    .calculateEntityTag(entry));
+                return rc
+                  .setLocation(
+                    ProviderHelper
+                      .resolveBase(request)
+                      .resolve(entry.getEditLinkResolvedHref()))
+                  .setContentLocation(
+                    rc.getLocation()
+                      .toString())
+                  .setEntityTag(
+                    AbstractAtompubProvider
+                      .calculateEntityTag(entry));
             } else {
                 return ProviderHelper.badrequest(request);
             }
@@ -184,7 +192,7 @@ public class SimpleAdapter extends Abstr
       Map<String, String> params = new HashMap<String, String>();
       params.put("collection", request.getTarget().getParameter("collection"));
       params.put("entry", entryid);
-      return request.urlFor(TargetType.TYPE_ENTRY, params);
+      return request.urlFor("entry",params);
   }
 
   private Function<RequestContext,ResponseContext> putItem() {

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/JettyServer.java Wed Oct 26 18:26:55 2011
@@ -25,36 +25,22 @@ import org.apache.abdera2.common.protoco
 import org.apache.abdera2.common.protocol.servlet.async.AbderaAsyncService;
 import org.apache.abdera2.common.protocol.servlet.async.AbderaChannelServlet;
 import org.apache.abdera2.common.protocol.servlet.async.AsyncAbderaServlet;
-import org.apache.abdera2.protocol.server.AtompubServiceManager;
 import org.apache.abdera2.test.JettyUtil;
 import org.eclipse.jetty.servlet.ServletHolder;
 
 public class JettyServer {
 
-    public void start(Class<? extends Provider> _class) throws Exception {
-        ServletHolder servletHolder = new ServletHolder(new AbderaServlet());
-        servletHolder.setInitParameter(AtompubServiceManager.PROVIDER, _class.getName());
-
-      JettyUtil.addServlet(servletHolder, "/*");
-      JettyUtil.start();
-    }
-
-    
     public void start(
-        Class<? extends ServiceManager<?>> _smclass, 
-        Class<? extends Provider> _class) throws Exception {
+        Class<? extends ServiceManager> _smclass) throws Exception {
       
       ServletHolder servletHolder = new ServletHolder(new AbderaServlet());
-      servletHolder.setInitParameter(ServiceManager.PROVIDER, _class.getName());
       servletHolder.setInitParameter(ServiceManager.class.getName(), _smclass.getName());
       JettyUtil.addServlet(servletHolder, "/*");
       JettyUtil.start();
     }
     
-    
     public void startAsync(
-        Class<? extends ServiceManager<?>> _smclass, 
-        Class<? extends Provider> _class,
+        Class<? extends ServiceManager> _smclass, 
         AbderaChannelServlet acs) throws Exception {
       
       ServletHolder servletHolder = new ServletHolder(new AsyncAbderaServlet());
@@ -72,7 +58,6 @@ public class JettyServer {
       JettyUtil.getSch().setInitParameter("AbderaAtompubService", "true");
       JettyUtil.getSch().setInitParameter("AbderaChannelService", "true");
       JettyUtil.getSch().setInitParameter(ServiceManager.class.getName(), _smclass.getName());
-      JettyUtil.getSch().setInitParameter(ServiceManager.PROVIDER, _class.getName());
       JettyUtil.getSch().setEventListeners(listeners);
       JettyUtil.start();
     }

Added: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicAtompubServiceManager.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicAtompubServiceManager.java?rev=1189362&view=auto
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicAtompubServiceManager.java (added)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicAtompubServiceManager.java Wed Oct 26 18:26:55 2011
@@ -0,0 +1,23 @@
+package org.apache.abdera2.test.server.basic;
+
+import java.util.Map;
+
+import org.apache.abdera2.common.protocol.Provider;
+import org.apache.abdera2.protocol.server.AtompubServiceManager;
+import org.apache.abdera2.protocol.server.provider.basic.BasicProvider;
+
+public class BasicAtompubServiceManager 
+  extends AtompubServiceManager {
+
+  public BasicAtompubServiceManager() {}
+  
+  @SuppressWarnings("unchecked")
+  @Override
+  public <P extends Provider> P newProvider(
+    Map<String, Object> properties) {
+      BasicProvider bp = new BasicProvider();
+      bp.init(properties);
+      return (P)bp;
+  }
+  
+}

Propchange: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicAtompubServiceManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicTest.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/basic/BasicTest.java Wed Oct 26 18:26:55 2011
@@ -38,7 +38,6 @@ import org.apache.abdera2.protocol.clien
 import org.apache.abdera2.protocol.client.ClientResponse;
 import org.apache.abdera2.protocol.client.RequestOptions;
 import org.apache.abdera2.protocol.client.Session;
-import org.apache.abdera2.protocol.server.provider.basic.BasicProvider;
 import org.apache.abdera2.test.server.JettyServer;
 import org.apache.abdera2.common.Constants;
 import org.apache.abdera2.common.http.ResponseType;
@@ -60,7 +59,7 @@ public class BasicTest {
     public static void setUp() throws Exception {
         if (server == null) {
             server = new JettyServer();
-            server.start(BasicProvider.class);
+            server.start(BasicAtompubServiceManager.class);
         }
     }
 

Added: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomAtompubServiceManager.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomAtompubServiceManager.java?rev=1189362&view=auto
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomAtompubServiceManager.java (added)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomAtompubServiceManager.java Wed Oct 26 18:26:55 2011
@@ -0,0 +1,18 @@
+package org.apache.abdera2.test.server.custom;
+
+import java.util.Map;
+
+import org.apache.abdera2.common.protocol.Provider;
+import org.apache.abdera2.protocol.server.AtompubServiceManager;
+
+public class CustomAtompubServiceManager extends AtompubServiceManager {
+
+  @SuppressWarnings("unchecked")
+  @Override
+  public <P extends Provider> P newProvider(Map<String, Object> properties) {
+    CustomProvider cp = new CustomProvider("/");
+    cp.init(properties);
+    return (P)cp;
+  }
+
+}

Propchange: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomAtompubServiceManager.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomProviderTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomProviderTest.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomProviderTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/custom/CustomProviderTest.java Wed Oct 26 18:26:55 2011
@@ -61,7 +61,7 @@ public class CustomProviderTest {
     public static void setUp() throws Exception {
         try {
             server = new JettyServer();
-            server.start(CustomProvider.class);
+            server.start(CustomAtompubServiceManager.class);
         } catch (Exception e) {
             e.printStackTrace();
         }

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/customer/CustomerAdapterTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/customer/CustomerAdapterTest.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/customer/CustomerAdapterTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/customer/CustomerAdapterTest.java Wed Oct 26 18:26:55 2011
@@ -196,7 +196,7 @@ public class CustomerAdapterTest {
         JettyUtil.addServlet(new ServletHolder(new AbderaServlet() {
             @Override
             protected AtompubProvider createProvider() {
-                customerProvider.init(Abdera.getInstance(), null);
+                customerProvider.init(null);
                 return customerProvider;
             }
         }), "/*");

Modified: abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/multipart/MultipartRelatedTest.java
URL: http://svn.apache.org/viewvc/abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/multipart/MultipartRelatedTest.java?rev=1189362&r1=1189361&r2=1189362&view=diff
==============================================================================
--- abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/multipart/MultipartRelatedTest.java (original)
+++ abdera/abdera2/test/src/main/java/org/apache/abdera2/test/server/multipart/MultipartRelatedTest.java Wed Oct 26 18:26:55 2011
@@ -47,8 +47,7 @@ public class MultipartRelatedTest {
                   RequestProcessor.forClass(
                     MultipartRelatedServiceRequestProcessor.class, 
                     provider.getWorkspaceManager()));
-                provider.addRequestProcessors(map);
-                
+                provider.addRequestProcessors(map);            
                 MultipartRelatedAdapter ca = new MultipartRelatedAdapter("media");
                 
                 provider
@@ -59,7 +58,7 @@ public class MultipartRelatedTest {
                       .collection(ca)
                       .get());
 
-                provider.init(Abdera.getInstance(), null);
+                provider.init(null);
                 return provider;
             }
         }), "/*");



Mime
View raw message