Java源码示例:javax.ejb.Stateless
示例1
@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);
}
示例2
protected void setUp() throws Exception {
super.setUp();
URL root = FileUtil.getArchiveRoot(Stateless.class.getProtectionDomain().getCodeSource().getLocation());
addCompileRoots(Collections.singletonList(root));
}
示例3
protected void setUp() throws Exception {
super.setUp();
URL root = FileUtil.getArchiveRoot(Stateless.class.getProtectionDomain().getCodeSource().getLocation());
addCompileRoots(Collections.singletonList(root));
}
示例4
public ClassPathProviderImpl() {
URL statelessAnnotationURL = Stateless.class.getProtectionDomain().getCodeSource().getLocation();
this.compilePath = ClassPathSupport.createClassPath(new URL[] { FileUtil.getArchiveRoot(statelessAnnotationURL) });
this.bootPath = JavaPlatformManager.getDefault().getDefaultPlatform().getBootstrapLibraries();
}
示例5
public ClassPathProviderImpl() {
URL statelessAnnotationURL = Stateless.class.getProtectionDomain().getCodeSource().getLocation();
this.compilePath = ClassPathSupport.createClassPath(new URL[] { FileUtil.getArchiveRoot(statelessAnnotationURL) });
this.bootPath = JavaPlatformManager.getDefault().getDefaultPlatform().getBootstrapLibraries();
}
示例6
private static DescribedPredicate<JavaFieldAccess> targetIsStatelessSessionBean() {
return Get.<JavaFieldAccess, FieldAccessTarget>target()
.then(HasOwner.Functions.Get.<JavaClass>owner())
.is(annotatedWith(Stateless.class));
}
示例7
private static DescribedPredicate<JavaFieldAccess> targetIsStatelessSessionBean() {
return Get.<JavaFieldAccess, FieldAccessTarget>target()
.then(HasOwner.Functions.Get.owner())
.is(annotatedWith(Stateless.class));
}
示例8
private static DescribedPredicate<JavaFieldAccess> targetIsStatelessSessionBean() {
return Get.<JavaFieldAccess, FieldAccessTarget>target()
.then(HasOwner.Functions.Get.<JavaClass>owner())
.is(annotatedWith(Stateless.class));
}
示例9
private static DescribedPredicate<JavaFieldAccess> targetIsStatelessSessionBean() {
return Get.<JavaFieldAccess, FieldAccessTarget>target()
.then(HasOwner.Functions.Get.owner())
.is(annotatedWith(Stateless.class));
}
示例10
/**
* 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);
}
}