Thanks, its added. http://jira.codehaus.org/browse/XFIRE-853

The patch file is attached to the issue.

Mark

On Jan 21, 2007, at 4:08 PM, Brice Ruth wrote:

Could you create a JIRA issue for this? This would be a feature request, I think - http://jira.codehaus.org/browse/XFIRE. You can then attach your patch file to the JIRA issue, which will probably make it easier on the committers.

-Brice

On 1/21/07, Mark Slater <[EMAIL PROTECTED]> wrote:
I'm trying to migrate my XFire usage from XFireExporter style of
specifying services to the Jsr181HandlerMapping style. One of the
things I ran into was that the Jsr181HandlerMapping doesn't support
the inHandlers proerty from XFireExporter. I suspect that's because
the expected way of doing message handlers with JSR-181 is via the
@HandlerChain annotation. Unfortunately, I wasn't able to find a good
explanation of how to use this within XFire such that the handlers
would be loaded via spring with all their properties wired-in. I did
find the @InHandlers annotation that was added to XFire recently, but
that had the same problem - the handler object was created without
going through Spring, so its dependencies weren't available.

So I  came up with my own solution. I simply added the inHandler,
outHandler, and faultHandler properties to the Jsr181HandlerMapping
class, so they can be wired in just like they were with
XFireExporter. And things work beautifully, for me at least. There
may be side-effects that I'm unaware of, and if so I'd appreciate a
warning before I start to depend on this! I've attached the diffs in
case anyone's interested.

I'd like to submit this as a patch if it would be accepted ...
otherwise, I'll deal with it another way. Also, if there's a way to
use HandlerChain such that the Spring dependency injections are done,
I'd love to hear about it.

Mark

Using the inHandlers:

     <bean id="handlerMapping"
class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping">
         <property name="typeMappingRegistry">
             <ref bean=" xfire.typeMappingRegistry" />
         </property>
         <property name="xfire">
             <ref bean="xfire" />
         </property>
         <property name="webAnnotations">
             <ref bean="webAnnotationsHandler" />
         </property>
         <property name="urlPrefix">
             <value>/</value>
         </property>
         <property name="inHandlers">
             <list>
                 <ref bean="authenticationInHandler" />
             </list>
         </property>
     </bean>



5,6d4
< import java.util.List;
<
45,48d42
<
<     private List inHandlers;
<     private List outHandlers;
<     private List faultHandlers;
121,138d114
<                 // set up in handlers
<                 if (endpoint.getInHandlers() == null)
<                     endpoint.setInHandlers(getInHandlers());
<                 else if (getInHandlers() != null)
< endpoint.getInHandlers().addAll(getInHandlers ());
<
<                 // set up out handlers
<                 if (endpoint.getOutHandlers() == null)
<                     endpoint.setOutHandlers(getOutHandlers());
<                 else if (getOutHandlers() != null)
<                     endpoint.getOutHandlers().addAll(getOutHandlers
());
<
<                 // set up fault handlers.
<                 if (endpoint.getFaultHandlers() == null)
<                     endpoint.setFaultHandlers(getFaultHandlers());
<                 else if (getFaultHandlers() != null)
<                     endpoint.getFaultHandlers().addAll
(getFaultHandlers());
<
225,254d200
<
<     public List getFaultHandlers()
<     {
<         return faultHandlers;
<     }
<
<     public void setFaultHandlers(List faultHandlers)
<     {
<         this.faultHandlers = faultHandlers;
<     }
<
<     public List getInHandlers()
<     {
<         return inHandlers;
<     }
<
<     public void setInHandlers(List inHandlers)
<     {
<         this.inHandlers = inHandlers;
<     }
<
<     public List getOutHandlers()
<     {
<         return outHandlers;
<     }
<
<     public void setOutHandlers(List outHandlers)
<     {
<         this.outHandlers = outHandlers;
<     }


---------------------------------------------------------------------
To unsubscribe from this list please visit:

     http://xircles.codehaus.org/manage_email




--
Brice Ruth
Software Engineer, Madison WI

Reply via email to