You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Bill Lear <ra...@zopyra.com> on 2003/09/17 20:47:23 UTC

[HiveMind] How to add interceptor to "embedded" service

I have the following module, and I would like to add a logging
interceptor to the Divider service, and only the Divider service.
How do I do this?

<module id="hivemind.examples" version="1.0.0">
    <service id="Calculator" interface="hivemind.examples.Calculator">
        <invoke-factory service-id="hivemind.BuilderFactory">
            <construct class="hivemind.examples.impl.CalculatorImpl">

                <set-service property="adder"
                             service-id="org.puppies.math.Adder"/>

                <set-service property="subtracter"
                             service-id="org.kitties.math.Subtracter"/>

                <set-service property="multiplier"
                             service-id="org.gerbils.math.Multiplier"/>

                <set-service property="divider"
                             service-id="org.fishies.math.Divider"/>
            </construct>
        </invoke-factory>
    </service>
</module>

I am able to add an interceptor to the Calculator service as a whole,
but can't figure out how to wrap just the Divider by a logger.

I tried adding the following:

    <extend-service service-id="org.fishies.math.Divider">
        <interceptor service-id="hivemind.LoggingInterceptor"/>
    </extend-service>

but it did nothing.  Harish did this in his example by adding a
separate module, log, with a simple module, but that seems to require
building a separate jar.


Bill


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [HiveMind] How to add interceptor to "embedded" service

Posted by Bill Lear <ra...@zopyra.com>.
On Wednesday, September 17, 2003 at 15:04:42 (-0400) Howard M. Lewis Ship writes:
>Is there any chance that the logging is simply not being output?  LoggingInterceptor works at level
>DEBUG.  Check your log4j.properties.

Color me moron.  That was it.


Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [HiveMind] How to add interceptor to "embedded" service

Posted by Bill Lear <ra...@zopyra.com>.
On Wednesday, September 17, 2003 at 15:04:42 (-0400) Howard M. Lewis Ship writes:
>Is there any chance that the logging is simply not being output?  LoggingInterceptor works at level
>DEBUG.  Check your log4j.properties.

Color me moron.  That was it.


Bill

Re: [HiveMind] How to add interceptor to "embedded" service

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Is your module id for Divider "org.fishies.math" and service id just 
"Divider"?

-Harish

Bill Lear wrote:

>On Wednesday, September 17, 2003 at 14:47:36 (-0400) Howard M. Lewis Ship writes:
>  
>
>>Strange that that didn't work.  The fact that Divider is used as part of Calculator's implementation
>>does not affect your ability to add interceptors to it. Can we see the complete hivemodule.xml?
>>    
>>
>
>That's really it.  Here is the Calculator one, as I just sent, but
>with the extension attempt:
>
><?xml version="1.0"?>
>
><module id="hivemind.examples" version="1.0.0">
>    <service id="Calculator" interface="hivemind.examples.Calculator">
>        <invoke-factory service-id="hivemind.BuilderFactory">
>            <construct class="hivemind.examples.impl.CalculatorImpl">
>
>                <set-service property="adder"
>                             service-id="org.puppies.math.Adder"/>
>
>                <set-service property="subtracter"
>                             service-id="org.kitties.math.Subtracter"/>
>
>                <set-service property="multiplier"
>                             service-id="org.gerbils.math.Multiplier"/>
>
>                <set-service property="divider"
>                             service-id="org.fishies.math.Divider"/>
>            </construct>
>        </invoke-factory>
>    </service>
>
>    <extend-service service-id="org.fishies.math.Divider">
>        <interceptor service-id="hivemind.LoggingInterceptor"/>
>    </extend-service>
>
></module>
>
>When run, I get identical results whether or not I include the
>above <extend-service> element, and whether or not it precedes the
>above <service> element.
>
>
>Bill
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>
>  
>

