@Override public MethodDescriptor getDescriptor() { if (descriptor == null) descriptor = new MethodDescriptor(); return descriptor; }
public QueryDescriptor getQueryFor(Method method) { // Use our own method equality check. See setQueryFor comment // for more details. MethodDescriptor md = new MethodDescriptor(method,""); return (QueryDescriptor) queries.get(md); }
public QueryDescriptor getQueryFor(Method method) { // Use our own method equality check. See setQueryFor comment // for more details. MethodDescriptor md = new MethodDescriptor(method,""); return (QueryDescriptor) queries.get(md); }
private MethodDescriptor getMethodDescriptor(AccessibleObject o, Class managedBeanClass) { MethodDescriptor mDesc = null; if (o instanceof Method) { mDesc = new MethodDescriptor((Method)o); } else if (o instanceof Constructor) { Class[] ctorParamTypes = ((Constructor)o).getParameterTypes(); String[] parameterClassNames = (new MethodDescriptor()).getParameterClassNamesFor(null, ctorParamTypes); // MethodDescriptor.EJB_BEAN is just a tag, not to add a new one mDesc = new MethodDescriptor(managedBeanClass.getSimpleName(), null, parameterClassNames, MethodDescriptor.EJB_BEAN); } return mDesc; }
protected void addAllInterfaceMethodsIn(Collection methodDescriptors, Class c, String methodIntf) { Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; i++) { if( methods[i].getDeclaringClass() != java.lang.Object.class ) { methodDescriptors.add(new MethodDescriptor(methods[i], methodIntf)); } } }
protected void addAllInterfaceMethodsIn(Collection methodDescriptors, Class c, String methodIntf) { Method[] methods = c.getMethods(); for (int i = 0; i < methods.length; i++) { if( methods[i].getDeclaringClass() != java.lang.Object.class ) { methodDescriptors.add(new MethodDescriptor(methods[i], methodIntf)); } } }
/** * utiliy method to transform our collection of Method objects into * MethodDescriptor objects and add them to our global list of * elligible methods * @param the collection of acceptable method objects * @param the method-intf identifier for those methods * @param the global list of MethodDescriptors objects */ private void transformAndAdd(Collection methods, String methodIntf, Vector globalList) { for (Iterator itr = methods.iterator();itr.hasNext();) { Method m = (Method) itr.next(); MethodDescriptor md = new MethodDescriptor(m, methodIntf); globalList.add(md); } }
/** * utiliy method to transform our collection of Method objects into * MethodDescriptor objects and add them to our global list of * elligible methods * @param the collection of acceptable method objects * @param the method-intf identifier for those methods * @param the global list of MethodDescriptors objects */ private void transformAndAdd(Collection methods, String methodIntf, Vector globalList) { for (Iterator itr = methods.iterator();itr.hasNext();) { Method m = (Method) itr.next(); MethodDescriptor md = new MethodDescriptor(m, methodIntf); globalList.add(md); } }
private void setInterceptorChain(InvocationInfo info) { if( info.aroundMethod != null ) { if (info.isEjbTimeout) { MethodDescriptor md = new MethodDescriptor(info.aroundMethod, MethodDescriptor.TIMER_METHOD); info.interceptorChain = interceptorManager.getAroundTimeoutChain(md, info.aroundMethod); } else { MethodDescriptor md = new MethodDescriptor(info.aroundMethod, MethodDescriptor.EJB_BEAN); info.interceptorChain = interceptorManager.getAroundInvokeChain(md, info.aroundMethod); } } }
private void setInterceptorChain(InvocationInfo info) { if( info.aroundMethod != null ) { MethodDescriptor md = new MethodDescriptor(info.aroundMethod, MethodDescriptor.EJB_BEAN); if (info.isEjbTimeout) { info.interceptorChain = interceptorManager.getAroundTimeoutChain(md, info.aroundMethod); } else { info.interceptorChain = interceptorManager.getAroundInvokeChain(md, info.aroundMethod); } } }
public void startElement(XMLElement element, Attributes attributes) { if( EjbTagNames.METHOD.equals(element.getQName()) ) { businessMethod = new MethodDescriptor(); // Assume we need overloaded method resolution until we // encounter at least one method-param element. needsOverloadResolution = true; } else if( EjbTagNames.METHOD_PARAMS.equals(element.getQName()) ) { // If there's a method-params element, regardless of whether there // are any <method-param> sub-elements, there's no overload // resolution needed. needsOverloadResolution = false; } super.startElement(element, attributes); }
@Override public void startElement(XMLElement element, Attributes attributes) { if( EjbTagNames.METHOD.equals(element.getQName()) ) { businessMethod = new MethodDescriptor(); // Assume we need overloaded method resolution until we // encounter at least one method-param element. needsOverloadResolution = true; } else if( EjbTagNames.METHOD_PARAMS.equals(element.getQName()) ) { // If there's a method-params element, regardless of whether there // are any <method-param> sub-elements, there's no overload // resolution needed. needsOverloadResolution = false; } super.startElement(element, attributes); }
/** * @return the MethodDescriptor for the given Method object */ public MethodDescriptor getBusinessMethodDescriptorFor(Method m, String methodIntf) { Set businessMethodDescriptors = getBusinessMethodDescriptors(); MethodDescriptor methodDesc = new MethodDescriptor(m, methodIntf); MethodDescriptor match = null; for(Object next : businessMethodDescriptors) { MethodDescriptor nextMethodDesc = (MethodDescriptor) next; if( nextMethodDesc.equals(methodDesc)) { match = nextMethodDesc; break; } } return match; }
/** * @return the MethodDescriptor for the given Method object */ public MethodDescriptor getBusinessMethodDescriptorFor(Method m, String methodIntf) { Set businessMethodDescriptors = getBusinessMethodDescriptors(); MethodDescriptor methodDesc = new MethodDescriptor(m, methodIntf); MethodDescriptor match = null; for(Object next : businessMethodDescriptors) { MethodDescriptor nextMethodDesc = (MethodDescriptor) next; if( nextMethodDesc.equals(methodDesc)) { match = nextMethodDesc; break; } } return match; }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { for (EjbContext ejbContext : ejbContexts) { EjbSessionDescriptor ejbDesc = (EjbSessionDescriptor) ejbContext.getDescriptor(); Method annMethod = (Method) ainfo.getAnnotatedElement(); checkValid(annMethod); if (logger.isLoggable(Level.FINE)) { logger.fine("Setting AfterCompletion method " + annMethod); } ejbDesc.setAfterCompletionMethodIfNotSet(new MethodDescriptor(annMethod)); } return getDefaultProcessedResult(); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { for (EjbContext ejbContext : ejbContexts) { EjbSessionDescriptor ejbDesc = (EjbSessionDescriptor) ejbContext.getDescriptor(); Method annMethod = (Method) ainfo.getAnnotatedElement(); checkValid(annMethod); if (logger.isLoggable(Level.FINE)) { logger.fine("Setting BeforeCompletion method " + annMethod); } ejbDesc.setBeforeCompletionMethodIfNotSet(new MethodDescriptor(annMethod)); } return getDefaultProcessedResult(); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { for (EjbContext ejbContext : ejbContexts) { EjbSessionDescriptor ejbDesc = (EjbSessionDescriptor) ejbContext.getDescriptor(); Method annMethod = (Method) ainfo.getAnnotatedElement(); checkValid(annMethod); if (logger.isLoggable(Level.FINE)) { logger.fine("Setting AfterBegin method " + annMethod); } ejbDesc.setAfterBeginMethodIfNotSet(new MethodDescriptor(annMethod)); } return getDefaultProcessedResult(); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { for (EjbContext ejbContext : ejbContexts) { EjbSessionDescriptor ejbDesc = (EjbSessionDescriptor) ejbContext.getDescriptor(); Method annMethod = (Method) ainfo.getAnnotatedElement(); checkValid(annMethod); if (logger.isLoggable(Level.FINE)) { logger.fine("Setting AfterCompletion method " + annMethod); } ejbDesc.setAfterCompletionMethodIfNotSet(new MethodDescriptor(annMethod)); } return getDefaultProcessedResult(); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { for (EjbContext ejbContext : ejbContexts) { EjbSessionDescriptor ejbDesc = (EjbSessionDescriptor) ejbContext.getDescriptor(); Method annMethod = (Method) ainfo.getAnnotatedElement(); checkValid(annMethod); if (logger.isLoggable(Level.FINE)) { logger.fine("Setting AfterBegin method " + annMethod); } ejbDesc.setAfterBeginMethodIfNotSet(new MethodDescriptor(annMethod)); } return getDefaultProcessedResult(); }
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbContext[] ejbContexts) throws AnnotationProcessorException { for (EjbContext ejbContext : ejbContexts) { EjbSessionDescriptor ejbDesc = (EjbSessionDescriptor) ejbContext.getDescriptor(); Method annMethod = (Method) ainfo.getAnnotatedElement(); checkValid(annMethod); if (logger.isLoggable(Level.FINE)) { logger.fine("Setting BeforeCompletion method " + annMethod); } ejbDesc.setBeforeCompletionMethodIfNotSet(new MethodDescriptor(annMethod)); } return getDefaultProcessedResult(); }