Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Synchronous execution of Runnable

Well I changed the pointcut definition to 

1 <public pointcut syncOCRTaskOperation():call (* OCRTask.start() );>
2<public pointcut syncOCRTaskOperation():execution (* OCRTask.start() );>

but they did not work. 

I am using Doug Lea concurrency library. I need a pool of threads 
<PooledExecutor.class>  the pool contains threads that executes Tasks.  These 
tasks must  Runnable /Thread (OCRTask).    I do not want to change Doug Lea 
code to execute this tasks in a synchronous way.  

When I wave the code, the aspectj compiler does not crosscuts the library that 
is the responsible to execute the task.  Do you have any idea to work around 
this?
Alfonso

On Wednesday 16 June 2004 23:27, Nicholas Lesiecki wrote:
> Wouldn't you need to intercept the start method of the thread that uses
> OCRTask instead?
>
> --nick
>
> On Jun 16, 2004, at 2:38 AM, Alfonso Olias Sanz wrote:
> > Hi there,
> >
> > I want do make synchronous execution of a Runnable class,, so I did
> > this
> > ###############################################
> > public aspect SynchronousOCRTaskExecutionAspect {
> > 	public pointcut syncOCRTaskOperation():execution (* OCRTask.run() );
> >
> > 	void around():  syncOCRTaskOperation() {
> > 		//TODO Whatever instead run method
> >                OCRTask.fooStaticMethod();
> > 	}
> > }
> > ###############################################
> >
> > As an execution join point is picked out where it is actually defined.
> >  But I
> > have my doubt if the is the following.  The  run method calls
> > <OCRTask.fooStaticMethod();> . By using this aspect do I avoid the
> > execution
> > of that static method in a separate thread?  because the around advice
> > catches the execution of the run method. Am I right?
> > Alfonso
> >
> >
> > -----------------------------------------------------------------------
> > --------------------------------------------
> > Este correo electrónico y, en su caso, cualquier fichero anexo al
> > mismo, contiene información de carácter confidencial exclusivamente
> > dirigida a su destinatario o destinatarios. Queda prohibida su
> > divulgación, copia o distribución a terceros sin la previa
> > autorización escrita de Indra. En el caso de haber recibido este
> > correo electrónico por error, se ruega notificar inmediatamente esta
> > circunstancia mediante reenvío a la dirección electrónica del
> > remitente.
> >
> > The information in this e-mail and in any attachments is confidential
> > and solely for the attention and use of the named addressee(s). You
> > are hereby notified that any dissemination, distribution or copy of
> > this communication is prohibited without the prior written consent of
> > Indra. If you have received this communication in error, please,
> > notify the sender by reply e-mail
> > _______________________________________________
> > aspectj-users mailing list
> > aspectj-users@xxxxxxxxxxx
> > http://dev.eclipse.org/mailman/listinfo/aspectj-users
>
> Nicholas Lesiecki
> Software Craftsman, specializing in J2EE,
> Agile Methods, and aspect-oriented programming
>
> Books:
> * Mastering AspectJ: http://tinyurl.com/66vf
> * Java Tools for Extreme Programming: http://tinyurl.com/66vt
>
> Articles on AspectJ:
> * http://tinyurl.com/66vu and http://tinyurl.com/66vv
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> http://dev.eclipse.org/mailman/listinfo/aspectj-users
-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.

The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail


Back to the top