RE: [HiveMind] How to add interceptor to "embedded" service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Is there any chance that the logging is simply not being output?  LoggingInterceptor works at level
DEBUG.  Check your log4j.properties.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Bill Lear [mailto:rael@zopyra.com] 
> Sent: Wednesday, September 17, 2003 2:58 PM
> To: Jakarta Commons Developers List
> Subject: RE: [HiveMind] How to add interceptor to "embedded" service
> 
> 
> On Wednesday, September 17, 2003 at 14:47:36 (-0400) Howard 
> M. Lewis Ship writes:
> >Strange that that didn't work.  The fact that Divider is 
> used as part 
> >of Calculator's implementation does not affect your ability to add 
> >interceptors to it. Can we see the complete hivemodule.xml?
> 
> That's really it.  Here is the Calculator one, as I just 
> sent, but with the extension attempt:
> 
> <?xml version="1.0"?>
> 
> <module id="hivemind.examples" version="1.0.0">
>     <service id="Calculator" interface="hivemind.examples.Calculator">
>         <invoke-factory service-id="hivemind.BuilderFactory">
>             <construct class="hivemind.examples.impl.CalculatorImpl">
> 
>                 <set-service property="adder"
>                              service-id="org.puppies.math.Adder"/>
> 
>                 <set-service property="subtracter"
>                              
> service-id="org.kitties.math.Subtracter"/>
> 
>                 <set-service property="multiplier"
>                              
> service-id="org.gerbils.math.Multiplier"/>
> 
>                 <set-service property="divider"
>                              service-id="org.fishies.math.Divider"/>
>             </construct>
>         </invoke-factory>
>     </service>
> 
>     <extend-service service-id="org.fishies.math.Divider">
>         <interceptor service-id="hivemind.LoggingInterceptor"/>
>     </extend-service>
> 
> </module>
> 
> When run, I get identical results whether or not I include 
> the above <extend-service> element, and whether or not it 
> precedes the above <service> element.
> 
> 
> Bill
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [HiveMind] How to add interceptor to "embedded" service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Is there any chance that the logging is simply not being output?  LoggingInterceptor works at level
DEBUG.  Check your log4j.properties.

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Bill Lear [mailto:rael@zopyra.com] 
> Sent: Wednesday, September 17, 2003 2:58 PM
> To: Jakarta Commons Developers List
> Subject: RE: [HiveMind] How to add interceptor to "embedded" service
> 
> 
> On Wednesday, September 17, 2003 at 14:47:36 (-0400) Howard 
> M. Lewis Ship writes:
> >Strange that that didn't work.  The fact that Divider is 
> used as part 
> >of Calculator's implementation does not affect your ability to add 
> >interceptors to it. Can we see the complete hivemodule.xml?
> 
> That's really it.  Here is the Calculator one, as I just 
> sent, but with the extension attempt:
> 
> <?xml version="1.0"?>
> 
> <module id="hivemind.examples" version="1.0.0">
>     <service id="Calculator" interface="hivemind.examples.Calculator">
>         <invoke-factory service-id="hivemind.BuilderFactory">
>             <construct class="hivemind.examples.impl.CalculatorImpl">
> 
>                 <set-service property="adder"
>                              service-id="org.puppies.math.Adder"/>
> 
>                 <set-service property="subtracter"
>                              
> service-id="org.kitties.math.Subtracter"/>
> 
>                 <set-service property="multiplier"
>                              
> service-id="org.gerbils.math.Multiplier"/>
> 
>                 <set-service property="divider"
>                              service-id="org.fishies.math.Divider"/>
>             </construct>
>         </invoke-factory>
>     </service>
> 
>     <extend-service service-id="org.fishies.math.Divider">
>         <interceptor service-id="hivemind.LoggingInterceptor"/>
>     </extend-service>
> 
> </module>
> 
> When run, I get identical results whether or not I include 
> the above <extend-service> element, and whether or not it 
> precedes the above <service> element.
> 
> 
> Bill
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


RE: [HiveMind] How to add interceptor to "embedded" service

Posted by Bill Lear <ra...@zopyra.com>.
On Wednesday, September 17, 2003 at 14:47:36 (-0400) Howard M. Lewis Ship writes:
>Strange that that didn't work.  The fact that Divider is used as part of Calculator's implementation
>does not affect your ability to add interceptors to it. Can we see the complete hivemodule.xml?

That's really it.  Here is the Calculator one, as I just sent, but
with the extension attempt:

<?xml version="1.0"?>

<module id="hivemind.examples" version="1.0.0">
    <service id="Calculator" interface="hivemind.examples.Calculator">
        <invoke-factory service-id="hivemind.BuilderFactory">
            <construct class="hivemind.examples.impl.CalculatorImpl">

                <set-service property="adder"
                             service-id="org.puppies.math.Adder"/>

                <set-service property="subtracter"
                             service-id="org.kitties.math.Subtracter"/>

                <set-service property="multiplier"
                             service-id="org.gerbils.math.Multiplier"/>

                <set-service property="divider"
                             service-id="org.fishies.math.Divider"/>
            </construct>
        </invoke-factory>
    </service>

    <extend-service service-id="org.fishies.math.Divider">
        <interceptor service-id="hivemind.LoggingInterceptor"/>
    </extend-service>

</module>

When run, I get identical results whether or not I include the
above <extend-service> element, and whether or not it precedes the
above <service> element.


Bill

RE: [HiveMind] How to add interceptor to "embedded" service

Posted by Bill Lear <ra...@zopyra.com>.
On Wednesday, September 17, 2003 at 14:47:36 (-0400) Howard M. Lewis Ship writes:
>Strange that that didn't work.  The fact that Divider is used as part of Calculator's implementation
>does not affect your ability to add interceptors to it. Can we see the complete hivemodule.xml?

