On Thursday 05 February 2004 17:44, Leo Sutic wrote:
> There is really only one way to prevent it:
>
>     Make sure that the object passed to the component doesn't
>     implement MutableConfiguration.
>
> This can be done in two ways:
>
>  1. By wrapping the DefaultConfiguration in a proxy that only
>     implements the Configuration interface and which doesn't
>     have any mutators.

Possible.

>  2. By not having MutableConfiguration in a classloader that
>     is common to the client and the container. This means that
>     MutableConfiguration.class for the client won't be equal to
>     MutableConfiguration.class for the container, and the cast
>     will fail. In a sense, as far as the client is concerned,
>     DefaultConfiguration doesn't implement MutableConfiguration,
>     since it implements the container's MutableConfiguration, and
>     not the client's.

Hmmm.... Not sure what I feel about this. Somehow it doesn't sound like the 
right use of classloaders, and "easily" overridden by crafty users, creating 
other problems.


3. Don't pass the same object to the component. Rip out the result of the 
MutableConfigurator implementatation and stuff it into a Configuration 
implementation and hand that down to the component. To me this is the obvious 
and easiest solution.

Cheers
Niclas


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

Reply via email to