Re: ServletContextListener equivalent in Tapestry

2006-12-26 Thread Josh Joy
Hi All,

I was able to implement the below for
hivemind.startup...however is 
there such a thing as hivemind.shutdown? I'm looking
for the equivalent 
of contextDestroyed?

Thanks,
Josh

James Carman wrote:
> You let HiveMind inject stuff into your service that
runs at startup:
>
> public class MyStartupClass implements Runnable
> {
>  private MyService myService;
>
>  public void setMyService( MyService myService )
>  {
>this.myService = myService;
>  }
>
>  public void run()
>  {
>myService.doSomethingThatMyServiceDoes();
>  }
> }
>
> HiveMind will "autowire" the MyService object into
your MyStartupClass
> object (unless there is more than one service point
within your HiveMind
> registry which implements the MyService interface). 
Then, declare your
> service point in the HiveMind module:
>
> 
>  
>
>  
> 
>
> Then, register your service with the startup
configuration point:
>
> 
>  
> 
>
> That's it!  Your Runnable class will now run upon
registry startup
> (creation), which happens in a Tapestry application
when the application
> servlet starts up.
>
> On 10/28/06, KEGan <[EMAIL PROTECTED]> wrote:
>>
>> Hi,
>>
>> I have tried both approches. However, inside my
code, I am trying to
>> access
>> Hivemind services, and it didnt work.
>>
>> Example, in my custom "ApplicationInitializer", I
use:
>>
>> Registry registry =
RegistryBuilder.constructDefaultRegistry();
>> MyService myservice =
(MyService)registry.getService("
>> com.project.myService",
>> MyService.class);
>>
>> And all I get is a null.
>>
>> I suspect using the
"RegistryBuilder.constructDefaultRegistry()" is not
>> the
>> correct way to get access into Hivemind registry,
when Tapestry is
>> starting
>> up.
>>
>> So, how do I get access to Hivemind registry ...
whether it is from 
>> inside
>> "
>> hivemind.Startup" or
"tapestry.init.ApplicationInitializers".
>>
>>
>>
>> On 10/24/06, James Carman
<[EMAIL PROTECTED]> wrote:
>> >
>> > There is a configuration point called
"hivemind.Startup" where you can
>> > register Runnable objects to be run at HM
registry startup time (which
>> is
>> > the same as Tapestry startup time).
>> >
>> > On 10/22/06, KEGan <[EMAIL PROTECTED]>
wrote:
>> > >
>> > > Hi,
>> > >
>> > > I need to do some tasks when my Servlet web
application is
>> initialized.
>> > In
>> > > this, I can use ServletContextListener.
>> > >
>> > > Now, I am using Tapestry ... and I want to
achieve the same 
>> thing. Of
>> > > course, I can still use ServletContextListener,
but with this, I
>> cannot
>> > > use
>> > > all the TapestryAnnotation Hivemind goodness
(autowiring, etc) that
>> > comes
>> > > with Tapestry. So is there a
ServletContextListener equivalent in
>> > > Tapestry?
>> > > The idea is that I can run some tasks (only
once) when Tapestry is
>> first
>> > > initialized, and I want to do this with all the
Tapestry Annontation
>> and
>> > > Hivemind goodness.
>> > >
>> > > Thanks.
>> > >
>> > > ~KEGan
>> > >
>> > >
>> >
>> >
>>
>>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: tapestry-acegi and tapestry 4.1

2006-12-26 Thread James Carman

I haven't tried it, but it should work as far as I know.  You can
override the dependency in your own pom file


On 12/26/06, Robert Binna <[EMAIL PROTECTED]> wrote:

Hi

I justed wanted to use tapestry-acegi on a project of mine that uses
tapestry 4.1. Has someone get it working because the current pom file is
for tapestry 4.0?

Kind regards,
 Robert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



tapestry-acegi and tapestry 4.1

2006-12-26 Thread Robert Binna

Hi

I justed wanted to use tapestry-acegi on a project of mine that uses 
tapestry 4.1. Has someone get it working because the current pom file is 
for tapestry 4.0?


Kind regards,
Robert

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]