<classpathentry kind="src" path="support/src/test/java"/>
<classpathentry excluding="**" kind="src" output="support/src/main/resources" path="support/src/main/resources"/>
<classpathentry excluding="**" kind="src" output="support/src/test/resources" path="support/src/test/resources"/>
- <classpathentry kind="src" path="system/src/main/java"/>
- <classpathentry kind="src" path="system/src/test/java"/>
+ <classpathentry kind="src" path="system/general/src/main/java"/>
+ <classpathentry kind="src" path="system/general/src/test/java"/>
+ <classpathentry kind="src" path="system/spring/src/main/java"/>
+ <classpathentry kind="src" path="system/spring/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="system/spring/src/test/resources" path="system/spring/src/test/resources"/>
<classpathentry kind="src" path="security/src/main/java"/>
<classpathentry kind="src" path="security/src/test/java"/>
<classpathentry excluding="**" kind="src" output="security/src/test/resources" path="security/src/test/resources"/>
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
</plugins>
-
+
</build>
<reporting>
if (_context == null) {
_context = new ClassPathXmlApplicationContext(
(String[]) _configLocations, _parentContext);
- assertNotNull(_context);
}
return _context;
}
private static final Log LOG = LogFactory.getLog(AbstractSubSystem.class);
private String _name;
+ private ServiceRegistry _registry;
private List<ServiceDescriptor> _provided;
private List<ServiceDescriptor> _required;
private Map<ServiceDescriptor, Service> _running;
* @param aRequired
* Required services.
*/
- protected AbstractSubSystem(String aName, ServiceDescriptor[] aProvided,
+ protected AbstractSubSystem(String aName, ServiceRegistry aRegistry, ServiceDescriptor[] aProvided,
ServiceDescriptor[] aRequired) {
_name = aName;
+ _registry = aRegistry;
_provided = new ArrayList<ServiceDescriptor>();
_provided.addAll(Arrays.asList(aProvided));
_required = new ArrayList<ServiceDescriptor>();
public final String getName() {
return _name;
}
+
+ public ServiceRegistry getRegistry() {
+ return _registry;
+ }
@Override
public final ServiceDescriptor[] getProvidedServices() {
}
@Override
- public final Service[] start(String aContext, ServiceRegistry aRegistry,
+ public final Service[] start(String aContext,
Service[] aRequiredServices) {
LOG.info("Initializing '" + aContext + "." + _name + "' with "
+ Arrays.asList(aRequiredServices));
- doStart(aContext + "." + getName(), aRegistry, aRequiredServices);
+ doStart(aContext + "." + getName(), aRequiredServices);
return _running.values().toArray(new Service[0]);
}
/**
* Must be implemented for initializing the subsystem. The implementation
* must call {@link #addService(Service)} for each service that is started.
- *
- * @param aRegistry Service registry.
+ *
* @param aRequiredServices
* Services that are already running from other subsystems that
* may be used.
*/
protected abstract void doStart(String aContext,
- ServiceRegistry aRegistry,
Service[] aRequiredServices);
/**
* Service.
*/
protected final void addService(String aContext,
- ServiceRegistry aRegistry,
ServiceDescriptor aDescriptor, Object aService) {
LOG.info(aContext + ": service '" + aService + "' started.");
- Service svc = aRegistry.register(aDescriptor, aService);
+ Service svc = getRegistry().register(aDescriptor, aService);
_running.put(svc.getDescriptor(), svc);
}
}
@Override
- public void stop(String aContext, ServiceRegistry aRegistry) {
- doStop(aContext);
+ public void stop() {
+ doStop();
for (Service svc: _running.values()) {
- aRegistry.remove(svc);
+ getRegistry().remove(svc);
}
}
- protected abstract void doStop(String aContext);
+ protected abstract void doStop();
@Override
public String toString() {
/**
* Construcst the composite system.
* @param aName Name of the system.
+ * @param aRegistry Service registry.
* @param aSystems Subsystems.
* @param aProvided Provided services of the system.
* @param aRequired Required services by the system.
*/
- public CompositeSystem(String aName, SubSystem[] aSystems,
+ public CompositeSystem(String aName, ServiceRegistry aRegistry, SubSystem[] aSystems,
ServiceDescriptor[] aProvided, ServiceDescriptor[] aRequired) {
- super(aName, aProvided, aRequired);
+ super(aName, aRegistry, aProvided, aRequired);
_systems = aSystems;
validate();
}
}
@Override
- protected void doStart(String aContext, ServiceRegistry aRegistry, Service[] aRequiredServices) {
+ protected void doStart(String aContext, Service[] aRequiredServices) {
List<ServiceDescriptor> descriptors = new ArrayList<ServiceDescriptor>();
for (Service service : aRequiredServices) {
descriptors.add(service.getDescriptor());
}
SystemAssembler assembler = new SystemAssembler(aContext + "." + getName(), _systems,
descriptors.toArray(new ServiceDescriptor[0]));
- assembler.start(aRegistry, aRequiredServices);
+ assembler.start(getRegistry(), aRequiredServices);
}
@Override
- protected void doStop(String aContext) {
+ protected void doStop() {
// Empty.
}
}
@Override
- public synchronized Service find(String id) {
- // TODO Auto-generated method stub
- return null;
+ public synchronized Service find(String aId) {
+ return _services.get(aId);
}
@Override
* Initialises the subsytem by starting all the services that
* it described as provided.
* @param aContext Unique name for the subsystem.
- * @param aRegistry Registry of service to which the subsystem must register the services it
- * creates.
* @param aRequiredServices Running services from other
* subsystems that are required by this subsystem.
* @return Services that are running in the subsystem.
*/
- Service[] start(String aContext, ServiceRegistry aRegistry, Service[] aRequiredServices);
+ Service[] start(String aContext, Service[] aRequiredServices);
/**
- * Stops a service.
- * @param aContext Context
- * @param aRegistry Registry from which services must be removed.
+ * Stops a subsystem.
*/
- void stop(String aContext, ServiceRegistry aRegistry);
+ void stop();
/**
* Gets the list of running services in the subsystem.
}
services.add(required);
}
- Service[] provided = system.start(_context, aRegistry, services
+ Service[] provided = system.start(_context, services
.toArray(new Service[0]));
for (Service service : provided) {
allProvided.put(service.getDescriptor(), service);
new DefaultServiceDescriptor(Integer.class)
};
- public Application() {
- super("application", new ServiceDescriptor[0], REQUIRED);
+ public Application(ServiceRegistry aRegistry) {
+ super("application", aRegistry, new ServiceDescriptor[0], REQUIRED);
}
@Override
- protected void doStart(String aContext, ServiceRegistry aRegistry, Service[] aRequiredServices) {
+ protected void doStart(String aContext, Service[] aRequiredServices) {
// Empty, no services provided externally.
}
@Override
- protected void doStop(String aContext) {
+ protected void doStop() {
// Empty.
}
}
new DefaultServiceDescriptor(Integer.class)
};
- public Environment() {
- super("environment", PROVIDED, new ServiceDescriptor[0]);
+ public Environment(ServiceRegistry aRegistry) {
+ super("environment", aRegistry, PROVIDED, new ServiceDescriptor[0]);
}
@Override
- protected void doStart(String aContext, ServiceRegistry aRegistry, Service[] aRequiredServices) {
- addService(aContext, aRegistry, PROVIDED[0], new Integer(1));
- addService(aContext, aRegistry, PROVIDED[1], new Integer(2));
+ protected void doStart(String aContext, Service[] aRequiredServices) {
+ addService(aContext, PROVIDED[0], new Integer(1));
+ addService(aContext, PROVIDED[1], new Integer(2));
}
@Override
- protected void doStop(String aContext) {
+ protected void doStop() {
// Empty.
}
}
}
public void testEnvironmentApplication() {
- SubSystem environment = new Environment();
- SubSystem application = new Application();
+ SubSystem environment = new Environment(_registry);
+ SubSystem application = new Application(_registry);
SystemAssembler assembler = new SystemAssembler(new SubSystem[] {
environment, application }, new ServiceDescriptor[0]);
assembler.start(_registry, new Service[0]);
assertEquals(2, appServices.length);
assertEquals(2, _registry.listAllServices().length);
- environment.stop("", _registry);
+ environment.stop();
assertEquals(0, _registry.listAllServices().length);
- application.stop("", _registry);
+ application.stop();
assertEquals(0, _registry.listAllServices().length);
}
public void testApplicationEnvironment() {
try {
- SubSystem environment = new Environment();
- SubSystem application = new Application();
+ SubSystem environment = new Environment(_registry);
+ SubSystem application = new Application(_registry);
SystemAssembler assembler = new SystemAssembler(new SubSystem[] {
application, environment }, new ServiceDescriptor[0]);
assembler.start(_registry, new Service[0]);
}
public void testComposite() {
- SubSystem environment = new Environment();
- SubSystem application = new Application();
- CompositeSystem system = new CompositeSystem("all", new SubSystem[] {
+ SubSystem environment = new Environment(_registry);
+ SubSystem application = new Application(_registry);
+ CompositeSystem system = new CompositeSystem("all", _registry, new SubSystem[] {
environment, application }, new ServiceDescriptor[0],
new ServiceDescriptor[0]);
- system.start("root", _registry, new Service[0]);
+ system.start("root", new Service[0]);
ServiceDescriptor[] required = system.getRequiredServices();
assertEquals(0, required.length);
ServiceDescriptor[] provided = system.getProvidedServices();
public void testCompositeWithWrongProvidedInfo() {
try {
- SubSystem environment = new Environment();
- SubSystem application = new Application();
- CompositeSystem system = new CompositeSystem("all",
+ SubSystem environment = new Environment(_registry);
+ SubSystem application = new Application(_registry);
+ CompositeSystem system = new CompositeSystem("all", _registry,
new SubSystem[] { environment, application },
new ServiceDescriptor[] { new DefaultServiceDescriptor(
String.class) }, new ServiceDescriptor[0]);
}
public void testCompositeWithSuperfluousRequiredInfo() {
- SubSystem environment = new Environment();
- SubSystem application = new Application();
- CompositeSystem system = new CompositeSystem("all", new SubSystem[] {
+ SubSystem environment = new Environment(_registry);
+ SubSystem application = new Application(_registry);
+ CompositeSystem system = new CompositeSystem("all", _registry,new SubSystem[] {
environment, application }, new ServiceDescriptor[0],
new ServiceDescriptor[] { new DefaultServiceDescriptor(
String.class) });
- system.start("root", _registry, new Service[0]);
+ system.start("root", new Service[0]);
ServiceDescriptor[] required = system.getRequiredServices();
assertEquals(1, required.length);
ServiceDescriptor[] provided = system.getProvidedServices();
public void testCompositeWithExternalDependencesNotProvided() {
try {
- SubSystem environment = new Environment();
- SubSystem application = new Application();
- CompositeSystem system = new CompositeSystem("all",
+ SubSystem environment = new Environment(_registry);
+ SubSystem application = new Application(_registry);
+ CompositeSystem system = new CompositeSystem("all", _registry,
new SubSystem[] { application }, new ServiceDescriptor[0],
application.getRequiredServices());
- system.start("root", _registry, new Service[0]);
+ system.start("root", new Service[0]);
} catch (SystemAssemblyException e) {
return;
}
public void testCompositeWithExternalDependencesProvided() {
- SubSystem environment = new Environment();
- SubSystem application = new Application();
- CompositeSystem system = new CompositeSystem("all",
+ SubSystem environment = new Environment(_registry);
+ SubSystem application = new Application(_registry);
+ CompositeSystem system = new CompositeSystem("all", _registry,
new SubSystem[] { application }, new ServiceDescriptor[0],
application.getRequiredServices());
- Service[] envServices = environment.start("env", _registry,new Service[0]);
- system.start("root", _registry, envServices);
+ Service[] envServices = environment.start("env", new Service[0]);
+ system.start("root", envServices);
ServiceDescriptor[] required = system.getRequiredServices();
assertEquals(2, required.length);
ServiceDescriptor[] provided = system.getProvidedServices();
<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
+ <parent>
+ <groupId>org.wamblee</groupId>
+ <artifactId>wamblee-utils</artifactId>
+ <version>0.2-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
<groupId>org.wamblee</groupId>
- <artifactId>wamblee-utils</artifactId>
+ <artifactId>wamblee-system-spring</artifactId>
+ <packaging>jar</packaging>
<version>0.2-SNAPSHOT</version>
- </parent>
+ <name>wamblee.org system spring</name>
+ <url>http://wamblee.org</url>
+ <dependencies>
+ <dependency>
+ <groupId>org.wamblee</groupId>
+ <artifactId>wamblee-system-general</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ </dependency>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.wamblee</groupId>
- <artifactId>wamblee-system-spring</artifactId>
- <packaging>jar</packaging>
- <name>wamblee.org system general</name>
- <url>http://wamblee.org</url>
- <dependencies>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </dependency>
- </dependencies>
+ </dependencies>
</project>
--- /dev/null
+package org.wamblee.system.spring;
+
+import org.springframework.beans.factory.FactoryBean;
+
+public class ProvidedServiceBean implements FactoryBean {
+
+ private String _id;
+
+ public ProvidedServiceBean(String aId) {
+ _id = aId;
+ }
+
+ @Override
+ public Object getObject() throws Exception {
+ return SpringSystem.REGISTRY.get().find(_id).reference(Object.class);
+ }
+
+ @Override
+ public Class getObjectType() {
+ return null;
+ }
+
+ @Override
+ public boolean isSingleton() {
+ return true;
+ }
+
+}
--- /dev/null
+package org.wamblee.system.spring;
+
+import java.util.Map;
+
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.config.ConstructorArgumentValues;
+import org.springframework.beans.factory.support.RootBeanDefinition;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.wamblee.system.AbstractSubSystem;
+import org.wamblee.system.CompositeSystem;
+import org.wamblee.system.Service;
+import org.wamblee.system.ServiceDescriptor;
+import org.wamblee.system.ServiceRegistry;
+import org.wamblee.system.SystemAssemblyException;
+
+/**
+ * Represents a system configured based on spring.
+ */
+public class SpringSystem extends AbstractSubSystem {
+
+ /**
+ * Singleton access to the service registry. Required while starting up.
+ */
+ static ThreadLocal<ServiceRegistry> REGISTRY = new ThreadLocal<ServiceRegistry>();
+
+ private String[] _configFiles;
+ private Map<String, ServiceDescriptor> _provided;
+ private Map<ServiceDescriptor, String> _required;
+ /**
+ * Parent application context containing required services.
+ */
+ private GenericApplicationContext _parentContext;
+
+ /**
+ * Application context containing parsed objects.
+ */
+ private AbstractApplicationContext _context;
+
+ /**
+ * Construcst a spring system.
+ *
+ * @param aName
+ * Name of the system.
+ * @param aConfigFiles
+ * Spring config files to read.
+ * @param aProvided
+ * Map of bean name to service descriptor describing the bean
+ * names that the spring config files use for each required
+ * service.
+ * @param aRequired
+ * Map of bean name to service descriptor describing the bean
+ * names that the spring config files use for each required
+ * service.
+ */
+ public SpringSystem(String aName, ServiceRegistry aRegistry, String[] aConfigFiles,
+ Map<String, ServiceDescriptor> aProvided,
+ Map<ServiceDescriptor, String> aRequired) {
+ super(aName, aRegistry, aProvided.values().toArray(new ServiceDescriptor[0]),
+ aRequired.keySet().toArray(new ServiceDescriptor[0]));
+ _configFiles = aConfigFiles;
+ _provided = aProvided;
+ _required = aRequired;
+ }
+
+ @Override
+ protected void doStart(String aContext,
+ Service[] aRequiredServices) {
+ ServiceRegistry old = REGISTRY.get();
+ try {
+ REGISTRY.set(getRegistry());
+ try {
+
+ registerRequiredServices(aRequiredServices);
+
+ parseConfigFiles();
+
+ exposeProvidedServices(aContext);
+ } catch (Exception e) {
+ throw new SystemAssemblyException(
+ "Failed to assemble spring system", e);
+ }
+ } finally {
+ REGISTRY.set(old);
+ }
+ }
+
+ private void exposeProvidedServices(String aContext) {
+ // Call addService for each provided service.
+
+ for (String name : _provided.keySet()) {
+ Object svc = _context.getBean(name);
+ if (svc == null) {
+ throw new IllegalArgumentException(aContext + ": service '"
+ + name + "' is null");
+ }
+ addService(aContext, _provided.get(name), svc);
+ }
+ }
+
+ private void parseConfigFiles() {
+ // Parse spring config files
+
+ _context = new ClassPathXmlApplicationContext((String[]) _configFiles,
+ _parentContext);
+ }
+
+ private void registerRequiredServices(Service[] aRequiredServices) {
+ // Register required services in a parent context
+
+ // Register the Hibernate mapping files as a bean.
+ _parentContext = new GenericApplicationContext();
+
+ for (Service svc: aRequiredServices) {
+ String id = svc.getId();
+ ServiceDescriptor descriptor = svc.getDescriptor();
+ String beanName = _required.get(descriptor);
+ ConstructorArgumentValues cargs = new ConstructorArgumentValues();
+ cargs.addGenericArgumentValue(id);
+ BeanDefinition definition = new RootBeanDefinition(ProvidedServiceBean.class, cargs,
+ new MutablePropertyValues());
+ _parentContext.registerBeanDefinition(beanName, definition);
+ }
+ _parentContext.refresh();
+ }
+
+ @Override
+ protected void doStop() {
+ _context.close();
+ }
+}
--- /dev/null
+package org.wamblee.system.spring;
+
+public class BlaService {
+ private HelloService _hello;
+
+ public BlaService(HelloService aService) {
+ if ( aService == null ) {
+ throw new IllegalArgumentException("helloService is null");
+ }
+ _hello = aService;
+ }
+
+ public String execute() {
+ return _hello.say();
+ }
+
+ public void stop() {
+ System.out.println("Blaservice stopping");
+ }
+}
--- /dev/null
+package org.wamblee.system.spring;
+
+public class HelloService {
+
+ private String _msg;
+
+ public HelloService(String aMsg) {
+ _msg = aMsg;
+ }
+
+ public String say() {
+ return _msg;
+ }
+}
--- /dev/null
+package org.wamblee.system.spring;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.wamblee.system.DefaultServiceDescriptor;
+import org.wamblee.system.DefaultServiceRegistry;
+import org.wamblee.system.Service;
+import org.wamblee.system.ServiceDescriptor;
+import org.wamblee.system.ServiceRegistry;
+import org.wamblee.system.SystemAssemblyException;
+
+public class SpringSystemTest extends TestCase {
+
+ private static final String HELLO_SERVICE_SPRING_XML = "test.org.wamblee.system.spring.xml";
+ private static final String HELLO_SERVICE_SPRING_WITH_REQS_XML = "test.org.wamblee.system.springWithRequirements.xml";
+
+ private ServiceRegistry _registry;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ _registry = new DefaultServiceRegistry();
+ }
+
+ public void testBlackboxSystem() {
+ SpringSystem system = new SpringSystem("system", _registry,
+ new String[] { HELLO_SERVICE_SPRING_XML },
+ new HashMap<String, ServiceDescriptor>(),
+ new HashMap<ServiceDescriptor, String>());
+ system.start("Hello", new Service[0]);
+ Service[] services = system.getRunningServices();
+ assertEquals(0, services.length);
+
+ system.stop();
+ }
+
+ public void testOneProvidedService() {
+ Map<String, ServiceDescriptor> provided = new HashMap<String, ServiceDescriptor>();
+ provided.put("helloService", new DefaultServiceDescriptor(
+ HelloService.class));
+
+ SpringSystem system = new SpringSystem("system", _registry,
+ new String[] { HELLO_SERVICE_SPRING_XML }, provided,
+ new HashMap<ServiceDescriptor, String>());
+ system.start("Hello", new Service[0]);
+ Service[] services = system.getRunningServices();
+ assertEquals(1, services.length);
+ assertTrue(services[0].reference(HelloService.class) instanceof HelloService);
+ assertEquals("Hello world!", services[0].reference(HelloService.class)
+ .say());
+ system.stop();
+ }
+
+ public void testWithMissingRequiremnt() {
+ try {
+ SpringSystem system = new SpringSystem("system", _registry,
+ new String[] { HELLO_SERVICE_SPRING_WITH_REQS_XML },
+ new HashMap<String, ServiceDescriptor>(),
+ new HashMap<ServiceDescriptor, String>());
+ system.start("Bla", new Service[0]);
+ } catch (SystemAssemblyException e) {
+ //e.printStackTrace();
+ return;
+ }
+ fail();
+ }
+
+ public void testWithRequirement() {
+ Map<ServiceDescriptor, String> required = new HashMap<ServiceDescriptor, String>();
+ required.put(new DefaultServiceDescriptor(HelloService.class),
+ "helloService");
+ SpringSystem system = new SpringSystem("system", _registry,
+ new String[] { HELLO_SERVICE_SPRING_WITH_REQS_XML },
+ new HashMap<String, ServiceDescriptor>(), required);
+
+ HelloService helloObject = new HelloService("ladida");
+ Service helloService = _registry.register(new DefaultServiceDescriptor(HelloService.class), helloObject);
+ system.start("Bla", new Service[] { helloService } );
+ system.stop();
+ }
+
+ public void testWithRequirementAndProvidedService() {
+ Map<ServiceDescriptor, String> required = new HashMap<ServiceDescriptor, String>();
+ required.put(new DefaultServiceDescriptor(HelloService.class),
+ "helloService");
+ Map<String,ServiceDescriptor> provided = new HashMap<String, ServiceDescriptor>();
+ provided.put("blaService", new DefaultServiceDescriptor(
+ BlaService.class));
+
+ SpringSystem system = new SpringSystem("system", _registry,
+ new String[] { HELLO_SERVICE_SPRING_WITH_REQS_XML },
+ provided, required);
+
+ HelloService helloObject = new HelloService("ladida");
+ Service helloService = _registry.register(new DefaultServiceDescriptor(HelloService.class), helloObject);
+ Service[] services = system.start("Bla", new Service[] { helloService } );
+ assertEquals(1, services.length);
+
+ assertTrue(services[0].reference(BlaService.class) instanceof BlaService);
+ assertEquals("ladida", services[0].reference(BlaService.class)
+ .execute());
+ system.stop();
+ }
+
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="helloService" class="org.wamblee.system.spring.HelloService">
+ <constructor-arg>
+ <value>Hello world!</value>
+ </constructor-arg>
+ </bean>
+
+</beans>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="blaService" class="org.wamblee.system.spring.BlaService" destroy-method="stop">
+ <constructor-arg>
+ <ref bean="helloService"/>
+ </constructor-arg>
+ </bean>
+
+</beans>