package org.jboss.injection;
import java.util.Arrays;
import javax.naming.*;
import org.jboss.ejb3.BeanContext;
import org.jboss.ejb3.JndiUtil;
import org.jboss.injection.AbstractPropertyInjector;
import org.jboss.injection.PojoInjector;
import org.jboss.injection.lang.reflect.BeanProperty;
import org.jboss.logging.Logger;
public class JndiPropertyInjector extends AbstractPropertyInjector implements PojoInjector {
public JndiPropertyInjector(BeanProperty property, String jndiName,
Context ctx) {
super(property);
this.jndiName = jndiName;
this.ctx = ctx;
}
public void inject(BeanContext bctx) {
System.out.println("bctx="+bctx+", instance="+bctx.getInstance()+", jndi="+jndiName);
try {
inject(bctx, bctx.getInstance());
}
catch (Exception e) {
System.err.println("failed property="+property);
System.err.println("property="+property.getName());
}
}
/* ... */
}
wtorek, sierpnia 12, 2014
Subskrybuj:
Komentarze do posta (Atom)
0 komentarze:
Prześlij komentarz