You can use whatever you want to write interceptors, that's the beauty of
the framework.  So, to get it working, you might consider using the
MethodInterceptorFactory rather than trying to create an interceptor using
bytecode manipulation/generation.

-----Original Message-----
From: David J. M. Karlsen [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 25, 2005 11:40 AM
To: hivemind-dev@jakarta.apache.org
Subject: Re: interceptor: getting name of implemened interface

Knut Wannheden wrote:
> David,
> 
> On 5/25/05, David J. M. Karlsen <[EMAIL PROTECTED]> wrote:
> 
>>Hmm, HM1.1 is still beta stuff - and I need a very stable
>>production-ready API. How many more betas?
>>
>>So I went for the try/catch, but I still get a source-error - "no return
>>statement". BodyBuilder toString():
>>
>>{
>>   com.jamonapi.Monitor mon =
>>com.jamonapi.MonitorFactory.start("sendAndReceive");
>>   try {
>>   Object result = _delegate.sendAndReceive($$);
>>   mon.stop();
>>   return ($r) result;
>>   }
>>   catch (Throwable t){
>>   if (mon!=null) mon.stop();
>>   throw t;
>>   };
>>}
>>
>>
> Hmm, maybe that's another Javassist bug. Try removing that last
> semicolon (after the '}')...

Didn't help. I moved the return statement to after the catch block - now 
  it works. Like this:

  com.jamonapi.Monitor mon = 
com.jamonapi.MonitorFactory.start("sendAndReceive");
   Object result = null;
   try {
   result = _delegate.sendAndReceive($$);
   mon.stop();
   }
   catch (Throwable t){
   if (mon!=null) mon.stop();
   throw t;
   };
   return ($r) result;



I'm not too convinced over javassist. Will you concider CGlib or ASM 
instead?

-- 
David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to