-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Collections in Method Interceptor
PostPosted: Mon May 22, 2006 3:47 am 
Newbie

Joined: Mon Sep 26, 2005 4:08 am
Posts: 15
hi everyone,

i am using method Interceptor to intercept methods (AOP).
i am able to intercept the method, the method returns a collection of objects which i want to manipulate i.e. i want to manipulate the collection.

i am able to access the intercepted method but not able to access the collection returned by the method. here is the code which i have written:


public class RowLevelAdvice implements MethodInterceptor {
public Object invoke(MethodInvocation methodInvocation) throws Throwable {

HibernateDaoSupport dao = (HibernateDaoSupport) methodInvocation.getThis();
Session s = SessionFactoryUtils.getSession(dao.getSessionFactory(), true);

if (dao instanceof DomainDaoHibernate) {
System.out.println("Trapped Domain Dao: " + methodInvocation.getMethod().getName().toString());

}
final Object o = methodInvocation.proceed();
return o;
}
}

The invoke method is where i want to manipulate the interface. Any help is highly commendable.

Regards.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.