commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benedikt Ritter <brit...@apache.org>
Subject Re: Chain Configuration
Date Fri, 11 Oct 2013 09:22:25 GMT
Hi Jagan,

as far as I know, no there isn't... We know this is a flaw in chain and we
intended to fix it for chain2 (which is in the current trunk of chain). But
currently there is nobody who really has the time make chain2 ready for a
release. Simone Tripodi was working on it and he intended to implement the
configuration module using modello [1]. But that seems to be blocked until
a new modello release hits the road...

Benedikt

[1] http://modello.codehaus.org


2013/10/11 Jagan Ranganathan <jagan@zohocorp.com>

> Hi,
>
> We are trying to use Chain Of Responsibility pattern in the server side.
> We have defined our chain+commands in an xml and are parsing it via
> ConfigParser.
>
>
> But we face a problem with getting Catalog via
> CatalogFactoryBase.getInstance().getCatalog(catalogName) call.Looks like it
> has got some ClassLoader specific loading. So if we have initialized in
> some web context, the Catalog is not present in other context - different
> ClassLoader.
> Is there anyway we can remove this ClassLoader level dependency or is
> there any other way of loading the chain configuration for server side
> usage?
> /**     * &lt;p&gt;Return the singleton {@link CatalogFactory} instance
>      * for the relevant &lt;code&gt;ClassLoader&lt;/code&gt;.  For
> applications
>      * that use a thread context class loader (such as web applications
>      * running inside a servet container), this will return a separate
>      * instance for each application, even if this class is loaded from
>      * a shared parent class loader.&lt;/p&gt;
>      *
>      * @return the per-application singleton instance of {@link
> CatalogFactory}
>      */
>     public static CatalogFactory getInstance() {
>
>
>         CatalogFactory factory = null;
>         ClassLoader cl = getClassLoader();
>         synchronized (factories) {
>             factory = (CatalogFactory) factories.get(cl);
>             if (factory == null) {
>                 factory = new CatalogFactoryBase();
>                 factories.put(cl, factory);
>             }
>         }
>         return factory;
>
>
>     }
>
> Regards,
> Jagan
>
>
>
>


-- 
http://people.apache.org/~britter/
http://www.systemoutprintln.de/
http://twitter.com/BenediktRitter
http://github.com/britter

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message