[jboss-user] [JBoss Seam] - Re: the intercept component don't work!

chlol do-not-reply at jboss.com
Wed Aug 29 02:07:21 EDT 2007


my test intercept: 
@Name("interceptsTest")
  | @Interceptor
  | public class InterceptsTest {
  | 	@Logger
  | 	Log log;
  | 	
  | 	
  | 	@AroundInvoke
  | 	public Object doLogs(InvocationContext inv) throws Exception {
  | 		
  | 		int methodModify = inv.getMethod().getModifiers();
  | 		String methodName = inv.getMethod().getName();
  | 		
  | 		if (methodModify == Modifier.PUBLIC 
  | 				&& (methodName.startsWith("create") 
  | 						|| methodName.startsWith("update")
  | 						|| methodName.startsWith("persist")
  | 						|| methodName.startsWith("remove"))) {
  | 			
  | 			Map data = inv.getContextData();
  | 			Object target = inv.getTarget();
  | 			log.debug("ContextData:" + data);
  | 			log.debug("Target:" + target);
  | 		}
  | 		
  | 		return inv.proceed();
  | 	}
  | 
  | }
my invoke intercept class: 

@Name("useIntercept")
  | @Interceptors(InterceptsTest.class)
  | public class UseIntercept {
  | 	
  | 	public void persist() {
  | 		System.out.println("&&&&&&&&&&&& do persist() &&&&&&&&&&&&");
  | 	}
  | 
  | }

help me,please
thank you

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4079000#4079000

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4079000



More information about the jboss-user mailing list