OK, I think I got it.

For everybody who is interrested in this topic:

I'm not using spring for my solution but extended the ejb3-interceptors-aop.xml:

  | <interceptor class="at.csd.e3e.ejb3.annotations.SchemaContextInjector" 
scope="PER_VM"/>
  | (...)
  | <domain name="Stateless Bean">
  |   <bind pointcut="execution(@javax.ejb.Stateless->new(..))">
  |      <interceptor-ref 
name="at.csd.e3e.ejb3.annotations.SchemaContextInjector"/>
  |    </bind>
  | (...)
  | 

The code for the Injector looks like this:
package at.csd.e3e.ejb3.annotations;
  | 
  | import java.lang.reflect.Field;
  | 
  | import org.jboss.aop.joinpoint.Invocation;
  | import org.jboss.aop.advice.Interceptor;
  | 
  | import at.csd.e3e.ejb3.schema.SchemaDescriptionImplRegistry;
  | 
  | public class SchemaContextInjector implements Interceptor {
  |    public String getName() { return getClass().getName(); }
  | 
  |    public Object invoke(Invocation invocation) throws Throwable {
  |        Object newInstance = invocation.invokeNext();
  |    
  |        Class clazz = newInstance.getClass();
  |        for (Field f : clazz.getDeclaredFields()) {
  |                SchemaContext anno = f.getAnnotation(SchemaContext.class);
  |                if (anno != null) {
  |                        f.setAccessible(true);
  |                        f.set(invocation.getTargetObject(), 
SchemaDescriptionImplRegistry.SINGLETON.getSchemaDescription(anno.unitName()));
  |                        break;
  |                }
  |        }
  |        return newInstance;
  |    }
  | }
  | 

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3924540#3924540

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3924540


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to