Package javax.annotation

Examples of javax.annotation.PreDestroy


                postConstructMethodsByService.put(service, method);
            }
           
            // @PreDestroy
            for (final Method method : methods) {
                final PreDestroy preDestroyAnnotation = method.getAnnotation(PreDestroy.class);
                if(preDestroyAnnotation == null) {
                    continue;
                }
                final Method existing = preDestroyMethodsByService.get(service);
                if(existing != null) {
View Full Code Here


        }
    }

    public void invokePreDestroy(Object instance) {
        for (Method method : getMethods(instance.getClass(), PreDestroy.class)) {
            PreDestroy pc = method.getAnnotation(PreDestroy.class);
            if (pc != null) {
                boolean accessible = method.isAccessible();
                try {
                    method.setAccessible(true);
                    method.invoke(instance);
View Full Code Here

               {
                  prePassivates = new HashMap<String, PrePassivate>();
               }
               prePassivates.put(methodName, prePassivate);
            }
            PreDestroy preDestroy = getLifeCycleAnnotation(((JBossSessionBeanMetaData) beanMetaData).getPreDestroys(), PreDestroyImpl.class, methodName);
            if(preDestroy != null)
            {
               if (preDestroys == null)
               {
                  preDestroys = new HashMap<String, PreDestroy>();
View Full Code Here

    public void invokePreDestroy() {
       
        boolean accessible = false;
        for (Method method : getPreDestroyMethods()) {
            PreDestroy pd = method.getAnnotation(PreDestroy.class);
            if (pd != null) {
                try {
                    method.setAccessible(true);
                    method.invoke(target);
                } catch (IllegalAccessException e) {
View Full Code Here

    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            ResourceContainerContext[] rcContexts)
            throws AnnotationProcessorException {

        AnnotatedElementHandler aeHandler = ainfo.getProcessingContext().getHandler();
        PreDestroy preDestroyAn =
                (PreDestroy)ainfo.getAnnotation();
        Method annMethod = (Method)ainfo.getAnnotatedElement();
        String pdMethodName = annMethod.getName();
        String pdClassName = annMethod.getDeclaringClass().getName();
View Full Code Here

         return resolveLifecycleMethod(method, ann);
      }

      Method resolvePreDestroy(Method method)
      {
         PreDestroy ann = (PreDestroy) getAnnotation(method, PreDestroy.class);
         return resolveLifecycleMethod(method, ann);
      }
View Full Code Here

         if(lifeCycleAnnotation != null)
            return annotationClass.cast(lifeCycleAnnotation);
      }
      else if(annotationClass == PreDestroy.class)
      {
         PreDestroy lifeCycleAnnotation = getLifeCycleAnnotation(metaData.getPreDestroys(), PreDestroyImpl.class, method);
         if(lifeCycleAnnotation != null)
            return annotationClass.cast(lifeCycleAnnotation);
      }
      return null;
   }
View Full Code Here

        {
            boolean foundInClass = false;
            Method[] methods = c.getDeclaredMethods();
            for (Method method : methods)
            {
                PreDestroy preDestroy = method.getAnnotation(PreDestroy.class);
                if (preDestroy != null)
                {
                    if (foundInClass)
                        throw new RuntimeException("Invalid @PreDestroy method " + method + ": another method with the same annotation exists");
                    foundInClass = true;
View Full Code Here

    public void invokePreDestroy() {
       
        boolean accessible = false;
        for (Method method : getPreDestroyMethods()) {
            PreDestroy pd = method.getAnnotation(PreDestroy.class);
            if (pd != null) {
                try {
                    method.setAccessible(true);
                    method.invoke(target);
                } catch (IllegalAccessException e) {
View Full Code Here

               {
                  prePassivates = new HashMap<DeclaredMethodSignature, PrePassivate>();
               }
               prePassivates.put(method, prePassivate);
            }
            PreDestroy preDestroy = getLifeCycleAnnotation(((JBossSessionBeanMetaData) beanMetaData).getPreDestroys(), PreDestroyImpl.class, method);
            if(preDestroy != null)
            {
               if (preDestroys == null)
               {
                  preDestroys = new HashMap<DeclaredMethodSignature, PreDestroy>();
View Full Code Here

TOP

Related Classes of javax.annotation.PreDestroy

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.