[ 
https://issues.apache.org/jira/browse/ABDERA-55?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12518287
 ] 

Dan Diephouse commented on ABDERA-55:
-------------------------------------

I thought I'd attach my spring config in case anyone wanted to see:

  <bean id="abderaServiceContext" 
class="org.apache.abdera.protocol.server.impl.DefaultServiceContext">
    <property name="providerManager" ref="providerManager"/>
    <property name="defaultTargetResolver" value="foo.MyTargetResolver"/>
  </bean>
  
  <bean id="providerManager" class="foo.MyProviderManager">
    <property name="provider" ref="provider"/>
  </bean>
  
  <bean id="provider" class="foo..MyProvider"/>
  

> 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
>
>         Attachments: patch
>
>
> 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.

Reply via email to