Package javax.ejb

Examples of javax.ejb.EJBAccessException


               }
               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

            mappedException.initCause(t);
        } else if( t instanceof NoSuchObjectLocalException ) {
            mappedException = new NoSuchEJBException();
            mappedException.initCause(t);
        } else if( t instanceof AccessLocalException ) {
            mappedException = new EJBAccessException();
            mappedException.initCause(t);
        }
       
        return (mappedException != null) ? mappedException : t;
View Full Code Here

            mappedException.initCause(t);
        } else if( t instanceof NoSuchObjectLocalException ) {
            mappedException = new NoSuchEJBException();
            mappedException.initCause(t);
        } else if( t instanceof AccessLocalException ) {
            mappedException = new EJBAccessException();
            mappedException.initCause(t);
        }
       
        return (mappedException != null) ? mappedException : t;
View Full Code Here

            mappedException.initCause(t);
        } else if( t instanceof NoSuchObjectLocalException ) {
            mappedException = new NoSuchEJBException();
            mappedException.initCause(t);
        } else if( t instanceof AccessLocalException ) {
            mappedException = new EJBAccessException();
            mappedException.initCause(t);
        }
       
        return (mappedException != null) ? mappedException : t;
View Full Code Here

            @Override
            public Void run() {
                try {
                    securityManager.push(securityDomain, runAs, runAsPrincipal);
                } catch (SecurityException e) {
                    throw new EJBAccessException(e.getMessage());
                }
                return null;
            }
        };
        this.popAction = new PrivilegedAction<Void>() {
View Full Code Here

                    "method to be " + viewMethod + " on view class " + viewClassName);
        }
        final EJBComponent ejbComponent = (EJBComponent) component;
        // check @DenyAll/exclude-list
        if (ejbMethodSecurityMetaData.isAccessDenied()) {
            throw new EJBAccessException("Invocation on method: " + invokedMethod + " of bean: " + ejbComponent.getComponentName()
                    + " is not allowed");
        }
        // If @PermitAll isn't applicable for the method then check the allowed roles
        if (!ejbMethodSecurityMetaData.isPermitAll()) {
            // get allowed roles (if any) for this method invocation
            final Collection<String> allowedRoles = ejbMethodSecurityMetaData.getRolesAllowed();
            if (!allowedRoles.isEmpty()) {
                // call the security API to do authorization check
                final SimpleSecurityManager securityManager = ejbComponent.getSecurityManager();
                if (!securityManager.isCallerInRole(allowedRoles.toArray(new String[allowedRoles.size()]))) {
                    throw new EJBAccessException("Invocation on method: " + invokedMethod + " of bean: " +
                            ejbComponent.getComponentName() + " is not allowed");
                }
            }
        }
        // successful authorization, let the invocation proceed
View Full Code Here

            mappedException.initCause(t);
        } else if( t instanceof NoSuchObjectLocalException ) {
            mappedException = new NoSuchEJBException();
            mappedException.initCause(t);
        } else if( t instanceof AccessLocalException ) {
            mappedException = new EJBAccessException();
            mappedException.initCause(t);
        }
       
        return (mappedException != null) ? mappedException : t;
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

    }

    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.