You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Angelo Chen <an...@yahoo.com.hk> on 2009/03/20 15:07:04 UTC

T5: ordering of Dispatchers

Hi,

what is the execution order of dispatchers, last in, first out or first in,
last out? following are my two dispatchers, which will be called first and
why? thanks.

public static void
contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration,
                                                
@InjectService("MyDispatcher") MyDispatcher myDispatcher) {
       configuration.add("MyDispatcher", myDispatcher, "before:PageRender");
   }

   public static void
contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration,
                                                
@InjectService("HisDispatcher") HisDispatcher hisDispatcher) 
       configuration.add("HisDispatcher", hisDispatcher,
"before:PageRender");
   }


-- 
View this message in context: http://www.nabble.com/T5%3A-ordering-of-Dispatchers-tp22620974p22620974.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: ordering of Dispatchers

Posted by Robert Zeigler <ro...@scazdl.org>.
That's correct. Given your code, you would have:

hisDispatcher, then myDispatcher, and then PageRenderDispatcher.

Robert

On Mar 20, 2009, at 3/207:20 PM , Angelo Chen wrote:

>
> Thanks for all the answers.
>
> the ordering clauses, you meant something like this:
>
> configuration.add("MyDispatcher", myDispatcher, "before:PageRender");
> configuration.add("HisDispatcher", hisDispatcher,   
> "before:MyDispatcher");
>
> in this case HisDispatcher will be executed always before  
> MyDispatcher,
> right?
>
>
> Howard Lewis Ship wrote:
>>
>> There is no order unless you set it with ordering clauses (such as
>> "before:PageRender"). The order in which the contribute methods are
>> invoked across modules can vary with platform, release, or just
>> arbitrarily.  It is not specified. Likewise, the order in which the
>> contributed objects appear when passed to the MasterDispatcher  
>> service
>> will vary, unless locked down with ordering clauses.
>>
>> On Fri, Mar 20, 2009 at 7:07 AM, Angelo Chen <angelochen960@yahoo.com.hk 
>> >
>> wrote:
>>>
>>> Hi,
>>>
>>> what is the execution order of dispatchers, last in, first out or  
>>> first
>>> in,
>>> last out? following are my two dispatchers, which will be called  
>>> first
>>> and
>>> why? thanks.
>>>
>>> public static void
>>> contributeMasterDispatcher(OrderedConfiguration<Dispatcher>
>>> configuration,
>>>
>>> @InjectService("MyDispatcher") MyDispatcher myDispatcher) {
>>>       configuration.add("MyDispatcher", myDispatcher,
>>> "before:PageRender");
>>>   }
>>>
>>>   public static void
>>> contributeMasterDispatcher(OrderedConfiguration<Dispatcher>
>>> configuration,
>>>
>>> @InjectService("HisDispatcher") HisDispatcher hisDispatcher)
>>>       configuration.add("HisDispatcher", hisDispatcher,
>>> "before:PageRender");
>>>   }
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/T5%3A-ordering-of-Dispatchers-tp22620974p22620974.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>>
>>>
>>
>>
>>
>> -- 
>> Howard M. Lewis Ship
>>
>> Creator Apache Tapestry and Apache HiveMind
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://www.nabble.com/T5%3A-ordering-of-Dispatchers-tp22620974p22631207.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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


Re: T5: ordering of Dispatchers

Posted by Angelo Chen <an...@yahoo.com.hk>.
Thanks for all the answers.

the ordering clauses, you meant something like this:

configuration.add("MyDispatcher", myDispatcher, "before:PageRender"); 
configuration.add("HisDispatcher", hisDispatcher,  "before:MyDispatcher"); 

in this case HisDispatcher will be executed always before MyDispatcher,
right?


