Package org.jboss.ejb3.annotation.impl

Examples of org.jboss.ejb3.annotation.impl.ApplicationExceptionImpl


   }

   private static String getLocalJndiName(JBossEnterpriseBeanMetaData ejb, Class<?> ejbClass)
   {
      // See if local binding is explicitly-defined
      LocalBinding localBinding = ejbClass.getAnnotation(LocalBinding.class);

      // If none specified
      if (localBinding == null || (localBinding.jndiBinding() != null && localBinding.jndiBinding().trim().length() == 0))
      {
         String name = ejb.getLocalJndiName();
         return name;
      }
      // Local Binding was explicitly-specified, use it
      else
      {
         return localBinding.jndiBinding();
      }
   }
View Full Code Here


      final Iterator<WebServiceDeclaration> ejbContainers = wsDeployment.getServiceEndpoints().iterator();

      while (ejbContainers.hasNext())
      {
         final WebServiceDeclaration ejbContainer = ejbContainers.next();
         final SecurityDomain nextSecurityDomain = ejbContainer.getAnnotation(SecurityDomain.class);

         securityDomain = this.getDomain(securityDomain, nextSecurityDomain);
      }

      return super.appendJaasPrefix(securityDomain);
View Full Code Here

   public <T> T getSecurityManager(Class<T> type)
   {
      try
      {
         InitialContext ctx = getInitialContext();
         SecurityDomain securityAnnotation = (SecurityDomain) resolveAnnotation(SecurityDomain.class);
         if (securityAnnotation != null && securityAnnotation.value().length() > 0)
         {
            return (T) SecurityDomainManager.getSecurityManager(securityAnnotation.value(),ctx);
         }
         return null;
      }
      catch (NamingException e)
      {
View Full Code Here

   {
      ApplicationExceptionEffigy appEx = effigy.getApplicationException(exceptionType);
      if(appEx != null)
      {
         if(appEx.isInherited() || appEx.getExceptionClass().equals(exceptionType))
            return new ApplicationExceptionImpl(appEx.isRollback());
         else
            return null;
      }
     
      Class[] exceptionTypes = invokedMethod.getExceptionTypes();
      for (Class exceptionClass : exceptionTypes)
      {
         if (exceptionClass.isAssignableFrom(exceptionType.getClass()))
            return new ApplicationExceptionImpl(false);
      }

      return null;
   }
View Full Code Here

   {
      ApplicationExceptionEffigy appEx = effigy.getApplicationException(exceptionType);
      if(appEx != null)
      {
         if(appEx.isInherited() || appEx.getExceptionClass().equals(exceptionType))
            return new ApplicationExceptionImpl(appEx.isRollback());
         else
            return null;
      }

      // Everything after this line is a hack.

      // TODO: we have no facility that picks up annotations from shared libs, so lets do some emergency annotation scanning.
      ApplicationException annotation = exceptionType.getAnnotation(ApplicationException.class);
      if(annotation != null)
         return annotation;
     
      // This feels like a hack around shortcomings in jboss-metadata
      Class[] exceptionTypes = invokedMethod.getExceptionTypes();
      for (Class exceptionClass : exceptionTypes)
      {
         // An unchecked-exception is only an application exception if annotated (or described) as such.
         // (see EJB 3.1 FR 14.2.1)
         if (RuntimeException.class.isAssignableFrom(exceptionType))
            continue;
         if (exceptionClass.isAssignableFrom(exceptionType))
            return new ApplicationExceptionImpl(false);
      }

      return null;
   }
View Full Code Here

   {
      ApplicationExceptionEffigy appEx = effigy.getApplicationException(exceptionType);
      if(appEx != null)
      {
         if(appEx.isInherited() || appEx.getExceptionClass().equals(exceptionType))
            return new ApplicationExceptionImpl(appEx.isRollback());
         else
            return null;
      }

      // Everything after this line is a hack.

      // TODO: we have no facility that picks up annotations from shared libs, so lets do some emergency annotation scanning.
      ApplicationException annotation = exceptionType.getAnnotation(ApplicationException.class);
      if(annotation != null)
         return annotation;
     
      // An unchecked-exception is only an application exception if annotated (or described) as such.
      // (see EJB 3.1 FR 14.2.1)
      if (RuntimeException.class.isAssignableFrom(exceptionType) || Error.class.isAssignableFrom(exceptionType))
         return null;
     
      // This feels like a hack around shortcomings in jboss-metadata
      Class[] exceptionTypes = invokedMethod.getExceptionTypes();
      for (Class exceptionClass : exceptionTypes)
      {
         if (exceptionClass.isAssignableFrom(exceptionType))
            return new ApplicationExceptionImpl(false);
      }

      return null;
   }
View Full Code Here

   {
      ApplicationExceptionEffigy appEx = effigy.getApplicationException(exceptionType);
      if(appEx != null)
      {
         if(appEx.isInherited() || appEx.getExceptionClass().equals(exceptionType))
            return new ApplicationExceptionImpl(appEx.isRollback());
         else
            return null;
      }

      // Everything after this line is a hack.

      // TODO: we have no facility that picks up annotations from shared libs, so lets do some emergency annotation scanning.
      ApplicationException annotation = exceptionType.getAnnotation(ApplicationException.class);
      if(annotation != null)
         return annotation;
     
      // An unchecked-exception is only an application exception if annotated (or described) as such.
      // (see EJB 3.1 FR 14.2.1)
      if (RuntimeException.class.isAssignableFrom(exceptionType) || Error.class.isAssignableFrom(exceptionType))
         return null;
     
      // This feels like a hack around shortcomings in jboss-metadata
      Class[] exceptionTypes = invokedMethod.getExceptionTypes();
      for (Class exceptionClass : exceptionTypes)
      {
         if (exceptionClass.isAssignableFrom(exceptionType))
            return new ApplicationExceptionImpl(false);
      }

      return null;
   }
View Full Code Here

   {
      ApplicationExceptionEffigy appEx = effigy.getApplicationException(exceptionType);
      if(appEx != null)
      {
         if(appEx.isInherited() || appEx.getExceptionClass().equals(exceptionType))
            return new ApplicationExceptionImpl(appEx.isRollback());
         else
            return null;
      }

      // Everything after this line is a hack.

      // TODO: we have no facility that picks up annotations from shared libs, so lets do some emergency annotation scanning.
      ApplicationException annotation = exceptionType.getAnnotation(ApplicationException.class);
      if(annotation != null)
         return annotation;
     
      // An unchecked-exception is only an application exception if annotated (or described) as such.
      // (see EJB 3.1 FR 14.2.1)
      if (RuntimeException.class.isAssignableFrom(exceptionType) || Error.class.isAssignableFrom(exceptionType))
         return null;
     
      // This feels like a hack around shortcomings in jboss-metadata
      Class[] exceptionTypes = invokedMethod.getExceptionTypes();
      for (Class exceptionClass : exceptionTypes)
      {
         if (exceptionClass.isAssignableFrom(exceptionType))
            return new ApplicationExceptionImpl(false);
      }

      return null;
   }
View Full Code Here

   {
      ApplicationExceptionEffigy appEx = effigy.getApplicationException(exceptionType);
      if(appEx != null)
      {
         if(appEx.isInherited() || appEx.getExceptionClass().equals(exceptionType))
            return new ApplicationExceptionImpl(appEx.isRollback());
         else
            return null;
      }

      // Everything after this line is a hack.

      // TODO: we have no facility that picks up annotations from shared libs, so lets do some emergency annotation scanning.
      ApplicationException annotation = exceptionType.getAnnotation(ApplicationException.class);
      if(annotation != null)
         return annotation;
     
      // An unchecked-exception is only an application exception if annotated (or described) as such.
      // (see EJB 3.1 FR 14.2.1)
      if (RuntimeException.class.isAssignableFrom(exceptionType) || Error.class.isAssignableFrom(exceptionType))
         return null;
     
      // This feels like a hack around shortcomings in jboss-metadata
      Class[] exceptionTypes = invokedMethod.getExceptionTypes();
      for (Class exceptionClass : exceptionTypes)
      {
         if (exceptionClass.isAssignableFrom(exceptionType))
            return new ApplicationExceptionImpl(false);
      }

      return null;
   }
View Full Code Here

   public <A extends Annotation> A retrieveAnnotation(Class<A> annotationClass, ApplicationExceptionMetaData metaData,
         ClassLoader classLoader)
   {
      if(annotationClass == ApplicationException.class && metaData != null)
      {
         return annotationClass.cast(new ApplicationExceptionImpl(metaData.isRollback()));
      }
      return null;
   }
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.annotation.impl.ApplicationExceptionImpl

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.