Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Good practice for Tomcat and webapps.

Hi Bruno,

I think you will want to put your observer protocol aspect in a jar in
shared/lib, perhaps in the same jar that your singleton lives in. Then your
core tasks webapp can access the aspect and register itself as an observer. 

I'm not quite clear what information you want to know about using AspectJ
with Tomcat. I wrote about how the Glassbox Inspector works inside Tomcat
(and other containers), tracking shared performance monitoring state among
Web apps, including working with JSP's. See
http://www.ibm.com/developerworks/java/library/j-aopwork10/ and
http://www.ibm.com/developerworks/java/library/j-aopwork12/ for more
information about integrating with Web apps and running Tomcat with
load-time weaving. 

In your case, you could certainly use load-time weaving. Alternatively, you
could do build-time weaving, by creating a project (in ant and Eclipse) with
the observer aspect (probably with the singleton) this project can then be
on the aspect path of the Web service project. Does the aspect need to weave
into (affect) any of the other projects? It doesn't need to if they are just
registering a callback with the aspect ...

If you want to affect code in JSP's load-time weaving is easier than
precompiling and weaving in a build, although you can do that too.

-----Original Message-----
From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Bruno Harbulot
Sent: Wednesday, March 01, 2006 10:51 AM
To: aspectj-users@xxxxxxxxxxx
Subject: [aspectj-users] Good practice for Tomcat and webapps. 

Hello,

I would like to use AspectJ in a project that uses Tomcat (5.5.15).

It is an application that comprises a Web Service (in Axis), a webpage 
servlet and another webapp (not mapped to any web page) that does core 
background tasks depending on what happens on the webpage or on the 
webservice side (it is a webapp only because it is the only way I found 
to load it when Tomcat is launched.)
To update the webpage when the web service is queried, there is a 
singleton in the 'shared' Tomcat directory. This way, the three webapps 
share this singleton (otherwise they are in different classloader 
environments).

I would like to use an Observer pattern (via an Aspect) to notify the 
core tasks webapp when an event is received on the web service side.

Is there a "good practice" when it comes to using such an aspect across 
several web applications, in Tomcat? (I suppose it might be linked to 
the question of weaving into several Eclipse projects, that was 
discussed on this list in mid-January.)

Is load-time weaving necessary? (Would it be necessary for making this 
work with JSP too?)

I am looking for a design simple enough so that I can show it to someone 
who has never done any AOP at all. I have got full control of the Tomcat 
server (generating deployable 'war' files is not really important).

Thanks,

Bruno.
_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users




Back to the top