Package javax.security.jacc

Examples of javax.security.jacc.EJBMethodPermission$MethodSpec


        }

        try {
            Class clazz = Class.forName(interfaceClass, false, classLoader);
            for (java.lang.reflect.Method method : clazz.getMethods()) {
                permissions.add(new EJBMethodPermission(ejbName, methodInterface, method));
            }
        } catch (ClassNotFoundException e) {
            throw new DeploymentException(e);
        }
View Full Code Here


            timeout = ((SessionBean) remoteBean).getTimeoutMethod();
        } else if (remoteBean instanceof MessageDrivenBean) {
            timeout = ((MessageDrivenBean) remoteBean).getTimeoutMethod();
        }
        if (timeout != null) {
            permissions.add(new EJBMethodPermission(remoteBean.getEjbName(), timeout.getMethodName(), null, new String[]{Timer.class.getName()}));
        } else {
            try {
                Class ejbClass = ejbModule.getClassLoader().loadClass(remoteBean.getEjbClass());
                if (TimedObject.class.isAssignableFrom(ejbClass)) {
                    permissions.add(new EJBMethodPermission(remoteBean.getEjbName(), "ejbTimeout", null, new String[]{Timer.class.getName()}));
                }
            } catch (ClassNotFoundException e) {
                throw new DeploymentException("Could not figure out timer method", e);
            }
        }
View Full Code Here

            InterfaceType type = deploymentInfo.getInterfaceType(method.getDeclaringClass());

            String name = (type == null) ? null : type.getSpecName();

            Permission permission = new EJBMethodPermission(ejbName, name, method);

            AccessControlContext accessContext = ContextManager.getCurrentContext();

            if (permission != null) accessContext.checkPermission(permission);
View Full Code Here

public class JACCPreInsertEventListener implements PreInsertEventListener, Initializable, JACCSecurityListener {
  private String contextID;

  public boolean onPreInsert(PreInsertEvent event) {

    EJBMethodPermission insertPermission = new EJBMethodPermission(
        event.getPersister().getEntityName(),
        HibernatePermission.INSERT,
        null,
        null
    );
View Full Code Here

    StringTokenizer tok = new StringTokenizer( action, "," );

    while ( tok.hasMoreTokens() ) {
      String methodName = tok.nextToken().trim();
      EJBMethodPermission permission = new EJBMethodPermission(
          entityName,
          methodName,
          null, // interfaces
          null // arguments
        );
View Full Code Here

public class JACCPreUpdateEventListener implements PreUpdateEventListener, Initializable, JACCSecurityListener {
  private String contextID;

  public boolean onPreUpdate(PreUpdateEvent event) {

    EJBMethodPermission updatePermission = new EJBMethodPermission(
        event.getPersister().getEntityName(),
        HibernatePermission.UPDATE,
        null,
        null
    );
View Full Code Here

public class JACCPreLoadEventListener implements PreLoadEventListener, Initializable, JACCSecurityListener {
  private String contextID;

  public void onPreLoad(PreLoadEvent event) {

    EJBMethodPermission loadPermission = new EJBMethodPermission(
        event.getPersister().getEntityName(),
        HibernatePermission.READ,
        null,
        null
    );
View Full Code Here

public class JACCPreDeleteEventListener implements PreDeleteEventListener, Initializable, JACCSecurityListener {
  private String contextID;

  public boolean onPreDelete(PreDeleteEvent event) {

    EJBMethodPermission deletePermission = new EJBMethodPermission(
        event.getPersister().getEntityName(),
        HibernatePermission.DELETE,
        null,
        null
    );
View Full Code Here

        Permissions uncheckedPermissions = null;
        Permissions excludedPermissions = null;
        HashMap rolePermissionsTable = null;

        EJBMethodPermission ejbmp = null;

        // phase 1
        Map mpMap = eDescriptor.getMethodPermissionsFromDD();
        if (mpMap != null) {

            Iterator mpIt = mpMap.entrySet().iterator();

            while (mpIt.hasNext()) {

                Map.Entry entry = (Map.Entry)mpIt.next();
                MethodPermission mp = (MethodPermission) entry.getKey();

                Iterator mdIt = ((ArrayList) entry.getValue()).iterator();

                while (mdIt.hasNext()) {

                    MethodDescriptor md = (MethodDescriptor) mdIt.next();

                    String mthdName = md.getName();
                    String mthdIntf = md.getEjbClassSymbol();
                    String mthdParams[] = md.getStyle() == 3 ?
                            md.getParameterClassNames() : null;

                    ejbmp = new EJBMethodPermission(eName, mthdName.equals("*") ?
                            null : mthdName,
                            mthdIntf, mthdParams);
                    rolePermissionsTable =
                            addToRolePermissionsTable(rolePermissionsTable, mp, ejbmp);

                    uncheckedPermissions =
                            addToUncheckedPermissions(uncheckedPermissions, mp, ejbmp);

                    excludedPermissions =
                            addToExcludedPermissions(excludedPermissions, mp, ejbmp);
                }
            }
        }

        // phase 2 - configures additional perms:
        //      . to optimize performance of Permissions.implies
        //      . to cause any uncovered methods to be unchecked

        Iterator mdIt = eDescriptor.getMethodDescriptors().iterator();
        while (mdIt.hasNext()) {

            MethodDescriptor md = (MethodDescriptor) mdIt.next();
            Method mthd = md.getMethod(eDescriptor);
            String mthdIntf = md.getEjbClassSymbol();

            if (mthd == null) {
                continue;
            }

            if (mthdIntf == null || mthdIntf.equals("")) {
                _logger.log(Level.SEVERE, "method_descriptor_not_defined" , new Object[] {eName,
                        md.getName(), md.getParameterClassNames()});

                continue;
            }

            ejbmp = new EJBMethodPermission(eName, mthdIntf, mthd);

            Iterator mpIt = eDescriptor.getMethodPermissionsFor(md).iterator();

            while (mpIt.hasNext()) {

View Full Code Here

        CachedPermission cp = null;
        Permission ejbmp = null;

        if (inv.invocationInfo == null || inv.invocationInfo.cachedPermission == null) {
            ejbmp = new EJBMethodPermission(ejbName, inv.getMethodInterface(), inv.method);
            cp = new CachedPermissionImpl(uncheckedMethodPermissionCache, ejbmp);
            if (inv.invocationInfo != null) {
                inv.invocationInfo.cachedPermission = cp;
                if (_logger.isLoggable(Level.FINE)) {
                    _logger.fine("JACC: permission initialized in InvocationInfo: EJBMethodPermission (Name) = " + ejbmp.getName() + " (Action) = " + ejbmp.getActions());
View Full Code Here

TOP

Related Classes of javax.security.jacc.EJBMethodPermission$MethodSpec

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.