public void inject(BeanContext ctx, Object instance) { for (PojoInjector injector : injectors) { injector.inject(ctx, instance); } } }
public UserTransactionPropertyInjector create(BeanProperty property) { return new UserTransactionPropertyInjector(property, ic); } };
public WebServiceContextPropertyInjector create(BeanProperty property) { return new WebServiceContextPropertyInjector(property); } };
public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { JndiInject ref = field.getAnnotation(JndiInject.class); if (ref != null) { String encName = InjectionUtil.getEncName(field); if (!container.getEncInjectors().containsKey(encName)) { container.getEncInjectors().put(encName, new LinkRefEncInjector(encName, ref.jndiName(), "@JndiInject")); } injectors.put(field, new JndiFieldInjector(field, encName, container.getEnc())); } } }
public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { EJB ref = container.getAnnotation(EJB.class, field); if(ref == null) return; String encName = getEncName(ref, field); injectors.put(field, new JndiFieldInjector(field, encName, container.getEnc())); }
public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { EJB ref = container.getAnnotation(EJB.class, method); if(ref == null) return; String encName = getEncName(ref, method); injectors.put(method, new JndiMethodInjector(method, encName, container.getEnc())); }
private void addInjector(InjectionContainer container, String encName, AnnotatedElement annotatedElement) { Injector jndiInjector; if(annotatedElement instanceof Method) jndiInjector = new JndiMethodInjector((Method)annotatedElement, encName, container.getEnc()); else if(annotatedElement instanceof Field) jndiInjector = new JndiFieldInjector((Field)annotatedElement, encName, container.getEnc()); else throw new IllegalStateException("Annotated element for '" + encName + "' is niether Method nor Field: " + annotatedElement); container.getInjectors().add(jndiInjector); }
public static <X extends RemoteEnvironment> Map<AccessibleObject, Injector> processAnnotations(InjectionContainer container, Collection<InjectionHandler<X>> handlers, Class<?> clazz) { Map<AccessibleObject, Injector> classInjectors = new HashMap<AccessibleObject, Injector>(); HashSet<String> visitedMethods = new HashSet<String>(); collapseXmlMethodInjectors(visitedMethods, clazz, container.getEncInjections(), classInjectors); processClassAnnotations(container, handlers, clazz); visitedMethods = new HashSet<String>(); processMethodAnnotations(container, handlers, visitedMethods, clazz, classInjectors); processFieldAnnotations(container, handlers, clazz, classInjectors); return classInjectors; }
private void bindRefOnType(Class<?> type, InjectionContainer container, WebServiceRef wsref) { String name = wsref.name(); if (name.equals("")) name = InjectionUtil.getEncName(type).substring(4); if (!container.getEncInjectors().containsKey(name)) { String encName = "env/" + name; ServiceReferenceMetaData sref = getServiceRef(name); container.getEncInjectors().put(name, new ServiceRefInjector(encName, type, sref)); } }
public void handleClassAnnotations(Class<?> clazz, InjectionContainer container) { Resources resources = container.getAnnotation(Resources.class, clazz); if (resources != null) { for (Resource ref : resources.value()) { handleClassAnnotation(ref, container, clazz); } } Resource res = container.getAnnotation(Resource.class, clazz); if (res != null) handleClassAnnotation(res, container, clazz); }
public void handleClassAnnotations(Class<?> clazz, InjectionContainer container) { EJBs ref = container.getAnnotation(EJBs.class, clazz); if (ref != null) { EJB[] ejbs = ref.value(); for (EJB ejb : ejbs) { handleClassAnnotation(ejb, clazz, container); } } EJB ejbref = container.getAnnotation(EJB.class, clazz); if (ejbref != null) handleClassAnnotation(ejbref, clazz, container); }
public void handleClassAnnotations(Class<?> type, InjectionContainer container) { WebServiceRef wsref = container.getAnnotation(WebServiceRef.class, type); if (wsref != null) { bindRefOnType(type, container, wsref); } WebServiceRefs refs = container.getAnnotation(WebServiceRefs.class, type); if (refs != null) { for (WebServiceRef refItem : refs.value()) { bindRefOnType(type, container, refItem); } } }
public static void inject(BeanContext<?> ctx, Iterable<Injector> injectors) { // inject bean for(Injector injector : injectors) { injector.inject(ctx); } } }
protected void addJNDIDependency(InjectionContainer container, String jndiName) { // Do not depend on myself if(container.hasJNDIBinding(jndiName)) return; ((JBoss5DependencyPolicy) container.getDependencyPolicy()).addJNDIName(jndiName); } }
public void loadXml(X xml, InjectionContainer container) { super.loadXml(xml, container); if (xml != null) { if (xml.getEjbLocalReferences() != null) loadEjbLocalXml(xml.getEjbLocalReferences(), container); } }
public EJBContextPropertyInjector create(BeanProperty property) { return new EJBContextPropertyInjector(property); } };
private static String getMappedName(String encName, InjectionContainer container) { return getMappedName(encName, container, null); }
public UserTransactionPropertyInjector create(BeanProperty property) { return new UserTransactionPropertyInjector(property, ic); } };
public UserTransactionPropertyInjector create(BeanProperty property) { return new UserTransactionPropertyInjector(property, ic); } };
public UserTransactionPropertyInjector create(BeanProperty property) { return new UserTransactionPropertyInjector(property, ic); } };