I am not sure how to best expose such a chain to spring, maybe it is possible but I don't know how. You can however quite easily port this to spring though. Just have a ChainInterface

void doSomeWork();

an implementation:

public class FirstChainedImplementation implements ChainInterface{

   private ChainInterface nextInChain;

   public FirstChanedImplementation(ChainInterface nextInChain) {
      this.nextInChain = nextInChain;
   }
public void doSomeWork() {
      ....
      if(nextInChain != null) {
             nextInChain.doSomeWork();
       }

   }

Have a bunch of implementing serviceses and define them in your spring as such:

<bean id="firstChanedImplementation" class="com.domain.yourFirstImplementingService">
   <constructor-arg ref="secondChanedImplementation" index="0">
</bean>

<bean id="secondChanedImplementation" class="com.domain.yourSecondImplementingService">
   <constructor-arg index="0"><null/></constructor-arg>
</bean>

... add as many as you need. Obviously you can clean this up making a nice abstract class that does the chaining logic and leave the implementations to just care about the work they should perform.

I prefer doing it this way and use Tapetsry for all web tier related issues. This allows me to port all my low level code to any application which might not know anything about the web or tapestry.

Hope it helps,
Joost

Juan E. Maya wrote:
Some chains defined by our self created using Tapestry IoC using
http://tapestry.apache.org/tapestry5/tapestry-ioc/command.html

This allows to have chains that can be contributed in any module
making the application truly modular. Spring (as far as i know)
doesn't have anything similar to this, am i wrong?

The point is that we require to inject services defined by ourselves
using tapestry IoC to Spring Beans. Tapestry-Spring allows this kind
of integration in a web application, we want to have the same behavior
a standalone application.

On 11/14/09, Joost Schouten (ml) <joost...@jsportal.com> wrote:
What "Chains of Responsibilities" are you refering to?

Juan E. Maya wrote:
Joost i am aware of Spring Integration with Quartz and we are using
it. The problem is that we are using some Chains of Responsibilities
defined in tapestry in our Spring beans (using the filter integration
this is not a problem at all) however if we want to have the same
functionality in a standalone mode we would not be able anything at
all from tapestry ioc.

I know it's a bit weird to mix IoC, sadly the decision was to use
spring instead of Tapestry IoC and in a few cases make use of tapestry
IoC (specially to make use of the distributed configuration). That's
why we need to have Tapestry Services inside our Spring beans in stand
alone mode.

Thanks a lot for ur help

On 11/14/09, Fernando Padilla <f...@alum.mit.edu> wrote:

what do your "jobs" do?  Why do they need anything from Tapestry?

On 11/13/09 2:54 PM, Joost Schouten (ml) wrote:

Do you mean timed java jobs (java equivalent of cron jobs)? If so,
since you are already working with Spring, have a look at:
http://static.springsource.org/spring/docs/2.5.x/reference/scheduling.html



Not tapestry, but very simple too ;-)

Good luck,
Joost

Juan E. Maya wrote:

Hi, We are using Tapestry-Spring integration in our web tear without
problems but we require to have a standalone application that will
take care of the job executions. Has anybody successfully created such
 integration ? I was checking the code of the Spring SpringModuleDef
and it's highly tied to the ServletContext.

Any tips would be highly appreciated, right now i am thinking about
implementing my own  SpringModuleDef but there might be a easier that
i am not aware of.

Thanks a lot for your help

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to