Java 类javax.ejb.Remote 实例源码

项目:testee.fi    文件:EjbDescriptorImpl.java   
public EjbDescriptorImpl(final Class<T> clazz) {
    LOG.trace("Creating EJB descriptor for {}", clazz);
    this.clazz = clazz;
    localBusinessInterfaces = new HashSet<>();
    remoteBusinessInterfaces = new HashSet<>();
    localBusinessInterfaces.add((BusinessInterfaceDescriptor) () -> clazz);
    stream(clazz.getInterfaces()).forEach(iface -> {
        if (iface.getAnnotation(Remote.class) != null) {
            remoteBusinessInterfaces.add((BusinessInterfaceDescriptor) () -> iface);
        } else {
            localBusinessInterfaces.add((BusinessInterfaceDescriptor) () -> iface);
        }
    });
}
项目:oscm    文件:InvocationDateContainerTest.java   
@Before
public void setUp() throws Exception {
    mapping = new HashMap<Class<?>, List<Class<?>>>();
    classes = new ArrayList<Class<?>>();
    excludes = new ArrayList<String>();
    // do not check the APP beans
    excludes.add("org.oscm.app.");
    String directory = "..";
    findAnnotatedStatelessBeans(new File(directory), "org.oscm.",
            Remote.class, classes, mapping);
}
项目:oscm    文件:InterfaceMap.java   
private boolean considerInterface(Class<?> i) {
    if (i.getAnnotation(Local.class) != null) {
        return true;
    } else if (i.getAnnotation(Remote.class) != null) {
        return true;
    } else {
        return isExcplicitlyRequiredClass(i);
    }
}
项目:development    文件:InvocationDateContainerTest.java   
@Before
public void setUp() throws Exception {
    mapping = new HashMap<Class<?>, List<Class<?>>>();
    classes = new ArrayList<Class<?>>();
    excludes = new ArrayList<String>();
    // do not check the APP beans
    excludes.add("org.oscm.app.");
    String directory = "..";
    findAnnotatedStatelessBeans(new File(directory), "org.oscm.",
            Remote.class, classes, mapping);
}
项目:development    文件:InterfaceMap.java   
private boolean considerInterface(Class<?> i) {
    if (i.getAnnotation(Local.class) != null) {
        return true;
    } else if (i.getAnnotation(Remote.class) != null) {
        return true;
    } else {
        return isExcplicitlyRequiredClass(i);
    }
}
项目:lightmare    文件:BeanDeployer.java   
/**
 * Retrieves interface classes from passed {@link Local} or {@link Remote}
 * annotation
 *
 * @param annotation
 * @return {@link Class}[] array of interface classes
 */
private Class<?>[] ejbInterfaces(Annotation annotation) {

    Class<?>[] interfaces;

    if (annotation instanceof Remote) {
        interfaces = ObjectUtils.cast(annotation, Remote.class).value();
    } else if (annotation instanceof Local) {
        interfaces = ObjectUtils.cast(annotation, Local.class).value();
    } else {
        interfaces = null;
    }

    return interfaces;
}
项目:lightmare    文件:BeanDeployer.java   
/**
 * Identifies and caches EJB bean's {@link Local} and / or {@link Remote}
 * annotated interfaces
 *
 * @param beanClass
 */
