Practical AOP woes – Part II

I have managed to make AspectJ LTW work in WebSphere Portal with the help of GlassBox 2.0. Installation of the GlassBox Inspector was easy

Generic JVM arguments are

-Xbootclasspath/p:C:\IBM\glassbox\java14Adapter.jar -Xbootclasspath/a:C:\IBM\glassbox\createJavaAdapter.jar;
C:\IBM\glassbox\aspectj14Adapter.jar;
C:\IBM\glassbox\aspectjweaver.jar ${WPS_JVM_ARGUMENTS_EXT} -Daspectwerkz.classloader.preprocessor=
org.aspectj.ext.ltw13.ClassPreProcessorAdapter
-Ddb2j.system.home=${WPS_HOME}/cloudscape -Xp128k,64k -Xk40000

 

Classpath is

C:\IBM\glassbox\glassboxMonitor.jar;
C:\eclipse\workspace\FacesPortletTracker\
com\faces\tracker\jars\portlettracker.jar

portlettracker.jar contains my aspect class and aop.xml

My aspect looks like this

 

import javax.portlet.PortletException;
import com.facesportlet.tracker.FacesPortletTracker;
public aspect FacesGenericPortletAspect {
pointcut portletTracker() :
execution (* com.facesportlet.tracker.FacesPortletTracker.*(..)

	  throws PortletException );
	before(): portletTracker(){
	 System.out.println( "Faces Portlet tracked");
	 }
 }

GlassBox expects the aop.xml to be like this.

<aspectj>
	<weaver options="-showWeaveInfo -verbose -debug">
		<include within="com.facesportlet.tracker.FacesPortletTracker"/>
	</weaver>
	<aspects>
		<aspect name="com.faces.tracker.FacesGenericPortletAspect"/>
	</aspects>
</aspectj>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: