Package org.jboss.metadata.javaee.spec

Examples of org.jboss.metadata.javaee.spec.LifecycleCallbackMetaData


  
   @Test
   public void testMetadataComplete() throws Exception
   {
      // Setup meta data
      LifecycleCallbackMetaData postConstruct = new LifecycleCallbackMetaData();
      postConstruct.setMethodName("otherPostConstruct");
     
      LifecycleCallbacksMetaData postConstructs = new LifecycleCallbacksMetaData();
      postConstructs.add(postConstruct);
     
      JBossEnvironmentRefsGroupMetaData env = new JBossEnvironmentRefsGroupMetaData();
View Full Code Here


   {
      if(callbacks == null || callbacks.isEmpty())
         return null;
     
      assert callbacks.size() == 1;
      LifecycleCallbackMetaData callback = callbacks.get(0);
      if(isEmpty(callback.getClassName()) || callback.getClassName().equals(method.getDeclaringClass()))
      {
         String callbackMethodName = callback.getMethodName();
         if(method.getName().equals(callbackMethodName))
            return createAnnotationImpl(annotationImplType);
      }
      return null;
   }
View Full Code Here

/*    */   {
/* 57 */     PostActivate annotation = (PostActivate)this.finder.getAnnotation(element, PostActivate.class);
/* 58 */     if (annotation == null) {
/* 59 */       return;
/*    */     }
/* 61 */     LifecycleCallbackMetaData callback = super.create(element);
/* 62 */     LifecycleCallbacksMetaData preDestroys = metaData.getPostActivates();
/* 63 */     if (preDestroys == null)
/*    */     {
/* 65 */       preDestroys = new LifecycleCallbacksMetaData();
/* 66 */       metaData.setPostActivates(preDestroys);
View Full Code Here

/*    */   {
/* 57 */     PrePassivate annotation = (PrePassivate)this.finder.getAnnotation(element, PrePassivate.class);
/* 58 */     if (annotation == null) {
/* 59 */       return;
/*    */     }
/* 61 */     LifecycleCallbackMetaData callback = super.create(element);
/* 62 */     LifecycleCallbacksMetaData preDestroys = metaData.getPrePassivates();
/* 63 */     if (preDestroys == null)
/*    */     {
/* 65 */       preDestroys = new LifecycleCallbacksMetaData();
/* 66 */       metaData.setPrePassivates(preDestroys);
View Full Code Here

/* 42 */     super(finder);
/*    */   }
/*    */
/*    */   public LifecycleCallbackMetaData create(Method element)
/*    */   {
/* 47 */     LifecycleCallbackMetaData metaData = new LifecycleCallbackMetaData();
/* 48 */     metaData.setClassName(element.getDeclaringClass().getName());
/* 49 */     metaData.setMethodName(element.getName());
/* 50 */     return metaData;
/*    */   }
View Full Code Here

/*    */   {
/* 55 */     PostConstruct annotation = (PostConstruct)this.finder.getAnnotation(element, PostConstruct.class);
/* 56 */     if (annotation == null) {
/* 57 */       return;
/*    */     }
/* 59 */     LifecycleCallbackMetaData callback = super.create(element);
/* 60 */     LifecycleCallbacksMetaData postConstructs = metaData.getPostConstructs();
/* 61 */     if (postConstructs == null)
/*    */     {
/* 63 */       postConstructs = new LifecycleCallbacksMetaData();
/* 64 */       metaData.setPostConstructs(postConstructs);
View Full Code Here

/*  849 */       if (lifecycleCallbacks == null)
/*  850 */         return null;
/*  851 */       if (lifecycleCallbacks.size() != 1) {
/*  852 */         throw new RuntimeException("NYI");
/*      */       }
/*  854 */       LifecycleCallbackMetaData lifecycleCallback = (LifecycleCallbackMetaData)lifecycleCallbacks.get(0);
/*  855 */       return findInterceptorMethodFromXml(lookingFor, lifecycleCallback.getClassName(), lifecycleCallback.getMethodName());
/*      */     }
View Full Code Here

/*    */   {
/* 55 */     PreDestroy annotation = (PreDestroy)this.finder.getAnnotation(element, PreDestroy.class);
/* 56 */     if (annotation == null) {
/* 57 */       return;
/*    */     }
/* 59 */     LifecycleCallbackMetaData callback = super.create(element);
/* 60 */     LifecycleCallbacksMetaData preDestroys = metaData.getPreDestroys();
/* 61 */     if (preDestroys == null)
/*    */     {
/* 63 */       preDestroys = new LifecycleCallbacksMetaData();
/* 64 */       metaData.setPreDestroys(preDestroys);
View Full Code Here

* @author Remy Maucherat
*/
public class LifecycleCallbackMetaDataParser extends MetaDataElementParser {

    public static LifecycleCallbackMetaData parse(XMLStreamReader reader) throws XMLStreamException {
        LifecycleCallbackMetaData callback = new LifecycleCallbackMetaData();
        // Handle elements
        while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
            final Element element = Element.forName(reader.getLocalName());
            switch (element) {
                case LIFECYCLE_CALLBACK_CLASS:
                    callback.setClassName(reader.getElementText());
                    break;
                case LIFECYCLE_CALLBACK_METHOD:
                    callback.setMethodName(reader.getElementText());
                    break;
                default: throw unexpectedElement(reader);
            }
        }
        return callback;
View Full Code Here

TOP

Related Classes of org.jboss.metadata.javaee.spec.LifecycleCallbackMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.