/* */
/* */ private void addAnnotations(Class<? extends Annotation> annotationClass, Annotation annotation, EJBContainer container, String methodName, MethodParametersMetaData params)
/* */ {
/* */ try
/* */ {
/* 2065 */ AnnotationRepository annotations = container.getAnnotations();
/* 2066 */ if (methodName.equals("*"))
/* */ {
/* 2068 */ log.debug("adding " + annotationClass.getName() + " annotation to " + this.ejbClass.getName() + "." + methodName);
/* */
/* 2071 */ for (Method declaredMethod : this.ejbClass.getDeclaredMethods())
/* */ {
/* 2074 */ annotations.addAnnotation(declaredMethod, annotationClass, annotation);
/* */
/* 2076 */ overrideAnnotations(container, declaredMethod, annotationClass.getName(), annotation);
/* */ }
/* */
/* */ }
/* 2081 */ else if (params == null)
/* */ {
/* 2083 */ Method[] methods = this.ejbClass.getMethods();
/* 2084 */ boolean foundMethod = false;
/* 2085 */ for (int methodIndex = 0; methodIndex < methods.length; methodIndex++)
/* */ {
/* 2087 */ if (!methods[methodIndex].getName().equals(methodName))
/* */ continue;
/* 2089 */ log.debug("adding " + annotationClass.getName() + " method annotation to " + methods[methodIndex]);
/* */
/* 2091 */ annotations.addAnnotation(methods[methodIndex], annotationClass, annotation);
/* */
/* 2093 */ overrideAnnotations(container, methods[methodIndex], annotationClass.getName(), annotation);
/* */
/* 2095 */ foundMethod = true;
/* */ }
/* */
/* 2100 */ if (!foundMethod)
/* */ {
/* 2102 */ methods = this.ejbClass.getDeclaredMethods();
/* 2103 */ for (int methodIndex = 0; methodIndex < methods.length; methodIndex++)
/* */ {
/* 2105 */ if (!methods[methodIndex].getName().equals(methodName))
/* */ continue;
/* 2107 */ log.debug("adding " + annotationClass.getName() + " method annotation to " + methods[methodIndex]);
/* */
/* 2109 */ annotations.addAnnotation(methods[methodIndex], annotationClass, annotation);
/* */
/* 2111 */ overrideAnnotations(container, methods[methodIndex], annotationClass.getName(), annotation);
/* */
/* 2113 */ foundMethod = true;
/* */ }
/* */
/* */ }
/* */
/* 2119 */ if (!foundMethod)
/* */ {
/* 2121 */ Field member = this.ejbClass.getDeclaredField(methodName);
/* */
/* 2123 */ if (member != null)
/* */ {
/* 2125 */ log.debug("adding " + annotationClass.getName() + " field annotation to " + member);
/* */
/* 2127 */ annotations.addAnnotation(member, annotationClass, annotation);
/* */
/* 2129 */ overrideAnnotations(container, member, annotationClass.getName(), annotation);
/* */ }
/* */ }
/* */ }
/* */ else
/* */ {
/* 2135 */ Class[] methodSignature = new Class[params.size()];
/* 2136 */ int paramIndex = 0;
/* 2137 */ for (String param : params)
/* */ {
/* 2139 */ Class paramClass = null;
/* 2140 */ if (param.equals("boolean"))
/* 2141 */ paramClass = Boolean.TYPE;
/* 2142 */ else if (param.equals("int"))
/* 2143 */ paramClass = Integer.TYPE;
/* 2144 */ else if (param.equals("long"))
/* 2145 */ paramClass = Long.TYPE;
/* 2146 */ else if (param.equals("short"))
/* 2147 */ paramClass = Short.TYPE;
/* 2148 */ else if (param.equals("byte"))
/* 2149 */ paramClass = Byte.TYPE;
/* 2150 */ else if (param.equals("char"))
/* 2151 */ paramClass = Character.TYPE;
/* */ else
/* 2153 */ paramClass = this.di.getClassLoader().loadClass(param);
/* 2154 */ methodSignature[(paramIndex++)] = paramClass;
/* */ }
/* 2156 */ if (log.isTraceEnabled())
/* 2157 */ log.trace("Looking for method " + methodName + Arrays.toString(methodSignature) + " on class " + this.ejbClass);
/* 2158 */ Member member = ClassHelper.getPrivateMethod(this.ejbClass, methodName, methodSignature);
/* 2159 */ log.debug("adding " + annotationClass.getName() + " method annotation to " + member);
/* */
/* 2161 */ annotations.addAnnotation(member, annotationClass, annotation);
/* 2162 */ overrideAnnotations(container, member, annotationClass.getName(), annotation);
/* */ }
/* */
/* */ }
/* */ catch (Exception e)