|
From: Howard L. S. <hl...@gm...> - 2005-01-26 14:46:17
|
Since HiveMind 1.0, and improved in HiveMind 1.1, there's been basic
integration between HiveMind and Spring.
At the core of it is the ability to define a HiveMind service in terms
of a Spring bean within a BeanFactory. The essential code is:
public Object createCoreServiceImplementation(
ServiceImplementationFactoryParameters factoryParameters)
{
SpringBeanParameter p = (SpringBeanParameter)
factoryParameters.getFirstParameter();
String beanName = p.getName();
BeanFactory f = p.getBeanFactory();
if (f == null)
f = _defaultBeanFactory;
return f.getBean(beanName, factoryParameters.getServiceInterface());
}
With this, its possible to obtain a Spring bean and the core service
implementation of a HiveMind service. The implementation can be
extended with interceptors and injected into other HiveMind services.
At Javapolis, I talked with Rod about having something similar going
the other direction, allowing HiveMind services to be referencable
(and injectable) as Spring beans. I'd like to provoke a discussion on
what that would look like, and what API changes would be needed in
HiveMind 1.1 to support it.
Rod seemed to think (and I didn't follow the reasoning) that HiveMind
would need an API to iterate over the names of all services.
In addition, configuration data (in either List or Map form) is also
quite valuable and something that Spring beans would like to have
access to.
--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
|