Howard Lewis Ship wrote:
> 
> There is no order unless you set it with ordering clauses (such as
> "before:PageRender"). The order in which the contribute methods are
> invoked across modules can vary with platform, release, or just
> arbitrarily.  It is not specified. Likewise, the order in which the
> contributed objects appear when passed to the MasterDispatcher service
> will vary, unless locked down with ordering clauses.
> 
> On Fri, Mar 20, 2009 at 7:07 AM, Angelo Chen <an...@yahoo.com.hk>
> wrote:
>>
>> Hi,
>>
>> what is the execution order of dispatchers, last in, first out or first
>> in,
>> last out? following are my two dispatchers, which will be called first
>> and
>> why? thanks.
>>
>> public static void
>> contributeMasterDispatcher(OrderedConfiguration<Dispatcher>
>> configuration,
>>
>> @InjectService("MyDispatcher") MyDispatcher myDispatcher) {
>>       configuration.add("MyDispatcher", myDispatcher,
>> "before:PageRender");
>>   }
>>
>>   public static void
>> contributeMasterDispatcher(OrderedConfiguration<Dispatcher>
>> configuration,
>>
>> @InjectService("HisDispatcher") HisDispatcher hisDispatcher)
>>       configuration.add("HisDispatcher", hisDispatcher,
>> "before:PageRender");
>>   }
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-ordering-of-Dispatchers-tp22620974p22620974.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
> 
> 
> 
> -- 
> Howard M. Lewis Ship
> 
> Creator Apache Tapestry and Apache HiveMind
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/T5%3A-ordering-of-Dispatchers-tp22620974p22631207.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: ordering of Dispatchers

Posted by Howard Lewis Ship <hl...@gmail.com>.
There is no order unless you set it with ordering clauses (such as
"before:PageRender"). The order in which the contribute methods are
invoked across modules can vary with platform, release, or just
arbitrarily.  It is not specified. Likewise, the order in which the
contributed objects appear when passed to the MasterDispatcher service
will vary, unless locked down with ordering clauses.

On Fri, Mar 20, 2009 at 7:07 AM, Angelo Chen <an...@yahoo.com.hk> wrote:
>
> Hi,
>
> what is the execution order of dispatchers, last in, first out or first in,
> last out? following are my two dispatchers, which will be called first and
> why? thanks.
>
> public static void
> contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration,
>
> @InjectService("MyDispatcher") MyDispatcher myDispatcher) {
>       configuration.add("MyDispatcher", myDispatcher, "before:PageRender");
>   }
>
>   public static void
> contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration,
>
> @InjectService("HisDispatcher") HisDispatcher hisDispatcher)
>       configuration.add("HisDispatcher", hisDispatcher,
> "before:PageRender");
>   }
>
>
> --
> View this message in context: http://www.nabble.com/T5%3A-ordering-of-Dispatchers-tp22620974p22620974.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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


Re: T5: ordering of Dispatchers

Posted by Robert Zeigler <ro...@scazdl.org>.
It's an ordered configuration; it's executed in the order specified.
In the event that the constraints don't provide a clear ordering (as  
in your example), the ordering is undetermined; I wouldn't count on  
any consistent ordering.

Robert

On Mar 20, 2009, at 3/209:07 AM , Angelo Chen wrote:

>
> Hi,
>
> what is the execution order of dispatchers, last in, first out or  
> first in,
> last out? following are my two dispatchers, which will be called  
> first and
> why? thanks.
>
> public static void
> contributeMasterDispatcher(OrderedConfiguration<Dispatcher>  
> configuration,
>
> @InjectService("MyDispatcher") MyDispatcher myDispatcher) {
>       configuration.add("MyDispatcher", myDispatcher,  
> "before:PageRender");
>   }
>
>   public static void
> contributeMasterDispatcher(OrderedConfiguration<Dispatcher>  
> configuration,
>
> @InjectService("HisDispatcher") HisDispatcher hisDispatcher)
>       configuration.add("HisDispatcher", hisDispatcher,
> "before:PageRender");
>   }
>
>
> -- 
> View this message in context: http://www.nabble.com/T5%3A-ordering-of-Dispatchers-tp22620974p22620974.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


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