1 23 package com.sun.enterprise.deployment.annotation.factory; 24 25 import java.util.HashSet ; 26 import java.util.Set ; 27 28 import com.sun.enterprise.deployment.annotation.AnnotationHandler; 29 import com.sun.enterprise.deployment.annotation.AnnotationProcessor; 30 import com.sun.enterprise.deployment.annotation.handlers.*; 31 import com.sun.enterprise.deployment.annotation.impl.AnnotationProcessorImpl; 32 33 39 public class SJSASFactory extends Factory { 40 private static Set <String > annotationClassNames = new HashSet <String >(); 41 42 private SJSASFactory() { 43 } 44 45 public static AnnotationProcessor getAnnotationProcessor() { 46 init(); 47 return Factory.getAnnotationProcessor(); 48 } 49 50 public static Set <String > getAnnotations() { 51 init(); 52 return (HashSet )((HashSet )annotationClassNames).clone(); 53 } 54 55 private static void init() { 56 if (systemProcessor == null) { 57 synchronized(Factory.class) { 58 if (systemProcessor == null) { 59 systemProcessor = new AnnotationProcessorImpl(); 61 for (AnnotationHandler anHandler : getSystemAnnotationHandlers()) { 62 systemProcessor.pushAnnotationHandler(anHandler); 63 annotationClassNames.add("L" + 64 anHandler.getAnnotationType().getName(). 65 replace('.', '/') + ";"); 66 } 67 } 68 } 69 } 70 71 } 72 73 private static AnnotationHandler[] getSystemAnnotationHandlers() { 74 return new AnnotationHandler[] { 75 new DenyAllHandler(), 76 new ApplicationExceptionHandler(), 77 new AroundInvokeHandler(), 78 new DeclareRolesHandler(), 79 new EntityManagerFactoryReferenceHandler(), 80 new EntityManagerFactoryReferencesHandler(), 81 new EntityManagerReferenceHandler(), 82 new EntityManagerReferencesHandler(), 83 new ExcludeClassInterceptorsHandler(), 84 new ExcludeDefaultInterceptorsHandler(), 85 new EJBHandler(), 86 new EJBsHandler(), 87 new HandlerChainHandler(), 88 new InitHandler(), 89 new InterceptorsHandler(), 90 new MessageDrivenHandler(), 91 new PermitAllHandler(), 92 new PostActivateHandler(), 93 new PostConstructHandler(), 94 new PreDestroyHandler(), 95 new PrePassivateHandler(), 96 new ResourceHandler(), 97 new RolesAllowedHandler(), 98 new ResourcesHandler(), 99 new RemoveHandler(), 100 new RunAsHandler(), 101 new StatefulHandler(), 102 new StatelessHandler(), 103 new TimeoutHandler(), 104 new TransactionAttributeHandler(), 105 new TransactionManagementHandler(), 106 new WebServiceHandler(), 107 new WebServiceProviderHandler(), 108 new WebServiceRefHandler(), 109 new WebServiceRefsHandler() 110 }; 111 } 112 } 113 | Popular Tags |