tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <>
Subject Re: Using Context/Manager with custom nested element
Date Fri, 29 Jan 2010 14:58:16 GMT
On 29/01/2010 11:33, Martin Grotzke wrote:
> Hi Pid,
> what you describe is correct and works, I've implemented a Manager
> implementation that uses simple attributes until now (for memcached
> based session failover, memcached-session-manager:
> ).
> However, now I want to support a complex, nested child element for a
> TranscoderStrategy in my case (somehow comparable to the Store element
> that is allowed as child element for the PersistentManager), that
> supports different attributes depending on the TranscoderStrategy
> implementation. It's possible to put all attributes into the Manager
> element, but this is not what one would want to do - the related
> attributes are spread between the Manager related attributes.

I'm not sure I understand.
Is the requirement an aesthetic thing or does the existing method not 
actually work for your use case?

In recent versions of Tomcat the Digester complains if it finds 
unexpected elements during startup.  Do you get any error messages in 
the catalina.out log or on the console, when you implement your 
preferred structure?

If you've extended PersistentManagerBase then you must supply a Store 
element, maybe your configuration options can be set as attributes on 
that element.

If you've extended ManagerBase then maybe you can add an object FooBar 
(with getter & setter) and attributes as needed.

Or have you tried this already?


> Cheers,
> Martin
> On Fri, 2010-01-29 at 10:10 +0000, Pid wrote:
>> On 29/01/2010 00:31, Martin Grotzke wrote:
>>> Hi,
>>> is it somehow possible to have a custom nested element below the Manager
>>> element in server.xml/context.xml? E.g.
>>> <Manager className="">
>>>     <FooBar foo="bar"/>
>>> </Manager>
>>> where the MyManager class has a property fooBar?
>> If the MyManager class has a field called fooBar, with matching getter
>> and setter, then (my guess, based on how Valves work, is that) you can
>> probably set it by doing this:
>> <Manager className="" fooBar="somevalue">
>> </Manager>
>> p
>>> AFAICS the ContextRuleSet defines what's possible in the Context element
>>> without any hook - so it seems that there's no possibility to achieve
>>> this.
>>> If someone could tell me that I'm wrong with this asumption I would be
>>> happy! :-)
>>> Thanx&&   cheers,
>>> Martin
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail:
>> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message