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 2008/10/11 11:47:03 UTC

t5: starting a service automatically

Hi,

I have a service that uses Quartz to fire an event every minute, I'd like to
know how to start this service once the application is loaded? thanks.

Angelo
-- 
View this message in context: http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931132.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: starting a service automatically

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Lubor,

Your approach works, thanks.


Lubor Gajda wrote:
> 
> Angelo,
> 
> How are you instantiating scheduler in your application? Are you using
> tapestry IOC module?
> 
> /lubor
> 
> On Sat, Oct 11, 2008 at 10:55 AM, Angelo Chen
> <an...@yahoo.com.hk>wrote:
> 
>>
>> Hi Lubor,
>>
>> Thanks for the quick reply, is the scheduler here Quartz? I can't
>> understand
>> fully how to use this, any more details? Thanks.
>>
>> Angelo
>>
>>
>> Lubor Gajda wrote:
>> >
>> > Hi Angelo,
>> >
>> > You can try this:
>> >
>> > public static void
>> > contributeRegistryStartup(OrderedConfiguration<Runnable>
>> > configuration, final Scheduler scheduler) {
>> >         configuration.add("SchedulerStartup", new Runnable() {
>> >            public void run() {
>> >                scheduler.start()
>> >            }
>> >        });
>> > }
>> >
>> > Regards
>> > Lubor
>> >
>> > On Sat, Oct 11, 2008 at 10:47 AM, Angelo Chen
>> > <an...@yahoo.com.hk>wrote:
>> >
>> >>
>> >> Hi,
>> >>
>> >> I have a service that uses Quartz to fire an event every minute, I'd
>> like
>> >> to
>> >> know how to start this service once the application is loaded? thanks.
>> >>
>> >> Angelo
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931132.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
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931178.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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19940579.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: starting a service automatically

Posted by Lubor Gajda <lu...@gmail.com>.
Angelo,

How are you instantiating scheduler in your application? Are you using
tapestry IOC module?

/lubor

On Sat, Oct 11, 2008 at 10:55 AM, Angelo Chen <an...@yahoo.com.hk>wrote:

>
> Hi Lubor,
>
> Thanks for the quick reply, is the scheduler here Quartz? I can't
> understand
> fully how to use this, any more details? Thanks.
>
> Angelo
>
>
> Lubor Gajda wrote:
> >
> > Hi Angelo,
> >
> > You can try this:
> >
> > public static void
> > contributeRegistryStartup(OrderedConfiguration<Runnable>
> > configuration, final Scheduler scheduler) {
> >         configuration.add("SchedulerStartup", new Runnable() {
> >            public void run() {
> >                scheduler.start()
> >            }
> >        });
> > }
> >
> > Regards
> > Lubor
> >
> > On Sat, Oct 11, 2008 at 10:47 AM, Angelo Chen
> > <an...@yahoo.com.hk>wrote:
> >
> >>
> >> Hi,
> >>
> >> I have a service that uses Quartz to fire an event every minute, I'd
> like
> >> to
> >> know how to start this service once the application is loaded? thanks.
> >>
> >> Angelo
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931132.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
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931178.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: How to return .tml content as a String from a Java class?

Posted by su...@gmx.de.
Where is this?

This is from the Tapestry5 accordion - and it only takes Strings - no other components can be put inside the Accordion.

-------- Original-Nachricht --------
> Datum: Mon, 13 Oct 2008 13:27:00 +0200
> Von: Joachim Van der Auwera <jo...@progs.be>
> An: Tapestry users <us...@tapestry.apache.org>
> Betreff: Re: How to return .tml content as a String from a Java class?

> You may want to look at the "Accordion" component in equanda-tapestry5
> 
> Kind regards,
> Joachim
> 
> superoverdrive@gmx.de wrote:
> > The SlidingPanel (as it currently is), expects an Array of Strings that
> contain the contents of the SlidingPanel:
> >
> > E.g.:
> >
> > 	public String[] getDetails(){
> > 		return new String[]{"Content A","Content B","Content C"};
> > 	}
> >
> > Assuming, I want to return components instead of Strings, how would I
> access them in Java code?
> >
> > e.g.
> >
> > ComponentA.tml
> > ComponentB.tml
> > ComponentC.tml
> >
> > Can I "inject" them somehow and access their contents as a String?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 
> 
> -- 
> Joachim Van der Auwera
> PROGS bvba, progs.be
> 
> 
> ---------------------------------------------------------------------
> 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: How to return .tml content as a String from a Java class?

Posted by su...@gmx.de.
This is just a simple opening/closing. I am looking for an Accordion with a transition.

-------- Original-Nachricht --------
> Datum: Mon, 13 Oct 2008 13:27:00 +0200
> Von: Joachim Van der Auwera <jo...@progs.be>
> An: Tapestry users <us...@tapestry.apache.org>
> Betreff: Re: How to return .tml content as a String from a Java class?

> You may want to look at the "Accordion" component in equanda-tapestry5
> 
> Kind regards,
> Joachim
> 
> superoverdrive@gmx.de wrote:
> > The SlidingPanel (as it currently is), expects an Array of Strings that
> contain the contents of the SlidingPanel:
> >
> > E.g.:
> >
> > 	public String[] getDetails(){
> > 		return new String[]{"Content A","Content B","Content C"};
> > 	}
> >
> > Assuming, I want to return components instead of Strings, how would I
> access them in Java code?
> >
> > e.g.
> >
> > ComponentA.tml
> > ComponentB.tml
> > ComponentC.tml
> >
> > Can I "inject" them somehow and access their contents as a String?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >   
> 
> 
> -- 
> Joachim Van der Auwera
> PROGS bvba, progs.be
> 
> 
> ---------------------------------------------------------------------
> 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: How to return .tml content as a String from a Java class?

