public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { Resource ref = container.getAnnotation(Resource.class, method); if (ref == null) return; log.trace("method " + method + " has @Resource"); handlePropertyAnnotation(ref, new MethodBeanProperty(method), container, injectors); }
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) { 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 handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { Resource ref = container.getAnnotation(Resource.class, field); if (ref == null) return; log.trace("field " + field + " has @Resource"); handlePropertyAnnotation(ref, new FieldBeanProperty(field), container, injectors); }
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<?> clazz, InjectionContainer container) { PersistenceContexts resources = container.getAnnotation(PersistenceContexts.class, clazz); if (resources != null) { for (PersistenceContext ref : resources.value()) { loadPersistenceContextClassAnnotation(ref, container, clazz); } } PersistenceContext pc = container.getAnnotation(PersistenceContext.class, clazz); if (pc != null) { loadPersistenceContextClassAnnotation(pc, container, clazz); } }
public void handleClassAnnotations(Class<?> clazz, InjectionContainer container) { PersistenceUnits resources = container.getAnnotation( PersistenceUnits.class, clazz); if (resources != null) { for (PersistenceUnit ref : resources.value()) { handleClassAnnotation(ref, container, clazz); } } PersistenceUnit pu = container.getAnnotation(PersistenceUnit.class, clazz); if (pu != null) { handleClassAnnotation(pu, container, clazz); } }
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 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())); }
public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { Depends dep = container.getAnnotation(Depends.class, method.getDeclaringClass(), method); if (dep != null) { if (!method.getName().startsWith("set")) throw new RuntimeException("@EJB can only be used with a set method: " + method); String[] names = dep.value(); if (names.length != 1) throw new RuntimeException("@Depends on a field can only take one object name: " + method); ObjectName on = null; try { on = new ObjectName(names[0]); } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } // don't replace other injections if (injectors.get(method) == null) injectors.put(method, new DependsMethodInjector(method, on)); container.getDependencyPolicy().addDependency(names[0]); } }
public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { Depends dep = container.getAnnotation(Depends.class, field.getDeclaringClass(), field); if (dep != null) { String[] names = dep.value(); if (names.length != 1) throw new RuntimeException("@Depends on a field can only take one object name: " + field); ObjectName on = null; try { on = new ObjectName(names[0]); } catch (MalformedObjectNameException e) { throw new RuntimeException(e); } // don't replace other injections if (injectors.get(field) == null) injectors.put(field, new DependsFieldInjector(field, on)); container.getDependencyPolicy().addDependency(names[0]); } }
public void handleClassAnnotations(Class<?> clazz, InjectionContainer container) { Depends dep = container.getAnnotation(Depends.class, clazz); if (dep == null) return; for (String dependency : dep.value()) { container.getDependencyPolicy().addDependency(dependency); } }
public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { EJB ref = container.getAnnotation(EJB.class, method); if (ref != null) { if (!method.getName().startsWith("set")) throw new RuntimeException("@EJB can only be used with a set method: " + method); String encName = getEncName(ref, method); if (!container.getEncInjectors().containsKey(encName)) { ejbRefEncInjector(ref.mappedName(), encName, method.getName().substring(0), method.getParameterTypes()[0], ref.beanName(), "@EJB", container); if (isIgnoreDependency(container, ref)) log.debug("IGNORING <ejb-ref> DEPENDENCY: " + encName); else ejbRefDependency(ref.mappedName(), ref.beanName(), container, method.getParameterTypes()[0], "@EJB", encName); } super.handleMethodAnnotations(method, container, injectors); } }
public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors) Resource ref = container.getAnnotation(Resource.class, method); if (ref == null) return;
public void handleMethodAnnotations(Method method, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { EJB ref = container.getAnnotation(EJB.class, method); if (ref != null) { if (!method.getName().startsWith("set")) throw new RuntimeException("@EJB can only be used with a set method: " + method); String encName = getEncName(ref, method); if (!container.getEncInjectors().containsKey(encName)) { Class<?> businessInterface = method.getParameterTypes()[0]; if (ref.beanInterface() != null && ref.beanInterface() != Object.class) { businessInterface = ref.beanInterface(); } ejbRefEncInjector(ref.mappedName(), encName, method.getName().substring(0), businessInterface, ref.beanName(), "@EJB", container); if (container.getAnnotation(IgnoreDependency.class, method) == null) { if (isIgnoreDependency(container, ref)) log.debug("IGNORING <ejb-ref> DEPENDENCY: " + encName); else ejbRefDependency(ref.mappedName(), ref.beanName(), container, businessInterface, "@EJB", encName); } } super.handleMethodAnnotations(method, container, injectors); } }
public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors) { EJB ref = container.getAnnotation(EJB.class, field); if (ref != null) { String encName = getEncName(ref, field); if (!container.getEncInjectors().containsKey(encName)) { Class<?> businessInterface = field.getType(); if (ref.beanInterface() != null && ref.beanInterface() != Object.class) { businessInterface = ref.beanInterface(); } if (container.getAnnotation(IgnoreDependency.class, field) == null) { if (isIgnoreDependency(container, ref)) log.debug("IGNORING <ejb-ref> DEPENDENCY: " + encName); else ejbRefDependency(ref.mappedName(), ref.beanName(), container, businessInterface, "@EJB", encName); } ejbRefEncInjector(ref.mappedName(), encName, field.getName(), businessInterface, ref.beanName(), "@EJB", container); } super.handleFieldAnnotations(field, container, injectors); } }
public void handleFieldAnnotations(Field field, InjectionContainer container, Map<AccessibleObject, Injector> injectors) EJB ref = container.getAnnotation(EJB.class, field); if (ref != null)