public EjbServiceMetadata(Class<?> scannedClass, Class<?> invokeeClass) { stateful = scannedClass.isAnnotationPresent(Stateful.class); if (stateful) { for (Method method : scannedClass.getMethods()) { Remove remove = method.getAnnotation(Remove.class); if (remove != null) { try { method = invokeeClass.getMethod(method.getName(), method.getParameterTypes()); removeMethods.put(method, Boolean.valueOf(remove.retainIfException())); } catch (Exception e) { // ignore (invokee interface may not expose this remove method)... } } } } }
private void removeIfNecessary(Method removeMethod, Exception exception) { if ( exception instanceof RuntimeException || exception instanceof RemoteException ) { if ( !exception.getClass().isAnnotationPresent(ApplicationException.class) ) { //it is a "system exception" remove(); } } else if ( removeMethod!=null ) { if ( !removeMethod.getAnnotation(Remove.class).retainIfException() ) { remove(); } } }
public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { if (jp instanceof MethodJoinpoint == false) throw new IllegalArgumentException("Joinpoint is not a method: " + jp); MethodJoinpoint methodJoinpoint = MethodJoinpoint.class.cast(jp); Method method = methodJoinpoint.getMethod(); Remove rm = (Remove) advisor.resolveAnnotation(method, Remove.class); if (rm == null) { log.warn("Cannot find @" + Remove.class.getName() + " for " + method + " assuming defaults"); rm = new RemoveImpl(); } return new StatefulRemoveInterceptor(rm.retainIfException()); }
public RemoveMethodMetaData create(Method method) { Remove remove = finder.getAnnotation(method, Remove.class); if(remove == null) return null; RemoveMethodMetaData metaData = new RemoveMethodMetaData(); NamedMethodMetaData beanMethod = new NamedMethodMetaData(); beanMethod.setMethodName(method.getName()); metaData.setBeanMethod(beanMethod); metaData.setRetainIfException(remove.retainIfException()); MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method); beanMethod.setMethodParams(methodParams); return metaData; }
public RemoveMethodMetaData create(Method method) { Remove remove = finder.getAnnotation(method, Remove.class); if(remove == null) return null; RemoveMethodMetaData metaData = new RemoveMethodMetaData(); NamedMethodMetaData beanMethod = new NamedMethodMetaData(); beanMethod.setMethodName(method.getName()); metaData.setBeanMethod(beanMethod); metaData.setRetainIfException(remove.retainIfException()); MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method); beanMethod.setMethodParams(methodParams); return metaData; }
public RemoveMethodMetaData create(Method method) { Remove remove = finder.getAnnotation(method, Remove.class); if(remove == null) return null; RemoveMethodMetaData metaData = new RemoveMethodMetaData(); NamedMethodMetaData beanMethod = new NamedMethodMetaData(); beanMethod.setMethodName(method.getName()); metaData.setBeanMethod(beanMethod); metaData.setRetainIfException(remove.retainIfException()); MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method); beanMethod.setMethodParams(methodParams); return metaData; }
removalInfo.setRetainIfException(remove.retainIfException()); sessionDescriptor.addRemoveMethod(removalInfo); } else { remove.retainIfException());
removalInfo.setRetainIfException(remove.retainIfException()); sessionDescriptor.addRemoveMethod(removalInfo); } else { remove.retainIfException());
RemoveMethod removeMethod = new RemoveMethod(method, remove.retainIfException()); session.getRemoveMethod().add(removeMethod); } else if (!declaredRemoveMethod.isExplicitlySet()) { declaredRemoveMethod.setRetainIfException(remove.retainIfException());
final RemoveMethod removeMethod = new RemoveMethod(method.get(), remove.retainIfException()); session.getRemoveMethod().add(removeMethod); } else if (!declaredRemoveMethod.isExplicitlySet()) { declaredRemoveMethod.setRetainIfException(remove.retainIfException());
final RemoveMethod removeMethod = new RemoveMethod(method.get(), remove.retainIfException()); session.getRemoveMethod().add(removeMethod); } else if (!declaredRemoveMethod.isExplicitlySet()) { declaredRemoveMethod.setRetainIfException(remove.retainIfException());
boolean isRetainIfException= remove.retainIfException();