On Fri, 2005-08-05 at 08:34 -0700, Kirill Grouchnikov wrote:
> So, two things that finally made the code work:
> 
> 1. Betwixt can not handle private static inner classes as
> beans, only public static inner classes. 

betwixt uses standard java reflection to create classes. AFAIK private
inner classes cannot be created by reflection. does anyone know a trick
that does this?

> This is true even
> if the marshalling is done in the outer class which has
> immediate access to its private static class. 

AIUI the code in which the call is initiated is not relevant for
security when using reflection: only the security manager.

> Is it a bug?

that depends on what you mean :)

it's certainly a limitation but not an unexpected one. i'd like to be
able to add support for private inner classes but i don't know the trick
(and won't spend much time looking at a problem that i suspect has no
solution)...

> 2. Using ByteArrayOutputStream as an underlying stream for
> BeanWriter requires closing the BeanWriter (unlike the case
> with StringWriter) to produce the XML. 

have you tried calling flush or close on the beanwriter?

> Is it a bug?

probably not. 

you can write more than one bean to the same stream therefore betwixt
does not flush the stream until requested. you should call close or
flush on bean write (or on the stream) when you're done.

probably this should be in the documentation, though. anyone want to
submit a patch?

> 3. Why the default configuration of BeanReader produces
> INFO messages?

good question :)

i was wondering that myself. i'm of the opinion that users should ignore
messages of INFO and below unless they are trying to diagnose a problem.
so, you should not be concerned about INFO messages. i suspect that most
of the other developers who've worked on betwixt think in a similar
fashion. i don't think that this is written down anywhere, though.

creating a logging policy then going through and ensuring that the
logging is high quality is certainly a task that needs to be done before
a betwixt 1.0 can be produce. i'll add this to the task list. 

this should be pretty easy (and educational). any volunteers?

>  Why do i need to see them, and how do i
> change the log level *programatically (without property
> file)* not to see them?

betwixt uses JCL (http://jakarta.apache.org/commons/logging) which is a
thin bridging API. configuration of the log output is left entire to the
logging system bridged to. so, you need to figure which logging system
JCL is bridging to then work out whether and how you can change the
settings of that logging system programatically. 

if you don't explicitly configure JCL then it will try to guess which
logging system you're using and bridge to that automatically. if have
log4j on the classpath, that'll be used otherwise if you're using java
1.4+ then java.util logging will be used. for more details, read the JCL
documentation.

- robert


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

Reply via email to