public boolean isAsynchronousMethod(Method m) { boolean async = false; for(MethodDescriptor next : asyncMethods) { Method nextMethod = next.getMethod(this); if( (nextMethod != null) && TypeUtil.sameMethodSignature(m, nextMethod)) { async = true; break; } } return async; }
public boolean isAsynchronousMethod(Method m) { boolean async = false; for(MethodDescriptor next : asyncMethods) { Method nextMethod = next.getMethod(this); if( (nextMethod != null) && TypeUtil.sameMethodSignature(m, nextMethod)) { async = true; break; } } return async; }
/** * Checks whether two methods that might have been loaded by * different class loaders are equal. * @param compareDeclaringClass if true, declaring class will * be considered as part of equality test. */ private boolean methodsEqual(MethodDescriptor m1, Method m2, boolean compareDeclaringClass) { Method m = m1.getMethod(parentDesc); return methodsEqual(m, m2, compareDeclaringClass); }
public Class getDeclaringClass(MethodDescriptor md) { Method method = md.getMethod(getDescriptor()); Class declaringClass = null; for (Method m : methods) { if (TypeUtil.sameMethodSignature(m, method)) { declaringClass = m.getDeclaringClass(); } } return declaringClass; }
private boolean matchesExistingReadOrWriteLockMethod(Method methodToMatch, EjbSessionDescriptor desc) { List<MethodDescriptor> lockMethods = desc.getReadAndWriteLockMethods(); boolean match = false; for (MethodDescriptor next : lockMethods) { Method m = next.getMethod(desc); if( ( m.getDeclaringClass().equals(methodToMatch.getDeclaringClass()) ) && TypeUtil.sameMethodSignature(m, methodToMatch) ) { match = true; break; } } return match; }
public Class getDeclaringClass(MethodDescriptor md) { Method method = md.getMethod(getDescriptor()); Class declaringClass = null; for (Method m : methods) { if (TypeUtil.sameMethodSignature(m, method)) { declaringClass = m.getDeclaringClass(); } } return declaringClass; }
private boolean matchesExistingAccessTimeoutMethod(Method methodToMatch, EjbSessionDescriptor desc) { List<MethodDescriptor> timeoutMethods = desc.getAccessTimeoutMethods(); boolean match = false; for (MethodDescriptor next : timeoutMethods) { Method m = next.getMethod(desc); if (( m.getDeclaringClass().equals(methodToMatch.getDeclaringClass()) ) && TypeUtil.sameMethodSignature(m, methodToMatch) ) { match = true; break; } } return match; }
private boolean matchesExistingReadOrWriteLockMethod(Method methodToMatch, EjbSessionDescriptor desc) { List<MethodDescriptor> lockMethods = desc.getReadAndWriteLockMethods(); boolean match = false; for (MethodDescriptor next : lockMethods) { Method m = next.getMethod(desc); if( ( m.getDeclaringClass().equals(methodToMatch.getDeclaringClass()) ) && TypeUtil.sameMethodSignature(m, methodToMatch) ) { match = true; break; } } return match; }
private boolean matchesExistingAccessTimeoutMethod(Method methodToMatch, EjbSessionDescriptor desc) { List<MethodDescriptor> timeoutMethods = desc.getAccessTimeoutMethods(); boolean match = false; for (MethodDescriptor next : timeoutMethods) { Method m = next.getMethod(desc); if (( m.getDeclaringClass().equals(methodToMatch.getDeclaringClass()) ) && TypeUtil.sameMethodSignature(m, methodToMatch) ) { match = true; break; } } return match; }
/** * Search for a matching method in a list of methods * that might have been loaded with a different classloader. * Because of this possibility, we can't use * java.lang.reflect.Method.equals(). * @return matched method or NULL */ private Method findEquivalentMethod(Collection methods, Method methodToMatch) { Method matchedMethod = null; for(Iterator iter = methods.iterator(); iter.hasNext();) { Object o = iter.next(); Method next; if (o instanceof Method) { next = (Method) o; } else { next = ((MethodDescriptor) o).getMethod(parentDesc); if (next==null) { return null; } } // Compare methods, ignoring declaring class. if( methodsEqual(next, methodToMatch, false) ) { matchedMethod = next; break; } } return matchedMethod; }
/** * Search for a matching method in a list of methods * that might have been loaded with a different classloader. * Because of this possibility, we can't use * java.lang.reflect.Method.equals(). * @return matched method or NULL */ private Method findEquivalentMethod(Collection methods, Method methodToMatch) { Method matchedMethod = null; for(Iterator iter = methods.iterator(); iter.hasNext();) { Object o = iter.next(); Method next; if (o instanceof Method) { next = (Method) o; } else { next = ((MethodDescriptor) o).getMethod(parentDesc); if (next==null) { return null; } } // Compare methods, ignoring declaring class. if( methodsEqual(next, methodToMatch, false) ) { matchedMethod = next; break; } } return matchedMethod; }
Method method = methodDescriptor.getMethod(descriptor); String methodName = methodDescriptor.getName();
private void validateConcurrencyMetadata(EjbDescriptor ejb) { if( ejb instanceof EjbSessionDescriptor ) { EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejb; List<EjbSessionDescriptor.AccessTimeoutHolder> accessTimeoutInfo = sessionDesc.getAccessTimeoutInfo(); for(EjbSessionDescriptor.AccessTimeoutHolder accessTimeoutHolder : accessTimeoutInfo) { MethodDescriptor accessTimeoutMethodDesc = accessTimeoutHolder.method; Method accessTimeoutMethod = accessTimeoutMethodDesc.getMethod(ejb); if(accessTimeoutMethod == null) { throw new RuntimeException("Invalid AccessTimeout method signature " + accessTimeoutMethodDesc + " . Method could not be resolved to a bean class method for bean " + ejb.getName()); } } for(MethodDescriptor lockMethodDesc : sessionDesc.getReadAndWriteLockMethods()) { Method readLockMethod = lockMethodDesc.getMethod(sessionDesc); if( readLockMethod == null ) { throw new RuntimeException("Invalid Lock method signature " + lockMethodDesc + " . Method could not be resolved to a bean class method for bean " + ejb.getName()); } } } }
private void validateConcurrencyMetadata(EjbDescriptor ejb) { if( ejb instanceof EjbSessionDescriptor ) { EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejb; List<EjbSessionDescriptor.AccessTimeoutHolder> accessTimeoutInfo = sessionDesc.getAccessTimeoutInfo(); for(EjbSessionDescriptor.AccessTimeoutHolder accessTimeoutHolder : accessTimeoutInfo) { MethodDescriptor accessTimeoutMethodDesc = accessTimeoutHolder.method; Method accessTimeoutMethod = accessTimeoutMethodDesc.getMethod(ejb); if(accessTimeoutMethod == null) { throw new RuntimeException("Invalid AccessTimeout method signature " + accessTimeoutMethodDesc + " . Method could not be resolved to a bean class method for bean " + ejb.getName()); } } for(MethodDescriptor lockMethodDesc : sessionDesc.getReadAndWriteLockMethods()) { Method readLockMethod = lockMethodDesc.getMethod(sessionDesc); if( readLockMethod == null ) { throw new RuntimeException("Invalid Lock method signature " + lockMethodDesc + " . Method could not be resolved to a bean class method for bean " + ejb.getName()); } } } }
/** * Get the remove methods of the EJB * * @return An iterator over the remove methods */ public Collection<Method> getRemoveMethods() { Set<Method> removeMethods = new HashSet<Method>(); if( ejbDesc.getType().equals(EjbSessionDescriptor.TYPE) ) { EjbSessionDescriptor sessionDesc = (EjbSessionDescriptor) ejbDesc; if( sessionDesc.isStateful() && sessionDesc.hasRemoveMethods() ) { for(MethodDescriptor mDesc : sessionDesc.getRemoveMethodDescriptors()) { Method m = mDesc.getMethod(ejbDesc); if( m == null ) { throw new IllegalStateException("Can't resolve remove method " + mDesc + " For EJB " + sessionDesc.getName()); } removeMethods.add(m); } } } return removeMethods; }
Method readLockMethod = readLockMethodDesc.getMethod(singletonDesc); if(implMethodMatchesInvInfoMethod(invInfoMethod, methodIntf, readLockMethod)) { Method writeLockMethod = writeLockMethodDesc.getMethod(singletonDesc); if(implMethodMatchesInvInfoMethod(invInfoMethod, methodIntf, writeLockMethod)) { Method accessTimeoutMethod = accessTimeoutMethodDesc.getMethod(sessionDesc); if(implMethodMatchesInvInfoMethod(invInfoMethod, methodIntf, accessTimeoutMethod)) {
for (Object next : ejbDesc.getSecurityBusinessMethodDescriptors()) { MethodDescriptor md = (MethodDescriptor)next; Method m = md.getMethod(ejbDesc);
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { TransactionAttribute taAn = (TransactionAttribute) ainfo.getAnnotation(); for (EjbContext ejbContext : ejbContexts) { EjbDescriptor ejbDesc = ejbContext.getDescriptor(); ContainerTransaction containerTransaction = getContainerTransaction(taAn.value()); if (ElementType.TYPE.equals(ainfo.getElementType())) { ejbContext.addPostProcessInfo(ainfo, this); } else { Method annMethod = (Method) ainfo.getAnnotatedElement(); Set txBusMethods = ejbDesc.getTxBusinessMethodDescriptors(); for (Object next : txBusMethods) { MethodDescriptor nextDesc = (MethodDescriptor) next; Method m = nextDesc.getMethod(ejbDesc); if( TypeUtil.sameMethodSignature(m, annMethod) && ejbDesc.getContainerTransactionFor(nextDesc) == null ) { // override by xml ejbDesc.setContainerTransactionFor (nextDesc, containerTransaction); } } } } return getDefaultProcessedResult(); }
Method m = md.getMethod(ejbDesc); if (TypeUtil.sameMethodSignature(m, annMethod)) { processEjbMethodSecurity(authAnnotation, md, ejbDesc);
Method m = md.getMethod(ejbDesc); if (TypeUtil.sameMethodSignature(m, annMethod)) { processEjbMethodSecurity(authAnnotation, md, ejbDesc);