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

chlol do-not-reply at jboss.com
Tue Aug 28 03:42:04 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() &&&&&&&&&&&&");
	}

}

but when the persist() is executed,the intercept don't be invoked

can you help me?

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

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



More information about the jboss-user mailing list