01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: SoapXFireFactoryInvoker.java 3810 2007-06-25 13:36:58Z gbevin $
07: */
08: package com.uwyn.rife.engine.elements;
09:
10: import com.uwyn.rife.engine.ElementContext;
11: import com.uwyn.rife.engine.ElementService;
12: import org.codehaus.xfire.MessageContext;
13: import org.codehaus.xfire.fault.XFireFault;
14: import org.codehaus.xfire.service.invoker.FactoryInvoker;
15: import org.codehaus.xfire.service.invoker.ScopePolicy;
16: import org.codehaus.xfire.util.factory.Factory;
17:
18: // FIXME: needs a better implementation as soon as XFire 1.2.3 is released, the Invoker API is currently a bit broken
19: class SoapXFireFactoryInvoker extends FactoryInvoker {
20: public SoapXFireFactoryInvoker(Factory factory, ScopePolicy scope) {
21: super (factory, scope);
22: }
23:
24: public Object getServiceObject(MessageContext context)
25: throws XFireFault {
26: Object instance = super .getServiceObject(context);
27: if (instance instanceof ElementService) {
28: ((ElementService) instance)
29: .setRequestElement(ElementContext
30: .getActiveElementSupport());
31: }
32:
33: return instance;
34: }
35: }
|