Posted by Joachim Van der Auwera <jo...@progs.be>.
You may want to look at the "Accordion" component in equanda-tapestry5

Kind regards,
Joachim

superoverdrive@gmx.de wrote:
> The SlidingPanel (as it currently is), expects an Array of Strings that contain the contents of the SlidingPanel:
>
> E.g.:
>
> 	public String[] getDetails(){
> 		return new String[]{"Content A","Content B","Content C"};
> 	}
>
> Assuming, I want to return components instead of Strings, how would I access them in Java code?
>
> e.g.
>
> ComponentA.tml
> ComponentB.tml
> ComponentC.tml
>
> Can I "inject" them somehow and access their contents as a String?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>   


-- 
Joachim Van der Auwera
PROGS bvba, progs.be


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


How to return .tml content as a String from a Java class?

Posted by su...@gmx.de.
The SlidingPanel (as it currently is), expects an Array of Strings that contain the contents of the SlidingPanel:

E.g.:

	public String[] getDetails(){
		return new String[]{"Content A","Content B","Content C"};
	}

Assuming, I want to return components instead of Strings, how would I access them in Java code?

e.g.

ComponentA.tml
ComponentB.tml
ComponentC.tml

Can I "inject" them somehow and access their contents as a String?

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


Re: t5: starting a service automatically

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Lubor,

Thanks for the quick reply, is the scheduler here Quartz? I can't understand
fully how to use this, any more details? Thanks.

Angelo


Lubor Gajda wrote:
> 
> Hi Angelo,
> 
> You can try this:
> 
> public static void
> contributeRegistryStartup(OrderedConfiguration<Runnable>
> configuration, final Scheduler scheduler) {
>         configuration.add("SchedulerStartup", new Runnable() {
>            public void run() {
>                scheduler.start()
>            }
>        });
> }
> 
> Regards
> Lubor
> 
> On Sat, Oct 11, 2008 at 10:47 AM, Angelo Chen
> <an...@yahoo.com.hk>wrote:
> 
>>
>> Hi,
>>
>> I have a service that uses Quartz to fire an event every minute, I'd like
>> to
>> know how to start this service once the application is loaded? thanks.
>>
>> Angelo
>> --
>> View this message in context:
>> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931132.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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931178.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: starting a service automatically

Posted by Lubor Gajda <lu...@gmail.com>.
Hi Angelo,

You can try this:

public static void contributeRegistryStartup(OrderedConfiguration<Runnable>
configuration, final Scheduler scheduler) {
        configuration.add("SchedulerStartup", new Runnable() {
           public void run() {
               scheduler.start()
           }
       });
}

Regards
Lubor

On Sat, Oct 11, 2008 at 10:47 AM, Angelo Chen <an...@yahoo.com.hk>wrote:

>
> Hi,
>
> I have a service that uses Quartz to fire an event every minute, I'd like
> to
> know how to start this service once the application is loaded? thanks.
>
> Angelo
> --
> View this message in context:
> http://www.nabble.com/t5%3A-starting-a-service-automatically-tp19931132p19931132.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: starting a service automatically

Posted by Martijn Brinkers <ma...@gmail.com>.
EagerLoad'ing a service means that the service is instantiated when the
registry is started. Non-eagerloaded services are instantiated when the
service is used for the first time. Because you want you Quartz service
to be running at the start you can add the EagerLoad annotation to make
sure that the Quartz service is started at registry start. 

> I just discover this EagerLoad, is it correct that either of one works,
> need to use both?

No afaik you do not need both

Martijn

On Sun, 2008-10-12 at 04:06 -0700, Angelo Chen wrote:
> Hi Martijn,
> 
> I use public static void contributeRegistryStartup, and it works.
> I just discover this EagerLoad, is it correct that either of one works, no
> need to use both?
> 
> Angelo
> 
> 
> Martijn Brinkers (List)-2 wrote:
> > 
> > You can flag the service to eager load (see @EagerLoad)
> > 
> > Martijn Brinkers
> > 
> > On Sat, 2008-10-11 at 02:47 -0700, Angelo Chen wrote:
> >> Hi,
> >> 
> >> I have a service that uses Quartz to fire an event every minute, I'd like
> >> to
> >> know how to start this service once the application is loaded? thanks.
> >> 
> >> Angelo
> > 
> > 
> > ---------------------------------------------------------------------
> > 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: starting a service automatically

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi Martijn,

I use public static void contributeRegistryStartup, and it works.
I just discover this EagerLoad, is it correct that either of one works, no
need to use both?

Angelo


Martijn Brinkers (List)-2 wrote:
> 
> You can flag the service to eager load (see @EagerLoad)
> 
> Martijn Brinkers
> 
> On Sat, 2008-10-11 at 02:47 -0700, Angelo Chen wrote:
>> Hi,
>> 
>> I have a service that uses Quartz to fire an event every minute, I'd like
>> to
>> know how to start this service once the application is loaded? thanks.
>> 
>> Angelo
> 
> 
> ---------------------------------------------------------------------
> 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-starting-a-service-automatically-tp19931132p19940590.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: starting a service automatically

Posted by Martijn Brinkers <ma...@gmail.com>.
You can flag the service to eager load (see @EagerLoad)

Martijn Brinkers

On Sat, 2008-10-11 at 02:47 -0700, Angelo Chen wrote:
> Hi,
> 
> I have a service that uses Quartz to fire an event every minute, I'd like to
> know how to start this service once the application is loaded? thanks.
> 
> Angelo


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