Package javax.ejb

Examples of javax.ejb.EJBAccessException


        ThreadContext oldCallContext = ThreadContext.enter(callContext);
        try {

            boolean authorized = securityService.isCallerAuthorized(callMethod, type);
            if (!authorized) {
                throw new ApplicationException(new EJBAccessException("Unauthorized Access by Principal Denied"));
            }

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


        ThreadContext oldCallContext = ThreadContext.enter(callContext);
        Object bean = null;
        try {
            boolean authorized = type == InterfaceType.TIMEOUT || getSecurityService().isCallerAuthorized(callMethod, type);
            if (!authorized)
                throw new org.apache.openejb.ApplicationException(new EJBAccessException("Unauthorized Access by Principal Denied"));

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

        ThreadContext callContext = new ThreadContext(beanContext, primKey);
        ThreadContext oldCallContext = ThreadContext.enter(callContext);
        try {
            boolean authorized = type == InterfaceType.TIMEOUT || getSecurityService().isCallerAuthorized(callMethod, type);
            if (!authorized)
                throw new org.apache.openejb.ApplicationException(new EJBAccessException("Unauthorized Access by Principal Denied"));

            Class declaringClass = callMethod.getDeclaringClass();
            String methodName = callMethod.getName();

            if (EJBHome.class.isAssignableFrom(declaringClass) || EJBLocalHome.class.isAssignableFrom(declaringClass)) {
View Full Code Here

        ThreadContext callContext = new ThreadContext(beanContext, primKey);
        ThreadContext oldCallContext = ThreadContext.enter(callContext);
        try {
            boolean authorized = type == InterfaceType.TIMEOUT || getSecurityService().isCallerAuthorized(callMethod, type);
            if (!authorized)
                throw new org.apache.openejb.ApplicationException(new EJBAccessException("Unauthorized Access by Principal Denied"));

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

/*     */
/* 174 */         EJBAuthorizationHelper helper = new EJBAuthorizationHelper(sc);
/* 175 */         boolean isAuthorized = helper.authorize(this.ejbName, mi.getMethod(), sc.getUtil().getUserPrincipal(), iface, this.ejbCS, sc.getUtil().getSubject(), callerRunAs, methodRoles);
/*     */
/* 183 */         if (!isAuthorized)
/* 184 */           throw new EJBAccessException("Caller unauthorized");
/*     */       }
/* 186 */       sc = invocation.invokeNext();
/*     */     }
/*     */     catch (SecurityException throwable)
/*     */     {
/*     */       SecurityContext sc;
/* 190 */       log.debug("Authorization failure", throwable);
/* 191 */       throw new EJBAccessException("Authorization failure");
/*     */     }
/*     */     finally {
/*     */     }
/*     */   }
View Full Code Here

/*     */     }
/*     */     catch (SecurityException throwable)
/*     */     {
/*     */       Object localObject1;
/* 112 */       log.debug("Authorization failure", throwable);
/* 113 */       throw new EJBAccessException("Authorization failure");
/*     */     }
/*     */     finally
/*     */     {
/*     */     }
/*     */   }
View Full Code Here

/* 351 */       ProtectionDomain pd = new ProtectionDomain(ejbCS, null, null, principals);
/* 352 */       if (!policy.implies(pd, methodPerm))
/*     */       {
/* 354 */         String msg = "Denied: " + methodPerm + ", caller=" + caller;
/*     */
/* 356 */         EJBAccessException e = new EJBAccessException(msg);
/* 357 */         throw e;
/*     */       }
/*     */     }
/*     */     catch (PolicyContextException e)
/*     */     {
View Full Code Here

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

/* 137 */       if (!trustedCaller)
/*     */       {
/* 139 */         Subject subject = new Subject();
/*     */
/* 141 */         if (!helper.isValid(subject, method.getName()))
/* 142 */           throw new EJBAccessException("Invalid User");
/* 143 */         helper.pushSubjectContext(subject);
/*     */       }
/*     */
/*     */     }
/* 157 */     else if (invSC != null)
View Full Code Here

    }

    private void checkAuthorization(Method callMethod, InterfaceType interfaceType) throws ApplicationException {
        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.