James Carman wrote:
Hmm, now HM complaints:
2005-05-12 13:53:17,495 [main] ERROR my.package.ProxyTimingInterceptor - Error at
file:/Q:/hivemodule.xml, line 58, column 25: Element method is not
allowed here. (DefaultErrorHandler.java:37)
2005-05-12 13:53:17,495 [main] ERROR
my.package.ProxyTimingInterceptor - Error at
file:/Q:/hivemodule.xml, line 59, column 28: Element method is not
allowed here. (DefaultErrorHandler.java:37)
but still the registry gets constructed and the application runs!?
HiveMind doesn't know how to transform your <method> elements into MethodContribution objects unless you tell it. Try setting up the parameters schema for your service interceptor factory the same way HM does...
<service-point id="ProxyTimingInterceptor" interface="org.apache.hivemind.ServiceInterceptorFactory" parameters-schema-id="hivemind.MethodFilter"> <create-instance class="my.package.ProxyJAMonTimingInterceptorFactory"/> </service>
See if that helps. I'm pretty sure you can refer to schemas defined in other modules. I wouldn't see any reason why you shouldn't be able to.
-----Original Message-----
From: David J. M. Karlsen [mailto:[EMAIL PROTECTED] Sent: Thursday, May 12, 2005 7:39 AM
To: [email protected]
Subject: Re: interceptor: getting name of implemened interface
James Carman wrote:
That may certainly be the cause! I've never grasped the config, schema and config-contribution ideas....
relevant parts:
<service-point id="ProxyTimingInterceptor" interface="org.apache.hivemind.ServiceInterceptorFactory">
<create-instance
class="my.package.ProxyJAMonTimingInterceptorFactory"/>
</service>
And later on, on a "normal service" I add this after the invoke-factory element
<interceptor service-id="ProxyTimingInterceptor"> <method include="*"/> <method exclude="test"/> </interceptor>
what am I missing out on?
Actually, I think that might happen when you omit the schema altogether. Can you paste in your hivemodule.xml file (or the relevant pieces of it)?
-----Original Message----- From: James Carman [mailto:[EMAIL PROTECTED] Sent: Thursday, May 12, 2005 7:26 AM To: [email protected] Subject: RE: interceptor: getting name of implemened interface
Did you make sure you called addElement() at the end of your schema rules?
-----Original Message----- From: David J. M. Karlsen [mailto:[EMAIL PROTECTED] Sent: Thursday, May 12, 2005 7:18 AM To: [email protected] Subject: Re: interceptor: getting name of implemened interface
Knut Wannheden wrote:
David,
Yes all method calls will go through the interceptor you add. It is thus up to the interceptor to decide whether it should actually do something or just pass on to the delegate. For the interceptor to know what to do the interceptor factory must pass the parameters (in your case <include> and <exclude>) on (e.g. through the interceptor constructor).
If you like you can also take a look at HiveMind's logging interceptor LoggingInterceptorFactory. It uses Javassist to create an interceptor class and an instance thereof on the fly. The <include> and <exclude> method matching logic is encapsulated directly by this generated class. You may of course also prefer the dynamic proxy approach and code a generic interceptor class yourself. YMMV.
I took a look at the class - but I'm a little confused over this:
In the LoggingInterceptorFactory you get a List of parameters (the
include/exclude patterns), and the elements in the list are cast to MethodContribution objects.
In my interceptorfactory I receive a List of parameters containing org.apache.hivemind.impl.ElementImpl objects.
Howcome?
-- 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]