That's really it.  Here is the Calculator one, as I just sent, but
with the extension attempt:

<?xml version="1.0"?>

<module id="hivemind.examples" version="1.0.0">
    <service id="Calculator" interface="hivemind.examples.Calculator">
        <invoke-factory service-id="hivemind.BuilderFactory">
            <construct class="hivemind.examples.impl.CalculatorImpl">

                <set-service property="adder"
                             service-id="org.puppies.math.Adder"/>

                <set-service property="subtracter"
                             service-id="org.kitties.math.Subtracter"/>

                <set-service property="multiplier"
                             service-id="org.gerbils.math.Multiplier"/>

                <set-service property="divider"
                             service-id="org.fishies.math.Divider"/>
            </construct>
        </invoke-factory>
    </service>

    <extend-service service-id="org.fishies.math.Divider">
        <interceptor service-id="hivemind.LoggingInterceptor"/>
    </extend-service>

</module>

When run, I get identical results whether or not I include the
above <extend-service> element, and whether or not it precedes the
above <service> element.


Bill

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


RE: [HiveMind] How to add interceptor to "embedded" service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Strange that that didn't work.  The fact that Divider is used as part of Calculator's implementation
does not affect your ability to add interceptors to it. Can we see the complete hivemodule.xml?

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Bill Lear [mailto:rael@zopyra.com] 
> Sent: Wednesday, September 17, 2003 2:47 PM
> To: commons-dev@jakarta.apache.org
> Subject: [HiveMind] How to add interceptor to "embedded" service
> 
> 
> I have the following module, and I would like to add a 
> logging interceptor to the Divider service, and only the 
> Divider service. How do I do this?
> 
> <module id="hivemind.examples" version="1.0.0">
>     <service id="Calculator" interface="hivemind.examples.Calculator">
>         <invoke-factory service-id="hivemind.BuilderFactory">
>             <construct class="hivemind.examples.impl.CalculatorImpl">
> 
>                 <set-service property="adder"
>                              service-id="org.puppies.math.Adder"/>
> 
>                 <set-service property="subtracter"
>                              
> service-id="org.kitties.math.Subtracter"/>
> 
>                 <set-service property="multiplier"
>                              
> service-id="org.gerbils.math.Multiplier"/>
> 
>                 <set-service property="divider"
>                              service-id="org.fishies.math.Divider"/>
>             </construct>
>         </invoke-factory>
>     </service>
> </module>
> 
> I am able to add an interceptor to the Calculator service as 
> a whole, but can't figure out how to wrap just the Divider by 
> a logger.
> 
> I tried adding the following:
> 
>     <extend-service service-id="org.fishies.math.Divider">
>         <interceptor service-id="hivemind.LoggingInterceptor"/>
>     </extend-service>
> 
> but it did nothing.  Harish did this in his example by adding 
> a separate module, log, with a simple module, but that seems 
> to require building a separate jar.
> 
> 
> Bill
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


RE: [HiveMind] How to add interceptor to "embedded" service

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
Strange that that didn't work.  The fact that Divider is used as part of Calculator's implementation
does not affect your ability to add interceptors to it. Can we see the complete hivemodule.xml?

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Bill Lear [mailto:rael@zopyra.com] 
> Sent: Wednesday, September 17, 2003 2:47 PM
> To: commons-dev@jakarta.apache.org
> Subject: [HiveMind] How to add interceptor to "embedded" service
> 
> 
> I have the following module, and I would like to add a 
> logging interceptor to the Divider service, and only the 
> Divider service. How do I do this?
> 
> <module id="hivemind.examples" version="1.0.0">
>     <service id="Calculator" interface="hivemind.examples.Calculator">
>         <invoke-factory service-id="hivemind.BuilderFactory">
>             <construct class="hivemind.examples.impl.CalculatorImpl">
> 
>                 <set-service property="adder"
>                              service-id="org.puppies.math.Adder"/>
> 
>                 <set-service property="subtracter"
>                              
> service-id="org.kitties.math.Subtracter"/>
> 
>                 <set-service property="multiplier"
>                              
> service-id="org.gerbils.math.Multiplier"/>
> 
>                 <set-service property="divider"
>                              service-id="org.fishies.math.Divider"/>
>             </construct>
>         </invoke-factory>
>     </service>
> </module>
> 
> I am able to add an interceptor to the Calculator service as 
> a whole, but can't figure out how to wrap just the Divider by 
> a logger.
> 
> I tried adding the following:
> 
>     <extend-service service-id="org.fishies.math.Divider">
>         <interceptor service-id="hivemind.LoggingInterceptor"/>
>     </extend-service>
> 
> but it did nothing.  Harish did this in his example by adding 
> a separate module, log, with a simple module, but that seems 
> to require building a separate jar.
> 
> 
> Bill
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org