org.mobicents.servlet.sip.annotations
Class ClassFileScanner

java.lang.Object
  extended by org.mobicents.servlet.sip.annotations.ClassFileScanner

public class ClassFileScanner
extends java.lang.Object

This class implement the logic to enumerate all class files in WEB-INF/classes and extract descriptor information. I am using this method because if I look directly in a classloader it would have loaded all libs includeing third party libs in WEB-INF/jar, and system libs. Parsing all these would be slow, so for now we will only look in WEB-INF/classes since it works. General TODO: Validation

Author:
Vladimir Ralev

Constructor Summary
ClassFileScanner(java.lang.String docbase, SipContext ctx)
           
 
Method Summary
protected  void _scan(java.io.File folder)
           
protected  void analyzeClass(java.lang.String path)
           
protected  SipApplication getApplicationAnnotation(java.lang.Package pack)
           
 boolean isApplicationParsed()
          Shows if there is SipApplication annotation parsed and thur we dont need to look at sip.xml to seearch descriptor info.
protected  void parseSipApplication(SipApplication appData, java.lang.String packageName)
           
protected  void processAnnotations(java.lang.Class clazz)
           
protected  void processConcurrencyAnnotation(java.lang.Class clazz)
          Check if the @ConcurrencyControl annotation is present in the package and if so process it
protected  void processListenerAnnotation(java.lang.Class<?> clazz)
           
protected  void processServletAnnotation(java.lang.Class<?> clazz)
           
protected  void processSipApplicationKeyAnnotation(java.lang.Class<?> clazz)
           
 void scan()
          Scan the application for annotations with the contextconfig classloader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassFileScanner

public ClassFileScanner(java.lang.String docbase,
                        SipContext ctx)
Method Detail

scan

public void scan()
          throws AnnotationVerificationException
Scan the application for annotations with the contextconfig classloader. It scans in the following locations : WEB-INF/classes WEB-INF/lib ../APP-INF/lib ../APP-INF/classes

Throws:
AnnotationVerificationException - thrown if some annotations doesn't follow the restrictions given by the annotation contract

_scan

protected void _scan(java.io.File folder)
              throws AnnotationVerificationException
Throws:
AnnotationVerificationException

analyzeClass

protected void analyzeClass(java.lang.String path)
                     throws AnnotationVerificationException
Throws:
AnnotationVerificationException

processAnnotations

protected void processAnnotations(java.lang.Class clazz)
                           throws AnnotationVerificationException
Throws:
AnnotationVerificationException

processListenerAnnotation

protected void processListenerAnnotation(java.lang.Class<?> clazz)

processSipApplicationKeyAnnotation

protected void processSipApplicationKeyAnnotation(java.lang.Class<?> clazz)
                                           throws AnnotationVerificationException
Throws:
AnnotationVerificationException

processServletAnnotation

protected void processServletAnnotation(java.lang.Class<?> clazz)

parseSipApplication

protected void parseSipApplication(SipApplication appData,
                                   java.lang.String packageName)

getApplicationAnnotation

protected SipApplication getApplicationAnnotation(java.lang.Package pack)

processConcurrencyAnnotation

protected void processConcurrencyAnnotation(java.lang.Class clazz)
Check if the @ConcurrencyControl annotation is present in the package and if so process it

Parameters:
clazz - the clazz to check for @ConcurrencyControl annotation - only its package will be checked

isApplicationParsed

public boolean isApplicationParsed()
Shows if there is SipApplication annotation parsed and thur we dont need to look at sip.xml to seearch descriptor info.

Returns:


Copyright © 2010. All Rights Reserved.