private void initInterfaces(Class<?> beanClass, Class<? extends Annotation> type) {

    Class<?>[] interfaces = null;
    Set<Class<?>> interfacesSet = new HashSet<Class<?>>();
    Annotation ejbAnnotation = beanClass.getAnnotation(type);
    Class<?>[] ejbInterfaces = beanClass.getInterfaces();

    if (ObjectUtils.notNull(ejbAnnotation)) {
        interfaces = ejbInterfaces(ejbAnnotation);
        if (CollectionUtils.valid(interfaces)) {
            interfacesSet.addAll(Arrays.asList(interfaces));
        }
    }

    for (Class<?> interfaceClass : ejbInterfaces) {
        if (interfaceClass.isAnnotationPresent(type))
            interfacesSet.add(interfaceClass);
    }

    if (CollectionUtils.valid(interfacesSet)) {
        interfaces = toArray(interfacesSet);
        if (ejbAnnotation instanceof Local) {
            metaData.setRemoteInterfaces(interfaces);
        } else if (ejbAnnotation instanceof Remote) {
            metaData.setRemoteInterfaces(interfaces);
        }
    }
}
项目:stagemonitor    文件:IsDeclaredInRemoteClassElementMatcher.java   
@Override
public boolean matches(MethodDescription targetMethod) {
    final AnnotationList declaredAnnotationsOfType = targetMethod.getDeclaringType().asErasure().getDeclaredAnnotations();
    if (declaredAnnotationsOfType.isAnnotationPresent(Remote.class)) {
        final Class[] remoteInterfaces = declaredAnnotationsOfType.ofType(Remote.class).loadSilent().value();
        if (!new TypeList.ForLoadedTypes(remoteInterfaces).filter(isDeclaredInInterfaceHierarchy(targetMethod)).isEmpty()) {
            return true;
        }
    }
    return false;
}
项目:oscm    文件:WebMethodNamesTest.java   
@Override
public boolean isNeglectableClass(Class<?> clazz) {
    return (clazz.getAnnotation(Remote.class) == null);
}
项目:oscm    文件:DeployedSessionBean.java   
private void invokeInvocationDateInterceptor(Method method) {
    if (method.getDeclaringClass().getAnnotation(Remote.class) != null) {
        DateFactory.getInstance().takeCurrentTime();
    }
}
项目:development    文件:WebMethodNamesTest.java   
@Override
public boolean isNeglectableClass(Class<?> clazz) {
    return (clazz.getAnnotation(Remote.class) == null);
}
项目:development    文件:DeployedSessionBean.java   
private void invokeInvocationDateInterceptor(Method method) {
    if (method.getDeclaringClass().getAnnotation(Remote.class) != null) {
        DateFactory.getInstance().takeCurrentTime();
    }
}
项目:cats    文件:IRServiceWSImpl.java   
@Override
public List< com.comcast.cats.keymanager.domain.Remote > getRemotes()
{
    return keyManager.getRemotes();
}
项目:cats    文件:KeyManagerProxy.java   
@GET
   @Path(KeyManagerConstants.REMOTES_PATH)
   @Produces("application/xml")
public List<com.comcast.cats.keymanager.domain.Remote> remotes();
项目:stagemonitor    文件:RemoteEjbMonitorTransformer.java   
@Override
protected ElementMatcher.Junction<TypeDescription> getNarrowTypesMatcher() {
    return isAnnotatedWith(Remote.class).or(implementsInterfaceWhichIsAnnotatedWithRemote());
}
项目:stagemonitor    文件:RemoteInterfaceElementMatcher.java   
@Override
public boolean matches(TypeDescription target) {
    return !target.getInterfaces().asErasures().filter(isAnnotatedWith(Remote.class)).isEmpty();
}
项目:stagemonitor    文件:RemoteInterfaceMethodMatcher.java   
@Override
public boolean matches(MethodDescription target) {
    return target.getDeclaringType().getInterfaces().asErasures()
            .filter(isAnnotatedWith(Remote.class))
            .filter(isDeclaredInInterfaceHierarchy(target)).size() > 0;
}
项目:tomee    文件:CheckClasses.java   
private boolean isValidInterface(final RemoteBean b, final Class clazz, final Class beanClass, final String tag) {

        if (clazz.equals(beanClass)) {

            fail(b, "xml." + tag + ".beanClass", clazz.getName());

        } else if (!clazz.isInterface()) {

            fail(b, "xml." + tag + ".notInterface", clazz.getName());

        } else if (EJBHome.class.isAssignableFrom(clazz)) {

            if (tag.equals("home")) {
                return true;
            }

            fail(b, "xml." + tag + ".ejbHome", clazz.getName());

        } else if (EJBLocalHome.class.isAssignableFrom(clazz)) {

            if (tag.equals("localHome")) {
                return true;
            }

            fail(b, "xml." + tag + ".ejbLocalHome", clazz.getName());

        } else if (EJBObject.class.isAssignableFrom(clazz)) {

            if (tag.equals("remote")) {
                return true;
            }

            fail(b, "xml." + tag + ".ejbObject", clazz.getName());

        } else if (EJBLocalObject.class.isAssignableFrom(clazz)) {

            if (tag.equals("local")) {
                return true;
            }

            fail(b, "xml." + tag + ".ejbLocalObject", clazz.getName());

        } else {
            if (tag.equals("businessLocal") || tag.equals("businessRemote")) {

                return true;

            } else if (clazz.isAnnotationPresent(Local.class)) {

                fail(b, "xml." + tag + ".businessLocal", clazz.getName());

            } else if (clazz.isAnnotationPresent(Remote.class)) {

                fail(b, "xml." + tag + ".businessRemote", clazz.getName());

            } else {

                fail(b, "xml." + tag + ".unknown", clazz.getName());

            }

        }

        // must be tagged as <home>, <local-home>, <remote>, or <local>

        return false;
    }
项目:lightmare    文件:BeanDeployer.java   
/**
 * Identifies and caches EJB bean interfaces
 *
 * @param beanClass
 */
private void indentifyInterfaces(Class<?> beanClass) {
    initInterfaces(beanClass, Local.class);
    initInterfaces(beanClass, Remote.class);
}
项目:cats    文件:KeyManagerService.java   
public List<com.comcast.cats.keymanager.domain.Remote> getRemoteTransferObjects();