Package javax.ejb

Examples of javax.ejb.EJBAccessException


        try {

            final boolean authorized = type == InterfaceType.TIMEOUT || getSecurityService().isCallerAuthorized(callMethod, type);

            if (!authorized) {
                throw new ApplicationException(new EJBAccessException("Unauthorized Access by Principal Denied"));
            }

            final Class declaringClass = callMethod.getDeclaringClass();
            final String methodName = callMethod.getName();
View Full Code Here


    private void checkAuthorization(final Method callMethod, final InterfaceType interfaceType) throws ApplicationException {

        final boolean authorized = securityService.isCallerAuthorized(callMethod, interfaceType);

        if (!authorized) {
            throw new ApplicationException(new EJBAccessException("Unauthorized Access by Principal Denied"));
        }
    }
View Full Code Here

        try {

            final boolean authorized = type == InterfaceType.TIMEOUT || getSecurityService().isCallerAuthorized(callMethod, type);

            if (!authorized) {
                throw new org.apache.openejb.ApplicationException(new EJBAccessException("Unauthorized Access by Principal Denied"));
            }

            final Class declaringClass = callMethod.getDeclaringClass();
            if (EJBHome.class.isAssignableFrom(declaringClass) || EJBLocalHome.class.isAssignableFrom(declaringClass)) {
                if (callMethod.getName().startsWith("create")) {
View Full Code Here

                             ejbCS,
                             sc.getUtil().getSubject(),
                             callerRunAs,
                             methodRoles);
            if(!isAuthorized)
               throw new EJBAccessException("Caller unauthorized");
        
         return invocation.invokeNext();
      }
      catch (SecurityException throwable)
      {
         log.debug("Authorization failure", throwable);
         throw new EJBAccessException("Authorization failure");
      } finally {
      }
   }
View Full Code Here

         return super.invoke(invocation);
      }
      catch (SecurityException throwable)
      {
         log.debug("Authorization failure", throwable);
         throw new EJBAccessException("Authorization failure");
      } finally {
      }
   }
View Full Code Here

         ProtectionDomain pd = new ProtectionDomain(ejbCS, null, null, principals);
         if (policy.implies(pd, methodPerm) == false)
         {
            String msg = "Denied: " + methodPerm + ", caller=" + caller;
            //SecurityException e = new SecurityException(msg);
            EJBAccessException e = new EJBAccessException(msg);
            throw e;
         }
      }
      catch (PolicyContextException e)
      {
View Full Code Here

   }

   protected void handleGeneralSecurityException(GeneralSecurityException gse)
   {
      log.debug("Authentication failure", gse);
      throw new EJBAccessException("Authentication failure");
   }
View Full Code Here

         if(!trustedCaller)
         {
            Subject subject = new Subject();
            //Authenticate the caller now
            if(!helper.isValid(subject, method.getName()))
               throw new EJBAccessException("Invalid User");
            helper.pushSubjectContext(subject);
         }
         else
        
            //Trusted caller. No need for authentication. Straight to authorization
View Full Code Here

            }
            else
            {
               //Authenticate the caller now
               if(!helper.isValid(subject, method.getName()))
                  throw new EJBAccessException("Invalid User");
            }
            helper.pushSubjectContext(subject);
         }
         else
        
View Full Code Here

    }

    private void checkAuthorization(final Method callMethod, final InterfaceType interfaceType) throws ApplicationException {
        final boolean authorized = securityService.isCallerAuthorized(callMethod, interfaceType);
        if (!authorized) {
            throw new ApplicationException(new EJBAccessException("Unauthorized Access by Principal Denied"));
        }
    }
View Full Code Here

TOP

Related Classes of javax.ejb.EJBAccessException

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.