You have two options:
- you must add Spring deployer into the embeddable EJB3 mix.
And then add SpringInterceptor into ejb3-interceptors-aop.xml (see how this is done in app. server).
- or include jboss-spring-jdk5.jar into classpath and use Spring<Lifecycle|Passivation>Interceptor as EJB3 uses interceptors.
But be sure you deploy/bind your spring-context (BeanFactory or ApplicationContext) under specified jndi name (see @Spring jndiName and SpringInjectionSupport).
About my first option: I've no clue how to mix the spring deployer into the embeddable EJB3. Anyone?
The second option seems more easy. However, it seems to be difficult to bind a BeanFactory or ApplicationContext in JNDI, because they're not Serializable. I've tried to use the SpringBeanFactoryDeployerImpl class in the spring-deployer jars, but without luck.
How can I from my standalone environment load the spring ApplicationContext or BeanFactory?
For the 2nd option:
look at NonSerializableFactory.rebind(ctx, name, beanFactory);
YES ITS WORKING!. Just the method I needed!
Actually both options it working (with or without the SpringLifecycleInterceptor), after I mixed the spring-deployer into the embeddable EJB3.
Thank you very much, especially for your very fast answers.