You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Torsten Schlabach <ts...@apache.org> on 2005/05/19 14:05:22 UTC

[trunk] Publication, PublicationImpl, PublicationFactory

Hi all,

I had a closer look yesterday at the mentioned Interfaces, implementations
and the corresponding factory.

I might be wrong but my impression was that:

1. A new PublicationImpl object is instantiated with every request and
dropped afterwards?

2. All the factory does is to supply a lazy initialized object that has
not yet read its configuration. Every single getter method starts with a
call to the function loadConfiguration() which in effect means that the
publication.xconf is read once the first getter method is called.

Shouldn't we

- store the publication object into the session directly or indirectly?
- read the configuration when instantiating it
- think about the configuration stuff. I am not sure, but my feeling is it
should be somewhere else.

I will be happy to work on this, just want to be sure I haven't missed an
important idea why this is as it is.

Regards,
Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org


Re: [trunk] Publication, PublicationImpl, PublicationFactory

Posted by Andreas Hartmann <an...@apache.org>.
Torsten Schlabach wrote:
> Hi all,
> 
> I had a closer look yesterday at the mentioned Interfaces, implementations
> and the corresponding factory.
> 
> I might be wrong but my impression was that:
> 
> 1. A new PublicationImpl object is instantiated with every request and
> dropped afterwards?

No, the publications are stored in a static map in PublicationFactory:

         if (keyToPublication.containsKey(key)) {
             publication = (Publication) keyToPublication.get(key);
         } else {
             publication = new PublicationImpl(id, servletContextPath);
             ContainerUtil.enableLogging(publication, getLogger());
             keyToPublication.put(key, publication);
         }

This means a publication object does only exist once for each
publication in a JVM.

-- Andreas

> 
> 2. All the factory does is to supply a lazy initialized object that has
> not yet read its configuration. Every single getter method starts with a
> call to the function loadConfiguration() which in effect means that the
> publication.xconf is read once the first getter method is called.
> 
> Shouldn't we
> 
> - store the publication object into the session directly or indirectly?
> - read the configuration when instantiating it
> - think about the configuration stuff. I am not sure, but my feeling is it
> should be somewhere else.
> 
> I will be happy to work on this, just want to be sure I haven't missed an
> important idea why this is as it is.
> 
> Regards,
> Torsten


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org