[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openejb-user
Subject:    Re: need suggestion on designing business interfaces
From:       David Blevins <david.blevins () visi ! com>
Date:       2009-03-18 23:34:35
Message-ID: A2EADFFD-734D-4CB1-A58E-194BAD00B60E () visi ! com
[Download RAW message or body]


On Mar 17, 2009, at 4:49 AM, is_maximum wrote:

>
> Hi
> before I start let me tell you that our problem is the interceptors
> Think of a bunch of business interfaces and lots of business  
> methods. Each
> method may call a dozen methods from other services.
> In the other hand because of some policy we have to put some  
> interceptors on
> our methods, one example is an interceptor which is responsible for  
> log all
> the incoming parameters. (sadly we need to log everything)
>
> Now the problem is when method M1 from interface S1 calls methods M2  
> and M3
> and M4 from S2, S3, S4 respectively because each method may be called
> directly by the client so all the methods have the same interceptor  
> C1 (say
> to log the parameter), now we want no interceptor being invoked from  
> other
> services when they are called locally from another business method  
> unless
> they are called directly from the client
>
> One solution is to define a local method and a remote method and the  
> later
> marked with required interceptors and also remote methods calls local
> methods.
>
> Another solution is using Facade pattern but we are reluctant to use  
> this
> pattern since we have implemented services and no time for further  
> task.
>
> I am eager to hear your idea and know your experience on this problem

Not sure I have any thoughts other than you could have the  
SessionContext injected (via @Resource) into the interceptor and then  
call the sessionContext.getInvokedBusinessInterface() method to see  
which interface was used by the client.

-David

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic