private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) { final List<Class> allLocalOrRemoteIfaces = new LinkedList<>(); if (resourceClass.isAnnotationPresent(Remote.class)) { allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value())); } if (resourceClass.isAnnotationPresent(Local.class)) { allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value())); } for (Class<?> i : resourceClass.getInterfaces()) { if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) { allLocalOrRemoteIfaces.add(i); } } return allLocalOrRemoteIfaces; }
private Collection<Class<?>> getLocalBusinessInterfaces(final DeploymentUnit deploymentUnit, final Class<?> sessionBeanClass) throws DeploymentUnitProcessingException { final Local localViewAnnotation = sessionBeanClass.getAnnotation(Local.class); if (localViewAnnotation == null) { Collection<Class<?>> interfaces = getBusinessInterfacesFromInterfaceAnnotations(sessionBeanClass, Local.class); if (!interfaces.isEmpty()) { return interfaces; } return Collections.emptySet(); } Class<?>[] localViews = localViewAnnotation.value(); if (localViews == null || localViews.length == 0) { Set<Class<?>> interfaces = getPotentialBusinessInterfaces(sessionBeanClass); // For version < 3.2, the EJB spec didn't allow more than one implementing interfaces to be considered as local when the bean class had the @Local annotation without any explicit value. // EJB 3.2 allows it (core spec, section 4.9.7) if (interfaces.size() != 1 && !isEjbVersionGreaterThanOrEqualTo32(deploymentUnit)) { throw EjbLogger.ROOT_LOGGER.beanWithLocalAnnotationImplementsMoreThanOneInterface(sessionBeanClass); } return interfaces; } return Arrays.asList(localViews); }
private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) { final List<Class> allLocalOrRemoteIfaces = new LinkedList<Class>(); if (resourceClass.isAnnotationPresent(Remote.class)) { allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value())); } if (resourceClass.isAnnotationPresent(Local.class)) { allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value())); } for (Class<?> i : resourceClass.getInterfaces()) { if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) { allLocalOrRemoteIfaces.add(i); } } return allLocalOrRemoteIfaces; }
private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) { final List<Class> allLocalOrRemoteIfaces = new LinkedList<Class>(); if (resourceClass.isAnnotationPresent(Remote.class)) { allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value())); } if (resourceClass.isAnnotationPresent(Local.class)) { allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value())); } for (Class<?> i : resourceClass.getInterfaces()) { if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) { allLocalOrRemoteIfaces.add(i); } } return allLocalOrRemoteIfaces; }
private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) { final List<Class> allLocalOrRemoteIfaces = new LinkedList<Class>(); if (resourceClass.isAnnotationPresent(Remote.class)) { allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value())); } if (resourceClass.isAnnotationPresent(Local.class)) { allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value())); } for (Class<?> i : resourceClass.getInterfaces()) { if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) { allLocalOrRemoteIfaces.add(i); } } return allLocalOrRemoteIfaces; }
/** * {@link Local}アノテーションで指定されたビジネスインターフェースを検出します。 */ protected void detectLocalBusinessInterfaces() { final Local local = beanClass.getAnnotation(Local.class); if (local != null) { for (final Class<?> type : local.value()) { if (isBusinessInterface(type)) { businessInterfaces.add(type); } } return; } for (final Class<?> type : beanClass.getInterfaces()) { final Local annotation = type.getAnnotation(Local.class); if (annotation != null) { businessInterfaces.add(type); } } }
@Override public Method getInvocableMethod(Method method) { final Class<?> declaringClass = method.getDeclaringClass(); final List<Class> interfaces = new LinkedList<Class>(); if (declaringClass.isAnnotationPresent(Remote.class)) { interfaces.addAll(Arrays.asList(declaringClass.getAnnotation(Remote.class).value())); } if (declaringClass.isAnnotationPresent(Local.class)) { interfaces.addAll(Arrays.asList(declaringClass.getAnnotation(Local.class).value())); } for (Class<?> i : declaringClass.getInterfaces()) { if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) { interfaces.add(i); } } for (Class iface : interfaces) { try { final Method interfaceMethod = iface.getDeclaredMethod(method.getName(), method.getParameterTypes()); if (interfaceMethod != null) { return interfaceMethod; } } catch (Exception e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } } return method; }
@Override public Method getInvocableMethod(Method method) { final Class<?> declaringClass = method.getDeclaringClass(); final List<Class> interfaces = new LinkedList<Class>(); if (declaringClass.isAnnotationPresent(Remote.class)) { interfaces.addAll(Arrays.asList(declaringClass.getAnnotation(Remote.class).value())); } if (declaringClass.isAnnotationPresent(Local.class)) { interfaces.addAll(Arrays.asList(declaringClass.getAnnotation(Local.class).value())); } for (Class<?> i : declaringClass.getInterfaces()) { if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) { interfaces.add(i); } } for (Class iface : interfaces) { try { final Method interfaceMethod = iface.getDeclaredMethod(method.getName(), method.getParameterTypes()); if (interfaceMethod != null) { return interfaceMethod; } } catch (Exception e) { LOGGER.log(Level.WARNING, e.getMessage(), e); } } return method; }
private Collection<Class<?>> getLocalBusinessInterfaces(Class<?> sessionBeanClass) throws DeploymentUnitProcessingException { final Local localViewAnnotation = sessionBeanClass.getAnnotation(Local.class); if (localViewAnnotation == null) { Collection<Class<?>> interfaces = getBusinessInterfacesFromInterfaceAnnotations(sessionBeanClass, Local.class); if (!interfaces.isEmpty()) { return interfaces; } return Collections.emptySet(); } Class<?>[] localViews = localViewAnnotation.value(); if (localViews == null || localViews.length == 0) { Set<Class<?>> interfaces = getPotentialBusinessInterfaces(sessionBeanClass); if (interfaces.size() != 1) throw MESSAGES.beanWithLocalAnnotationImplementsMoreThanOneInterface(sessionBeanClass); return interfaces; } return Arrays.asList(localViews); }
public void process(SessionBeanMetaData metaData, Class<?> type) { Local local = finder.getAnnotation(type, Local.class); if(local == null) return; if(type.isInterface()) { addBusinessInterface(metaData, type); } else { if(local.value() == null || local.value().length == 0) { Class<?> businessInterface = ClassHelper.getDefaultInterface(type); addBusinessInterface(metaData, businessInterface); } else { for(Class<?> businessInterface : local.value()) { addBusinessInterface(metaData, businessInterface); } } } } }
public void process(SessionBeanMetaData metaData, Class<?> type) { Local local = finder.getAnnotation(type, Local.class); if(local == null) return; if(type.isInterface()) { addBusinessInterface(metaData, type); } else { if(local.value() == null || local.value().length == 0) { Class<?> businessInterface = ClassHelper.getDefaultInterface(type); addBusinessInterface(metaData, businessInterface); } else { for(Class<?> businessInterface : local.value()) { addBusinessInterface(metaData, businessInterface); } } } }
public void process(JBossSessionBeanMetaData metaData, Class<?> type) { Local local = finder.getAnnotation(type, Local.class); if(local == null) return; if(type.isInterface()) { addBusinessInterface(metaData, type); } else { if(local.value() == null || local.value().length == 0) { Class<?> businessInterface = ClassHelper.getDefaultInterface(type); addBusinessInterface(metaData, businessInterface); } else { for(Class<?> businessInterface : local.value()) { addBusinessInterface(metaData, businessInterface); } } } }
for (Class<?> i : clazz.getAnnotation(Local.class).value()) scannedClasses.put(i, clazz);
if (localAnnotation != null) Class[] locals = localAnnotation.value(); for (int i = 0; i < locals.length; ++i)
if (localAnnotation != null) for (final Class<?> clazz : localAnnotation.value())
if (localAnnotation != null) for (final Class<?> clazz : localAnnotation.value())