javax.ejb.Stateless Java Examples

The following examples show how to use javax.ejb.Stateless. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ClassFilter.java    From development with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isNeglectableClass(Class<?> clazz) {
    boolean isNoClass = clazz.isEnum() || clazz.isInterface()
            || Modifier.isAbstract(clazz.getModifiers());
    Stateless annotation = clazz.getAnnotation(Stateless.class);
    return !(annotation != null && !isNoClass);
}
 
Example #2
Source File: WebAppTestCase.java    From netbeans with Apache License 2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    super.setUp();
    URL root = FileUtil.getArchiveRoot(Stateless.class.getProtectionDomain().getCodeSource().getLocation());
    addCompileRoots(Collections.singletonList(root));
}
 
Example #3
Source File: CommonTestCase.java    From netbeans with Apache License 2.0 4 votes vote down vote up
protected void setUp() throws Exception {
    super.setUp();
    URL root = FileUtil.getArchiveRoot(Stateless.class.getProtectionDomain().getCodeSource().getLocation());
    addCompileRoots(Collections.singletonList(root));
}
 
Example #4
Source File: ClassPathProviderImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public ClassPathProviderImpl() {
    URL statelessAnnotationURL = Stateless.class.getProtectionDomain().getCodeSource().getLocation();
    this.compilePath = ClassPathSupport.createClassPath(new URL[] { FileUtil.getArchiveRoot(statelessAnnotationURL) });
    this.bootPath = JavaPlatformManager.getDefault().getDefaultPlatform().getBootstrapLibraries();
}
 
Example #5
Source File: ClassPathProviderImpl.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public ClassPathProviderImpl() {
    URL statelessAnnotationURL = Stateless.class.getProtectionDomain().getCodeSource().getLocation();
    this.compilePath = ClassPathSupport.createClassPath(new URL[] { FileUtil.getArchiveRoot(statelessAnnotationURL) });
    this.bootPath = JavaPlatformManager.getDefault().getDefaultPlatform().getBootstrapLibraries();
}
 
Example #6
Source File: SessionBeanRulesTest.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
private static DescribedPredicate<JavaFieldAccess> targetIsStatelessSessionBean() {
    return Get.<JavaFieldAccess, FieldAccessTarget>target()
            .then(HasOwner.Functions.Get.<JavaClass>owner())
            .is(annotatedWith(Stateless.class));
}
 
Example #7
Source File: SessionBeanRulesTest.java    From ArchUnit with Apache License 2.0 4 votes vote down vote up
private static DescribedPredicate<JavaFieldAccess> targetIsStatelessSessionBean() {
    return Get.<JavaFieldAccess, FieldAccessTarget>target()
            .then(HasOwner.Functions.Get.owner())
            .is(annotatedWith(Stateless.class));
}
 
Example #8
Source File: SessionBeanRulesTest.java    From ArchUnit-Examples with Apache License 2.0 4 votes vote down vote up
private static DescribedPredicate<JavaFieldAccess> targetIsStatelessSessionBean() {
    return Get.<JavaFieldAccess, FieldAccessTarget>target()
            .then(HasOwner.Functions.Get.<JavaClass>owner())
            .is(annotatedWith(Stateless.class));
}
 
Example #9
Source File: SessionBeanRulesTest.java    From ArchUnit-Examples with Apache License 2.0 4 votes vote down vote up
private static DescribedPredicate<JavaFieldAccess> targetIsStatelessSessionBean() {
    return Get.<JavaFieldAccess, FieldAccessTarget>target()
            .then(HasOwner.Functions.Get.owner())
            .is(annotatedWith(Stateless.class));
}
 
Example #10
Source File: BeanTestExtension.java    From BeanTest with Apache License 2.0 3 votes vote down vote up
/**
 * Replaces the meta data of the {@link ProcessAnnotatedType}.
 * 
 * <p>
 * The ProcessAnnotatedType's meta data will be replaced, if the annotated type has one of the following annotations:
 * <ul>
 * <li> {@link Stateless}
 * <li> {@link MessageDriven}
 * <li> {@link Interceptor}
 * <li> {@link Singleton}
 * </ul>
 *
 * @param <X> the type of the ProcessAnnotatedType
 * @param pat the annotated type representing the class being processed
 */
public <X> void processInjectionTarget(@Observes @WithAnnotations({Stateless.class, MessageDriven.class, Interceptor.class, Singleton.class}) ProcessAnnotatedType<X> pat) {
    if (pat.getAnnotatedType().isAnnotationPresent(Stateless.class) || pat.getAnnotatedType().isAnnotationPresent(MessageDriven.class)) {
        modifiyAnnotatedTypeMetadata(pat);
    } else if (pat.getAnnotatedType().isAnnotationPresent(Interceptor.class)) {
        processInterceptorDependencies(pat);
    } else if(pat.getAnnotatedType().isAnnotationPresent(Singleton.class)) {
        addApplicationScopedAndTransactionalToSingleton(pat);
    }
}