if(wildCardExcludeList != null && wildCardExcludeList.getMethods() != null) { handleExcludeMethods(componentDescription, wildCardExcludeList); if (excludeList != null && excludeList.getMethods() != null) { handleExcludeMethods(componentDescription, excludeList);
public void process(ExcludeListMetaData metaData, Method method) { DenyAll deny = finder.getAnnotation(method, DenyAll.class); if(deny == null) return; MethodsMetaData methods = metaData.getMethods(); if(methods == null) { methods = new MethodsMetaData(); metaData.setMethods(methods); } String ejbName = EjbNameThreadLocal.ejbName.get(); if(ejbName == null) ejbName = "*"; MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method); Descriptions descriptions = ProcessorUtils.getDescription("@DenyAll for: "+method); mmd.setDescriptions(descriptions); log.trace("add " + mmd); methods.add(mmd); }
excludeList = new ExcludeListMetaData(); excludeList.merge(override != null ? override.excludeList : null, original != null ? original.excludeList : null);
/** * Get the exclude list for an ejb * * @param ejbName the ejb name * @return the exclude list or null for no result * @throws IllegalArgumentException for a null ejb name */ public ExcludeListMetaData getExcludeListByEjbName(String ejbName) { if (ejbName == null) throw new IllegalArgumentException("Null ejbName"); if (methods == null) return null; MethodsMetaData ejbMethods = methods.getMethodsByEjbName(ejbName); if (ejbMethods == null) return null; ExcludeListMetaData result = clone(); result.setMethods(ejbMethods); return result; }
/** * Get the exclude list for an ejb * * @param ejbName the ejb name * @return the exclude list or null for no result * @throws IllegalArgumentException for a null ejb name */ public ExcludeListMetaData getExcludeListByEjbName(String ejbName) { if (ejbName == null) throw new IllegalArgumentException("Null ejbName"); if (excludeList == null) return null; return excludeList.getExcludeListByEjbName(ejbName); }
/** * Check to see if there was a method-permission or exclude-list statement * for the given method. * * @param methodName - the method name * @param params - the method parameter signature * @param interfaceType - the method interface type * @return true if a matching method permission exists, false if no match */ public boolean hasMethodPermissions(String methodName, Class<?>[] params, MethodInterfaceType interfaceType) { // First check the excluded method list as this takes priority over // all other assignments ExcludeListMetaData excluded = getExcludeList(); if (excluded != null && excluded.matches(methodName, params, interfaceType)) return true; // Check the permissioned methods list MethodPermissionsMetaData permissions = getMethodPermissions(); if (permissions != null) { for (MethodPermissionMetaData permission : permissions) { if (permission.matches(methodName, params, interfaceType)) return true; } } // No match return false; }
if(excludes == null) excludes = new ExcludeListMetaData(); assembly.setExcludeList(excludes);
public void process(ExcludeListMetaData metaData, Method method) { DenyAll deny = finder.getAnnotation(method, DenyAll.class); if(deny == null) return; MethodsMetaData methods = metaData.getMethods(); if(methods == null) { methods = new MethodsMetaData(); metaData.setMethods(methods); } String ejbName = EjbNameThreadLocal.ejbName.get(); if(ejbName == null) ejbName = "*"; MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method); Descriptions descriptions = ProcessorUtils.getDescription("@DenyAll for: "+method); mmd.setDescriptions(descriptions); log.trace("add " + mmd); methods.add(mmd); }
excludeList = new ExcludeListMetaData(); excludeList.merge(override != null ? override.excludeList : null, original != null ? original.excludeList : null);
/** * Get the exclude list for an ejb * * @param ejbName the ejb name * @return the exclude list or null for no result * @throws IllegalArgumentException for a null ejb name */ public ExcludeListMetaData getExcludeListByEjbName(String ejbName) { if (ejbName == null) throw new IllegalArgumentException("Null ejbName"); if (methods == null) return null; MethodsMetaData ejbMethods = methods.getMethodsByEjbName(ejbName); if (ejbMethods == null) return null; ExcludeListMetaData result = clone(); result.setMethods(ejbMethods); return result; }
/** * Get the exclude list for an ejb * * @param ejbName the ejb name * @return the exclude list or null for no result * @throws IllegalArgumentException for a null ejb name */ public ExcludeListMetaData getExcludeListByEjbName(String ejbName) { if (ejbName == null) throw new IllegalArgumentException("Null ejbName"); if (excludeList == null) return null; return excludeList.getExcludeListByEjbName(ejbName); }
if (excluded != null && excluded.matches(methodName, params, interfaceType))
if(excludes == null) excludes = new ExcludeListMetaData(); assembly.setExcludeList(excludes);
private void handleExcludeMethods(final EJBComponentDescription componentDescription, final ExcludeListMetaData excludeList) { for (final MethodMetaData method : excludeList.getMethods()) { final String methodName = method.getMethodName(); final MethodIntf defaultMethodIntf = (componentDescription instanceof MessageDrivenComponentDescription) ? MethodIntf.MESSAGE_ENDPOINT : MethodIntf.BEAN; final MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf(), defaultMethodIntf); if (methodName.equals("*")) { componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, null, EJBMethodSecurityAttribute.denyAll()); } else { final MethodParametersMetaData methodParams = method.getMethodParams(); // update the session bean description with the tx attribute info if (methodParams == null) { componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), methodName); } else { componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), null, methodName, this.getMethodParams(methodParams)); } } } }
public void process(ExcludeListMetaData metaData, Method method) { DenyAll deny = finder.getAnnotation(method, DenyAll.class); if(deny == null) return; MethodsMetaData methods = metaData.getMethods(); if(methods == null) { methods = new MethodsMetaData(); metaData.setMethods(methods); } String ejbName = EjbNameThreadLocal.ejbName.get(); if(ejbName == null) ejbName = "*"; MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method); Descriptions descriptions = ProcessorUtils.getDescription("@DenyAll for: "+method); mmd.setDescriptions(descriptions); log.trace("add " + mmd); methods.add(mmd); }
excludeList = new ExcludeListMetaData(); excludeList.merge(overrideExclude, originalExclude);
/** * Get the exclude list for an ejb * * @param ejbName the ejb name * @return the exclude list or null for no result * @throws IllegalArgumentException for a null ejb name */ public ExcludeListMetaData getExcludeListByEjbName(String ejbName) { if (ejbName == null) throw new IllegalArgumentException("Null ejbName"); if (excludeList == null) return null; return excludeList.getExcludeListByEjbName(ejbName); }
/** * Check to see if there was a method-permission or exclude-list statement * for the given method. * * @param methodName - the method name * @param params - the method parameter signature * @param interfaceType - the method interface type * @return true if a matching method permission exists, false if no match */ public boolean hasMethodPermissions(String methodName, Class<?>[] params, MethodInterfaceType interfaceType) { // First check the excluded method list as this takes priority over // all other assignments ExcludeListMetaData excluded = getExcludeList(); if (excluded != null && excluded.matches(methodName, params, interfaceType)) return true; // Check the permissioned methods list MethodPermissionsMetaData permissions = getMethodPermissions(); if (permissions != null) { for (MethodPermissionMetaData permission : permissions) { if (permission.matches(methodName, params, interfaceType)) return true; } } // No match return false; }
if(excludes == null) excludes = new ExcludeListMetaData(); assembly.setExcludeList(excludes);
/** * Create a new ExcludedMethod iterator * * @param excluded the excluded methods */ public ExcludedMethodMetaDataIterator(ExcludeListMetaData excluded) { if (excluded == null) return; this.excludeList = excluded; MethodsMetaData methods = excluded.getMethods(); if (methods == null) return; delegate = methods.iterator(); }