Let me elaborate.
Consider one stateless session bean which exposes a business interface that looks something like this:
Code:
public interface EjbService {
public Object executeMethodOnSpringBean(String service, Class serviceInterface, Method method, Object[] params);
}
The session bean has access to a Spring context which contains the services. The method looks up the Spring bean with the supplied name. It finds the given method and invoke it with the supplied parameters.
So thinking about it is not so much a EjbServiceExporter I am after, but more a EjbServiceProxyFactoryBean which can be used by clients.
For example:
Code:
<bean id="myService" class="org.springframework.remoting.ejb.EjbServiceProxyFactoryBean">
<property name="ejb" ref="ejbService" />
<property name="service" value="myService" />
<property name="serviceInterface" value="com.mycom.MyService" />
</bean>
<jee:remote-slsb id="ejbService" jndi-name="ejb/EjbService"
business-interface="org.springframework.remoting.ejb.EjbService"/>
One drawback to this approach is that the transaction policy (Requires, RequiresNew etc.) would be the same for all invocations regardless of what Spring bean we hit in the end. However, I believe Supports would be appropriate as I would let the Spring bean layer control the transactions scope. It would support global transactions because if a remote client has started a transaction the EjbService bean will hook itself to that transaction before calling the Spring beans.