abdera-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Diephouse (JIRA)" <j...@apache.org>
Subject [jira] Created: (ABDERA-55) Add setters & refactor servlet to make it more spring friendly
Date Tue, 07 Aug 2007 23:49:59 GMT
Add setters & refactor servlet to make it more spring friendly
--------------------------------------------------------------

                 Key: ABDERA-55
                 URL: https://issues.apache.org/jira/browse/ABDERA-55
             Project: Abdera
          Issue Type: Improvement
    Affects Versions: 0.2.2
            Reporter: Dan Diephouse
             Fix For: 0.3.0


I'm attaching a patch which makes it possible to extend the AbderaServlet to provide your
own pre-inited ServiceContext like this:

public class MyAbderaServlet extends org.apache.abdera.protocol.server.servlet.AbderaServlet
{
    
    protected ServiceContext createServiceContext() {
        System.out.println("initing service context");
        WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
        
        ServiceContext sc = (ServiceContext) ctx.getBean("abderaServiceContext");
        sc.init(getAbdera(), getProperties(getServletConfig()));
        return sc;
    }

}

It also adds some setters to make Abdera easier to use from Spring (although not as easy as
it could be... I still have to create my own servlet, my own TargetResolver, and my own ProviderManager.
I should just be able to embed these in Spring config. I may submit a patch for this in the
future, but it would require a little more refactoring)


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message