Hi all,
I'm working on a bean factory language parser for Spring. This is an
example of the syntax:
abstractDataSource =3D new abstract
org.springframework.jdbc.datasource.DriverManagerDataSource;
abstractDataSource.driverClassName =3D 'org.hsqldb.jdbcDriver';
abstractDataSource.url =3D 'jdbc:hsqldb:hsql://localhost:';
abstractDataSource.username =3D 'sa';
abstractDataSource.password =3D '';
dataSource =3D new child of abstractDataSource;
sessionFactory =3D new org.springframework.orm.hibernate.LocalSessionFactor=
yBean;
sessionFactory.dataSource =3D dataSource;
sessionFactory.mappingResources =3D [ 'domain.hbm.xml' ];
sessionFactory.hibernateProperties =3D { 'hibernate.dialect' ->
'sf.hibernate.dialect.HSQLDialect' };
transactionManager =3D new
org.springframework.orm.hibernate.HibernateTransactionManager;
transactionManager.sessionFactory =3D sessionFactory;
transactionAttributes =3D new java.util.Properties({ '*' ->
'PROPAGATION_REQUIRED' });
The currently state of the parser can parse the example above being
the common Spring bean factory constructs. More advanced constructs
still need to be implemented like method replacement, static method
invocation, init and destroy methods, ... . I also have some
additional features in mind, functions being one example:
myProxy =3D proxy(myTarget, [ interceptor1, interceptor2 ]);
myDao =3D transactionProxy(target, transactionManager, { '*' ->
'PROPAGATION_REQUIRED });
The parser converts the syntax to a number of objects that need to be
converted somehow to an application context. This would require some
form of programmatic configuration of the application context. It's my
understanding this currently is not available, as discussed in this
post on the forum:
http://forum.springframework.org/viewtopic.php?t=3D5018
Currently I have two options to go ahead:
1) generate an xml syntax based on the parser syntax.
2) update/finish/improve/copycat the existing code in the sandbox or
any other code base and as such attempt to create a solid programmatic
configuration feature.
My personal preference is to go for the programmatic configuration
feature. Alas, I'm afraid I'm going to require the endorsement of the
Spring team to take up such a task. I've already looked at the code in
the sandbox and there's too many question marks in the comments to
make this feel like a strawl in the park.
Steven
--=20
"If you want to be a different fish, you gotta jump out of the school."
-- Captain Beefheart
|