Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Is this possible with AOP/AspectJ?

Title: RE: [aspectj-users] Is this possible with AOP/AspectJ?

I had the same problem and someone else on the list provided a solution.  The basic idea is to

1) Use AOP to add a method called "invoke" to your session bean.
   This method should take the following parameters:
   - a Context object that can contain your id
   - the name of the method to be invoked using reflection
   - an array of Class objects that describe the parameter types
   - an array of Objects that are the parameter values

2) Use AOP to intercept calls to the session bean methods on the client side.
   It should create or retrieve the Context object and then
   call the "invoke" method that you added to the session bean in step 1.

This works, but it has at least two problems.
1) You lose the ability to specify different EJB security for individual methods of the session bean.
2) Ditto for transaction semantics.

If you want to try this solution, I can send you some example code.

> -----Original Message-----
> From: mdempfle@xxxxxxxxxx [mailto:mdempfle@xxxxxxxxxx]
> Sent: Thursday, July 24, 2003 5:08 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: [aspectj-users] Is this possible with AOP/AspectJ?
>
>
> Hi,
>
> I'm new to AOP and want to find out if AOP is powerful enough
> to help me with
> my problem.
>
> We want to do performance measurements with ejb's. We have a
> framework with ~
> 1000 Clients where each of the clients have a unique id.
>
> My problem is the results have to have these ids included.
> The problem occurs
> at stateless session beans. A inforation for the bean has to
> be in parameters
> (the new id as well). Therefore AOP should be able to expand
> each function
> call  with an extra parameter and even beans which were
> called within this new
> bean have to use this parameter for all this functions.
> Can AOP expand (change the method signature) EJB's at all? (and the
> descriptors which are in xml) ?
>
> Is this possilbe with AOP / AspectJ ?
>
> I was thinking of another solution where the client creates a
> statefull
> session bean that collects the data. But here I have the
> problem that the bean
> that should do the measurements (the points are weaved which
> AOP) only has the
> same client and I don't know if it is somehow possible to
> find the right
> statefull session bean.
>
> Any help (ideas) how this could be done would be great.
>
> Thanks,
> Michael Dempfle
>  
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
>



***********************************************************************************
WARNING: All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
************************************************************************************

Back to the top