[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [aspectj-dev] A little help with perthis/pertarget ...
|
In case this helps you I decompiled end extracted one of the advised methods:
public List getPlanGrpPurpInfo(String dbName, long planId, String grpPurpose)
throws Exception
{
String s;
long l;
String s1;
s = dbName;
l = planId;
s1 = grpPurpose;
ProfileAspect.ajc$perObjectBind(this);
Connection conn;
List results;
CallableStatement cs;
if(ProfileAspect.hasAspect(this))
ProfileAspect.aspectOf(this).ajc$before$com_ing_uds_aspect_ProfileAspect$1$993275df();
conn = null;
results = new ArrayList();
cs = null;
List list1;
List list;
try
{
conn = getConnectionAdmin();
cs = conn.prepareCall("{call " + dbName + ".." + "gPlanGrpPurp(?, ?, ?, ?, ?)}");
cs.setString(1, grpPurpose);
cs.setLong(2, planId);
cs.registerOutParameter(3, 2);
cs.registerOutParameter(4, 1);
cs.registerOutParameter(5, 1);
cs.execute();
results.add(new Long(cs.getLong(3)));
results.add(cs.getString(4));
results.add(cs.getString(5));
list = results;
}
catch(Exception e)
{
LOG.error(e.getMessage(), e);
throw e;
}
DB.close(conn, cs);
list1 = list;
break MISSING_BLOCK_LABEL_306;
Exception exception;
exception;
DB.close(conn, cs);
throw exception;
Throwable throwable;
throwable;
if(ProfileAspect.hasAspect(this))
{
Object aobj[] = new Object[3];
aobj[0] = s;
aobj[1] = Conversions.longObject(l);
aobj[2] = s1;
ProfileAspect.aspectOf(this).ajc$after$com_ing_uds_aspect_ProfileAspect$2$993275df(Facto
ry.makeJP(ajc$tjp_10, this, this, aobj));
}
throw throwable;
if(ProfileAspect.hasAspect(this))
{
Object aobj1[] = new Object[3];
aobj1[0] = s;
aobj1[1] = Conversions.longObject(l);
aobj1[2] = s1;
ProfileAspect.aspectOf(this).ajc$after$com_ing_uds_aspect_ProfileAspect$2$993275df(Facto
ry.makeJP(ajc$tjp_10, this, this, aobj1));
}
return list1;
}
On Thu, Jul 10, 2008 at 1:48 PM, Dan Bush <
dan.bush@xxxxxxxxx> wrote:
Probably ten more lines of code to your example would confirm. What about spawning off a few threads which simply to the System.out in run()?On Thu, Jul 10, 2008 at 1:44 PM, Eric Bodden <
eric.bodden@xxxxxxxxxxxxxx> wrote:
> 1) The methods are not static.
>
> 2) I am using a named point cut called "services()". Not sure if that
> matters at all or not. I was actually expecting / wondering why I not have
> tired something like:
>
> aspect ProfileAspect perthis(execution(services())) {
That does not work. You would need perthis(services()). But it should
not matter anyway.
> 3) The methods I am point cutting are EJB methods. So there are multiple
> threads of execution hitting them sanctimoniously. That's why I can't use
> the singleton aspect. The start time gets stomped on ... I am just detailing
> the actual scenario in case you thing there would be something special about
> it which precluded the advice from kicking in there since it obviously works
> as expected in your test.
I wonder what the semantics of perthis is w.r.t. multi-threading. I
have no idea. From what you reported so far, I almost think that you
hit a bug.
Eric
--