public static Collection<Method> resolveMethods(final NamedMethodMetaData methodData, final Class<?> componentClass, final DeploymentReflectionIndex reflectionIndex) throws DeploymentUnitProcessingException { return resolveMethods(methodData.getMethodName(), methodData.getMethodParams(), componentClass, reflectionIndex); }
public void process(ITimeoutTarget bean, Method method) { Timeout timeout = finder.getAnnotation(method, Timeout.class); if(timeout == null) return; NamedMethodMetaData timeoutMethod = new NamedMethodMetaData(); timeoutMethod.setMethodName(method.getName()); timeoutMethod.setMethodParams(ProcessorUtils.getMethodParameters(method)); bean.setTimeoutMethod(timeoutMethod); }
NamedMethodMetaData namedMethod = new NamedMethodMetaData(); namedMethod.setName(method.getName()); if (method.getParameters() != null) methodParams.addAll(Arrays.asList(method.getParameters())); namedMethod.setMethodParams(methodParams);
Method beanMethod = MethodResolutionUtils.resolveMethod(method.getBeanMethod(), componentClass, deploymentReflectionIndex); if (method.getCreateMethod() != null) { description.addInitMethod(beanMethod, method.getCreateMethod().getMethodName()); } else { description.addInitMethod(beanMethod, null);
/** * Returns the {@link LockType} specified for the method "*". Returns null * if there is no lock type specified. * * @param sessionBean Session bean metadata * @return */ private LockType getLockTypeApplicableForAllMethods(JBossSessionBean31MetaData sessionBean) { NamedMethodMetaData allMethods = new NamedMethodMetaData(); allMethods.setName("*"); ConcurrentMethodMetaData concurrentMethod = sessionBean.getConcurrentMethods().get(allMethods); if (concurrentMethod == null) { return null; } return concurrentMethod.getLockType(); }
if(removeMethod.getBeanMethod().getMethodParams() == null) { final NamedMethodMetaData methodData = removeMethod.getBeanMethod(); final Collection<Method> methods = MethodResolutionUtils.resolveMethods(methodData, componentClass, reflectionIndex); if(removeMethod.getBeanMethod().getMethodParams() != null) { final NamedMethodMetaData methodData = removeMethod.getBeanMethod(); final Collection<Method> methods = MethodResolutionUtils.resolveMethods(methodData, componentClass, reflectionIndex);
/** * Set the methodName. * * @param methodName the methodName. * @throws IllegalArgumentException for a null methodName */ public void setMethodName(String methodName) { setName(methodName); }
/** * Get the methodName. * * @return the methodName. */ public String getMethodName() { return getName(); }
public void process(ITimeoutTarget bean, Method method) { Timeout timeout = finder.getAnnotation(method, Timeout.class); if(timeout == null) return; NamedMethodMetaData timeoutMethod = new NamedMethodMetaData(); timeoutMethod.setMethodName(method.getName()); timeoutMethod.setMethodParams(ProcessorUtils.getMethodParameters(method)); bean.setTimeoutMethod(timeoutMethod); }
NamedMethodMetaData namedMethod = new NamedMethodMetaData(); namedMethod.setName(method.getName()); if (method.getParameters() != null) methodParams.addAll(Arrays.asList(method.getParameters())); namedMethod.setMethodParams(methodParams);
if(this.getMethodName() == null) if(other.getMethodName() != null) return false; else if(! this.getMethodName().equals(other.getMethodName())) return false;
/** * Returns the {@link AccessTimeoutMetaData} specified for the method "*". Returns null * if there is no {@link AccessTimeoutMetaData} applies to that method. * * @param sessionBean Session bean metadata * @return */ private AccessTimeoutMetaData getAccessTimeoutApplicableForAllMethods(JBossSessionBean31MetaData sessionBean) { NamedMethodMetaData allMethods = new NamedMethodMetaData(); allMethods.setName("*"); ConcurrentMethodMetaData concurrentMethod = sessionBean.getConcurrentMethods().get(allMethods); if (concurrentMethod == null) { return null; } return concurrentMethod.getAccessTimeout(); }
if(removeMethod.getBeanMethod().getMethodParams() == null) { final NamedMethodMetaData methodData = removeMethod.getBeanMethod(); final Collection<Method> methods = MethodResolutionUtils.resolveMethods(methodData, componentClass, reflectionIndex); if(removeMethod.getBeanMethod().getMethodParams() != null) { final NamedMethodMetaData methodData = removeMethod.getBeanMethod(); final Collection<Method> methods = MethodResolutionUtils.resolveMethods(methodData, componentClass, reflectionIndex);
/** * Set the methodName. * * @param methodName the methodName. * @throws IllegalArgumentException for a null methodName */ public void setMethodName(String methodName) { setName(methodName); }
/** * Get the methodName. * * @return the methodName. */ public String getMethodName() { return getName(); }
public static Method resolveMethod(final NamedMethodMetaData methodData, final Class<?> componentClass, final DeploymentReflectionIndex reflectionIndex) throws DeploymentUnitProcessingException { return resolveMethod(methodData.getMethodName(), methodData.getMethodParams(), componentClass, reflectionIndex); }
public void process(ITimeoutTarget bean, Method method) { Timeout timeout = finder.getAnnotation(method, Timeout.class); if(timeout == null) return; NamedMethodMetaData timeoutMethod = new NamedMethodMetaData(); timeoutMethod.setMethodName(method.getName()); timeoutMethod.setMethodParams(ProcessorUtils.getMethodParameters(method)); bean.setTimeoutMethod(timeoutMethod); } }
private Method resolveMethod(final DeploymentReflectionIndex index, final Class<?> currentClass, final Class<?> componentClass, final NamedMethodMetaData methodData) throws DeploymentUnitProcessingException { if (currentClass == null) { throw EjbLogger.ROOT_LOGGER.failToFindMethodWithParameterTypes(componentClass.getName(), methodData.getMethodName(), methodData.getMethodParams()); } final ClassReflectionIndex classIndex = index.getClassIndex(currentClass); if (methodData.getMethodParams() == null) { final Collection<Method> methods = classIndex.getAllMethods(methodData.getMethodName()); if (methods.isEmpty()) { return resolveMethod(index, currentClass.getSuperclass(), componentClass, methodData); } else if (methods.size() > 1) { throw EjbLogger.ROOT_LOGGER.multipleMethodReferencedInEjbJarXml(methodData.getMethodName(), currentClass.getName()); } return methods.iterator().next(); } else { final Collection<Method> methods = classIndex.getAllMethods(methodData.getMethodName(), methodData.getMethodParams().size()); for (final Method method : methods) { boolean match = true; for (int i = 0; i < method.getParameterTypes().length; ++i) { if (!method.getParameterTypes()[i].getName().equals(methodData.getMethodParams().get(i))) { match = false; break; } } if (match) { return method; } } } return resolveMethod(index, currentClass.getSuperclass(), componentClass, methodData); }
NamedMethodMetaData beanMethod = new NamedMethodMetaData(); metaData.setBeanMethod(beanMethod); NamedMethodMetaData createMethod = new NamedMethodMetaData(); metaData.setCreateMethod(createMethod); beanMethod.setMethodName(alternativeName); createMethod.setMethodName(method.getName()); beanMethod.setMethodName(method.getName()); createMethod.setMethodName(alternativeName); beanMethod.setMethodParams(methodParams); createMethod.setMethodParams(methodParams);
final ClassReflectionIndex classIndex = index.getClassIndex(componentClass); Method resolvedMethod = null; if (methodData.getMethodParams() == null) { final Collection<Method> methods = classIndex.getAllMethods(methodData.getMethodName()); if (methods.isEmpty()) { throw EjbLogger.ROOT_LOGGER.failToFindMethodInEjbJarXml(componentClass.getName(), methodData.getMethodName()); } else if (methods.size() > 1) { throw EjbLogger.ROOT_LOGGER.multipleMethodReferencedInEjbJarXml(methodData.getMethodName(), componentClass.getName()); final Collection<Method> methods = classIndex.getAllMethods(methodData.getMethodName(), methodData.getMethodParams().size()); for (final Method method : methods) { boolean match = true; for (int i = 0; i < method.getParameterTypes().length; ++i) { if (!method.getParameterTypes()[i].getName().equals(methodData.getMethodParams().get(i))) { match = false; break; throw EjbLogger.ROOT_LOGGER.failToFindMethodWithParameterTypes(componentClass.getName(), methodData.getMethodName(), methodData.getMethodParams());