You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by nlif <na...@dbnet.co.il> on 2006/10/09 11:59:18 UTC

XBean and Spring 2.0

What is the difference (or relationship) between the ActiveMQ XBean syntax
and Spring 2.0 syntax? Are they alternatives to each other? Are they
complementing? Do I need to use both or choose between them? I realize the
good people of ActiveMQ are simply trying to provide us with a variety of
options, but I'm afraid you lost me there :-)

We're now migrating to Spring 2.0, so if we can use just that, without any
dependency on XBean, then that would be just fine. Furthermore, it's really
convenient to have auto-complete in the XML editor, which I'm not sure is
possible with the XBean  syntax. Or maybe I'm wrong on that as well... :-(

Can anyone please shed some light?

Thanks.

ps - all the sample XMLs that I could find (e.g. in the AcrtiveMQ tests)
seem to be snippets, that is, they are not complete valid XMLs as is. I
assume this also has to do with how XBean works...
-- 
View this message in context: http://www.nabble.com/XBean-and-Spring-2.0-tf2409007.html#a6714751
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: XBean and Spring 2.0

Posted by nlif <na...@dbnet.co.il>.
Thanks.
-- 
View this message in context: http://www.nabble.com/XBean-and-Spring-2.0-tf2409007.html#a6754789
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: XBean and Spring 2.0

Posted by James Strachan <ja...@gmail.com>.
I've added a new FAQ entry to try clear up some of the confusion about
XBean and Spring
http://activemq.org/site/how-does-xbean-compare-to-spring-2.html

On 10/10/06, James Strachan <ja...@gmail.com> wrote:
> On 10/9/06, nlif <na...@dbnet.co.il> wrote:
> >
> > What is the difference (or relationship) between the ActiveMQ XBean syntax
> > and Spring 2.0 syntax?
>
> ActiveMQ XBean is XML syntax (and has an XSD), Spring 2 isn't syntax,
> its just a hook into Spring's parser so a component can do its own XML
> parsing. So ActiveMQ XBean can be used inside a regular Spring 2 file
> to parse ActiveMQ configuration files
>
> >  Are they alternatives to each other? Are they
> > complementing?
>
> Complementing. ActiveMQ XBean XML can use Spring 2's hook - it also
> works in Spring 1
>
> > We're now migrating to Spring 2.0, so if we can use just that, without any
> > dependency on XBean, then that would be just fine.
>
> XBean does the parsing of the XML - Spring doesn't - it just gives you
> a hook where you can manually parse the DOM and construct your beans.
> We basically don't wanna do that by hand, so XBean generates that for
> us.
>
> Think of XBean as JAXB2 for Spring
>
> > Furthermore, it's really
> > convenient to have auto-complete in the XML editor, which I'm not sure is
> > possible with the XBean  syntax. Or maybe I'm wrong on that as well... :-(
>
> I'm afraid so :)
>
> Just use the XSD definition of ActiveMQ's XML inside your spring.xml
> (or activemq.xml) and you get IDE completion. Though we could improve
> the auto-generated XSD some more
>
>
> > ps - all the sample XMLs that I could find (e.g. in the AcrtiveMQ tests)
> > seem to be snippets, that is, they are not complete valid XMLs as is.
>
> You've lost me there? You mean on the website or in the source code?
> The source code is all valid XML, we often just show relevant snippets
> on the website
>
> Here's a regular Spring 2 XML file using ActiveMQ's XML inside it to
> configure a broker & destinations & a connection factory
> http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/resources/spring-embedded-xbean.xml
>
> Here's an example Spring XML for Spring 2 which configures ActiveMQ,
> ActiveMQ Resource Adapter and Jencks all using Spring 2 with XSD
> validation (and so completion)
> http://svn.codehaus.org/jencks/trunk/jencks/src/test/resources/org/jencks/xbean/xbean-validating.xml
>
> --
>
> James
> -------
> http://radio.weblogs.com/0112098/
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Re: XBean and Spring 2.0

Posted by James Strachan <ja...@gmail.com>.
On 10/9/06, nlif <na...@dbnet.co.il> wrote:
>
> What is the difference (or relationship) between the ActiveMQ XBean syntax
> and Spring 2.0 syntax?

ActiveMQ XBean is XML syntax (and has an XSD), Spring 2 isn't syntax,
its just a hook into Spring's parser so a component can do its own XML
parsing. So ActiveMQ XBean can be used inside a regular Spring 2 file
to parse ActiveMQ configuration files

>  Are they alternatives to each other? Are they
> complementing?

Complementing. ActiveMQ XBean XML can use Spring 2's hook - it also
works in Spring 1

> We're now migrating to Spring 2.0, so if we can use just that, without any
> dependency on XBean, then that would be just fine.

XBean does the parsing of the XML - Spring doesn't - it just gives you
a hook where you can manually parse the DOM and construct your beans.
We basically don't wanna do that by hand, so XBean generates that for
us.

Think of XBean as JAXB2 for Spring

> Furthermore, it's really
> convenient to have auto-complete in the XML editor, which I'm not sure is
> possible with the XBean  syntax. Or maybe I'm wrong on that as well... :-(

I'm afraid so :)

Just use the XSD definition of ActiveMQ's XML inside your spring.xml
(or activemq.xml) and you get IDE completion. Though we could improve
the auto-generated XSD some more


> ps - all the sample XMLs that I could find (e.g. in the AcrtiveMQ tests)
> seem to be snippets, that is, they are not complete valid XMLs as is.

You've lost me there? You mean on the website or in the source code?
The source code is all valid XML, we often just show relevant snippets
on the website

Here's a regular Spring 2 XML file using ActiveMQ's XML inside it to
configure a broker & destinations & a connection factory
http://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/test/resources/spring-embedded-xbean.xml

Here's an example Spring XML for Spring 2 which configures ActiveMQ,
ActiveMQ Resource Adapter and Jencks all using Spring 2 with XSD
validation (and so completion)
http://svn.codehaus.org/jencks/trunk/jencks/src/test/resources/org/jencks/xbean/xbean-validating.xml

-- 

James
-------
http://radio.weblogs.com/0112098/