@Override
  public AnnotationProcessor configure(final AtmosphereFramework framework) {
    ServletContext sc = framework.getServletContext();

    Map<Class<? extends Annotation>, Set<Class<?>>> annotations =
        (Map<Class<? extends Annotation>, Set<Class<?>>>) sc.getAttribute(ANNOTATION_ATTRIBUTE);

    if (annotations == null || annotations.isEmpty()) {
      delegate = new BytecodeBasedAnnotationProcessor();
    } else {
      delegate = new ServletContainerInitializerAnnotationProcessor(annotations, framework);
    }
    delegate.configure(framework);
    return this;
  }
Пример #2
0
 /**
  * Creates an instance of ExecutorHandler.
  *
  * @param handlerClass handler class
  */
 public ExecutorHandler(Class<?> handlerClass) {
   this(
       AnnotationProcessor.getHandlerMetadata(handlerClass),
       handlerClass,
       AnnotationProcessor.getHandlerMethod(handlerClass));
 }
Пример #3
0
 public synchronized EngineConfig deregisterAnnotationProcessor(
     AnnotationProcessor<?> annotationProcessor) {
   annotationProcessors.remove(annotationProcessor.getType());
   return this;
 }
Пример #4
0
 public synchronized EngineConfig registerAnnotationProcessor(
     AnnotationProcessor<?> annotationProcessor) {
   annotationProcessors.put(annotationProcessor.getType(), annotationProcessor);
   return this;
 }
 @Override
 public void destroy() {
   if (delegate != null) {
     delegate.destroy();
   }
 }
 @Override
 public AnnotationProcessor scan(final String packageName) throws IOException {
   delegate.scan(packageName);
   return this;
 }
 @Override
 public AnnotationProcessor scan(final File rootDir) throws IOException {
   delegate.scan(rootDir);
   return this;
 }