Either you've figured it out yourself, or you need to post your code. On Thu, 5 Aug 2004 09:29:33 -0000, Ilia Honsali <[EMAIL PROTECTED]> wrote: > maybe I'am wrong but what I understand is that: > the double call of the last service is due to what I add > :".._inner.getLog().." > > I have 3 interceptor > Logging --> Test --> Security --> Calculator > > as I add > "_inner.getLog().info(\"---------Interceptor_Name\");" > to > "return ($r)_inner." + methodName + "($$) ; }");" > > so when I call calculator.add(); > TestInterceptor call twice SecurityInterceptor first for the .getLog() and > secund for the .add() > > in conclusion, the n interceptor call the n-1 interceptor not only for the > original call --here the calculator.add()-- > but also for the generated call --_inner.getLog()-- > > sorry for my very very bad english explanation > > -----Message d'origine----- > De : Howard Lewis Ship [mailto:[EMAIL PROTECTED] > Envoy� : mercredi 4 ao�t 2004 18:49 > � : [email protected] > Objet : Re: interceptors > > > > > That is odd; I know we have tests for multiple interceptors so I can't > imagine why it would fail. > > Enable logging for your module; you'll see details as each service is > constructed and interceptor is applied. > > ----- Original Message ----- > From: Ilia Honsali <[EMAIL PROTECTED]> > Date: Wed, 4 Aug 2004 18:17:33 -0000 > Subject: interceptors > To: [email protected] > > Hi, > > I am experimenting interceptors, and testing the "after" "before" > attributes, so I create two interceptors like the NullInterceptor > mentionned in the doc > --------------------------------------------------------------------------------------------------------------- > I just modify the class to be added to the ClassFab in order to have some logs > classFab.addMethod(Modifier.PUBLIC, > sig, > > "{_inner.getLog().info(\"---------Interceptor_Name\"); return ($r) > _inner." + methodName + "($$) ; }"); > > --------------------------------------------------------------------------------------------------------------- > in the example.sdl I add these declarations: > > service-point (id=SecurityInterceptor > interface=org.apache.hivemind.ServiceInterceptorFactory) { > invoke-factory (service-id=hivemind.BuilderFactory ){ > construct > (class=org.apache.hivemind.examples.impl.SecurityInterceptor) > } > } > > service-point (id=TestInterceptor > interface=org.apache.hivemind.ServiceInterceptorFactory) { > invoke-factory (service-id=hivemind.BuilderFactory ){ > construct > (class=org.apache.hivemind.examples.impl.TestInterceptor ) > } > } > -------------------------------------------------------------------------------------------------------------- > and I add these interceptors to Calculator declaration > service-point (id=Calculator > interface=org.apache.hivemind.examples.Calculator) > { > invoke-factory (service-id=hivemind.BuilderFactory) > { > construct (class= org.apache.hivemind.examples.impl.CalculatorImpl) > { > } > } > interceptor (service-id=hivemind.LoggingInterceptor ) > interceptor (service-id=SecurityInterceptor ) > interceptor (service-id=TestInterceptor) > } > > my question is : > why hivemind call twice one of my interceptors? > Calculator [DEBUG] BEGIN divide(1.0, 2.0) > Calculator [INFO] ---------test > Calculator [INFO] ---------security > Calculator [INFO] ---------test > Divider [DEBUG] Constructing core service implementation for service > examples.Divider > Divider [DEBUG] Applying interceptor factory hivemind.LoggingInterceptor > Divider [DEBUG] BEGIN divide(1.0, 2.0) > Divider [DEBUG] END divide() [0.5] > Calculator [DEBUG] END divide() [0.5] > -------------------------------------------------------------------------------------------------------------- > > thanks a lot for your patience > > -- > Howard M. Lewis Ship > Independent J2EE / Open-Source Java Consultant > Creator, Jakarta Tapestry > Creator, Jakarta HiveMind > http://howardlewisship.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] > >
-- Howard M. Lewis Ship Independent J2EE / Open-Source Java Consultant Creator, Jakarta Tapestry Creator, Jakarta HiveMind http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
