Using annotations with ProxyFactoryBean

443 views
Skip to first unread message

a_schulle

unread,
Dec 16, 2010, 5:50:00 AM12/16/10
to gwt-sl
Hello,

I'm locking for a way to use GWTHandler with annotations for a
ProxyFactoryBean.

Example:
handler-servlet.xml
<bean id="urlMapping"
class="org.gwtwidgets.server.spring.GWTHandler">
<property name="scanParentApplicationContext" value="true" />
</bean>

applicationContext.xml
<bean id="GreetingServiceImpl"
class="com.blabla.server.GreetingServiceImpl" />
<bean id="GreetingService"
class="org.springframework.aop.framework.ProxyFactoryBean" >
<property name="target" ref="GreetingServiceImpl" />
<property name="autodetectInterfaces" value="true" />
<property name="interceptorNames">
<list>
<value>requestSetter</value>
<value>LifeCycleAspect</value>
</list>
</property>
</bean>

com.blabla.server.GreetingServiceImpl implements the annotated
interface.

Problem:
GreetingServiceImpl is called wenn the client makes the call but
GreetingService should be called.
I understand why this happens. I moved GreetingService to handler-
servlet.xml and set scanParentApplicationContext to false. It works.
But thats ugly.
Is there a better way?

Thx.
Alex

George Georgovassilis

unread,
Dec 16, 2010, 7:23:53 AM12/16/10
to gwt...@googlegroups.com
Hello Alex,

As you've probably guessed, the target can't be determined unambiguously
- any annotation declared on an interface will appear in the
implementation as well. I see a couple of ways around that:

1. You can use a manual mapping (good old XML) with the GWTHandler -
maybe disqualified because of your use of annotations
2. You could create a business interface GreetingsService devoid of any
GWT semantics, have GreetingsServiceImpl implement that interface,
create a new interface GWTGreetingsService which extends
GreetingsService and adds the RPC semantics and have the proxy implement it
3. File a proposal of how you would like to have this solved with the SL

I hope that helps,
G.

Reply all
Reply to author
Forward
0 new messages