hivemind-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Wannheden <knut.wannhe...@gmail.com>
Subject Re: Reflection vs. Javassist
Date Tue, 21 Sep 2004 14:13:42 GMT
Can't this be simplified by using the HiveMind ObjectProviders? Then
you wouldn't need the first service anymore:

<service-point
  id="RollbackOnlyInterceptorFactory"
  interface="org.apache.hivemind.ServiceInterceptorFactory">
  <invoke-factory service-id="hivemind.BuilderFactory">
    <construct
      class="example.interceptor.factory.MethodInterceptorFactory">
      <set-object
        value="instance:example.interceptor.RollbackOnlyInterceptor"
        property="methodInterceptor"/>
    </construct>
  </invoke-factory>
</service-point>

--knut

On Tue, 21 Sep 2004 10:04:19 -0400, James Carman
<james@carmanconsulting.com> wrote:
> I can do you one better.  I can include the source code for a
> MethodInterceptorFactory class that I wrote.  Now, this class is dependent
> upon the AOP Alliance (http://sourceforge.net/projects/aopalliance) jar
> file, but it makes creating interceptors EASY!  All you have to do is
> implement the MethodInterceptor interface (from AOP Alliance).  This class
> (or some version similar to it) may make it into the hivemind-lib module in
> version 1.1, so make sure you switch over to the "official" one once it
> arrives.
> 
> Here's an example of how to use it in a hivemodule.xml file...
> 
> <service-point
>   id="RollbackOnlyInterceptor"
>   interface="org.aopalliance.intercept.MethodInterceptor">
>   <invoke-factory service-id="hivemind.BuilderFactory">
>     <construct class="example.interceptor.RollbackOnlyInterceptor" />
>   </invoke-factory>
> </service-point>
> 
> <service-point
>   id="RollbackOnlyInterceptorFactory"
>   interface="org.apache.hivemind.ServiceInterceptorFactory">
>   <invoke-factory service-id="hivemind.BuilderFactory">
>     <construct
>       class="example.interceptor.factory.MethodInterceptorFactory">
>       <set-service
>         service-id="RollbackOnlyInterceptor"
>         property="methodInterceptor"/>
>     </construct>
>   </invoke-factory>
> </service-point>
> 
> <implementation service-id="ProjectServices">
>   <interceptor service-id="RollbackOnlyInterceptorFactory"/>
> </implementation>
> 
> Here, we declared the actual interceptor itself as a service and told the
> factory which service to call to intercept the methods.
>

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


Mime
View raw message