Title: Message

Ahhhh.  Yes, he does want pipelines.  I’m sorry.  I guess I should have read your question a bit more, maybe.  I thought you were trying to “decorate” methods called on your service objects with security checks.  Of course, if your pages are truly written the Tapestry4 way, the listener methods will simply be delegating to a service method somewhere and you could put the security interceptor on the services.  That’s what I am going to do in my application.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 01, 2006 2:49 AM
To: '[email protected]'
Subject: RE: Pipeline example

 

Yes, you do want pipelines ;)

 

 

Just implement ListenerInvokerFilter like that:

 

public class TransactionFilter implements ListenerInvokerFilter {

 

 private PersistenceService svc;
 private Log log;
 
 public TransactionFilter( PersistenceService s ) {
  svc = s;
 }
 
 public void setLog( Log l ) {
  log = l;
 }
 
 public void invokeListener(IActionListener listener, IComponent component,
   IRequestCycle cycle, ListenerInvoker invoker) {
  
  try {
   log.debug("about to invoke " + listener );
   invoker.invokeListener( listener, component, cycle );
   log.debug("committing ... ");
   svc.commit();
  } catch (RuntimeException e) { //TODO treat StaleObjectException separately
   svc.rollback();
   throw e;
  }
  
 }

 

}

 

and wire it up like this:

 

<service-point id="ListenerFilter" interface="org.apache.tapestry.services.ServletRequestServicerFilter">

<invoke-factory>

<construct class="your.package.TransactionFilter" />

</invoke-factory>

</service-point>

<contribution configuration-id="tapestry.listener.ListenerInvoker">

<filter name="ListenerFilter" object="service:ListenerFilter"/>

</contribution>

 

hth

-----Original Message-----
From: Carpenter, Scott [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 01, 2006 7:40 AM
To: [email protected]
Subject: RE: Pipeline example

Yes, I did read that article and, to me, interceptors sound alot like pipelines. The whole idea for pipelines came from a suggestion by HLS in the link below which was originally submitted by another member of our team.

-----Original Message-----
From: James Carman [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 28, 2006 7:08 PM
To: [email protected]
Subject: RE: Pipeline example

Have you looked into interceptors?  I talk about them in my article.  I think that's what you want here.  At least, it sounds like it

 

http://www.theserverside.com/articles/article.tss?l=HivemindBuzz

 

 

 


From: Carpenter, Scott [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 28, 2006 7:21 PM
To: [email protected]
Subject: Pipeline example

 

I am new to Hivemind and Tapestry and have been reading the documentation. I believe I want to use Pipelines to secure certain methods in an application - specifically to receive an event before and after Tapestry's ListenerMap invokes the listener method. That way we can implement method-level security access control on individual actions for each page. A pipeline example would really help get me started. Thanks.

 

Reply via email to