You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Thim Anneessens <th...@gmail.com> on 2012/06/16 15:56:10 UTC

How to tap into live class realoading

Hello,

Singleton service reloading is unfortunatly not suffisiant for my 
purposes so I was wondering if anyone could give me some insight on how 
Tapestry live class reloading works (whish are the classes involved in 
that process for instance).

Tanks in advance,
Thim.

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


Re: How to tap into live class realoading

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sat, 16 Jun 2012 12:52:24 -0300, Thim Anneessens <th...@gmail.com>  
wrote:

> Thanks for the reply Thiago,

You're welcome! :)

>> Singleton service reloading is unfortunatly not suffisiant for my  
>> purposes
> Tapestry service reloading works only on singletons and I need to have  
> multiple instances of the class I'd like to reload per thread.

In this case, I think you're trying to do dynamic programming in a  
staticly typed language, and basically it won't work. Java (and any other  
staticly-typed language) does not allow you to change a class in runtime.  
Tapestry-IoC service live class reloading only works because the service  
is defined by an interface and calls to it are done through a proxy, so it  
just points to the new service implementation instance when the class is  
changed.

What does this class does? As you have more than one instance per thread,  
it doesn't really looks like a Tapestry-IoC service.

-- 
Thiago H. de Paula Figueiredo

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


Re: How to tap into live class realoading

Posted by Thim Anneessens <th...@gmail.com>.
Thanks for the reply Thiago,

> Singleton service reloading is unfortunatly not suffisiant for my 
> purposes 
Tapestry service reloading works only on singletons and I need to have 
multiple instances of the class I'd like to reload per thread.

I guess I could easely reload classes if I was notified when they where  
modified, so I was wondering if Tapestry provided such facilities. If I 
could subscribe to that event, maybe I'd be able to manage it.

Thank you for your help ;) .
Thim.

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


Re: How to tap into live class realoading

Posted by Steve Eynon <st...@alienfactory.co.uk>.
>From a quick peek...

The ReloadableObjectCreatorSource creates the proxies
(ReloadableServiceImplementationObjectCreator) which create the
Service. Each ReloadableServiceImplementationObjectCreator implements
UpdateListener which is called when it should check for changes /
updates.

But you are aware live class reloading is only enabled during development right?

Steve.


On 16 June 2012 22:55, Thiago H de Paula Figueiredo <th...@gmail.com> wrote:
> On Sat, 16 Jun 2012 10:56:10 -0300, Thim Anneessens <th...@gmail.com>
> wrote:
>
>> Hello,
>
>
> Hi!
>
>
>> Singleton service reloading is unfortunatly not suffisiant for my purposes
>
>
> Could you be a little more specific? This would help us to provide help to
> you.
>
>
>> so I was wondering if anyone could give me some insight on how Tapestry
>> live class reloading works (whish are the classes involved in that process
>> for instance).
>
>
> I don't know the internals, but basically Tapestry-IoC (for services,
> Tapestry-Core, the web framework, isn't involved) uses a proxy for every
> single which is defined by an interface. For pages, components and mixins,
> Tapestry-Core uses its own classloader.
>
> --
> Thiago H. de Paula Figueiredo
>
>
> ---------------------------------------------------------------------
> 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 tap into live class realoading

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sat, 16 Jun 2012 10:56:10 -0300, Thim Anneessens <th...@gmail.com>  
wrote:

> Hello,

Hi!

> Singleton service reloading is unfortunatly not suffisiant for my  
> purposes

Could you be a little more specific? This would help us to provide help to  
you.

> so I was wondering if anyone could give me some insight on how Tapestry  
> live class reloading works (whish are the classes involved in that  
> process for instance).

I don't know the internals, but basically Tapestry-IoC (for services,  
Tapestry-Core, the web framework, isn't involved) uses a proxy for every  
single which is defined by an interface. For pages, components and mixins,  
Tapestry-Core uses its own classloader.

-- 
Thiago H. de Paula Figueiredo

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