some major refactoring.
[utils] / system / general / src / test / java / org / wamblee / system / Environment.java
1 package org.wamblee.system;
2
3 import javax.sql.DataSource;
4
5
6 public class Environment extends AbstractComponent {
7         
8         private static final ProvidedInterface[] provided() { 
9                 return new ProvidedInterface[] { 
10                         new DefaultProvidedInterfaceDescriptor("datasource", DataSource.class), 
11                         new DefaultProvidedInterfaceDescriptor("integer", Integer.class)
12         };
13         }
14         
15         public Environment() { 
16                 super("environment", provided(), new RequiredInterface[0]);
17         }
18         
19         @Override
20         protected void doStart(String aContext) {
21             addService(aContext, getProvidedServices()[0], new Integer(1));
22             addService(aContext, getProvidedServices()[1], new Integer(2));
23         }
24         
25         @Override
26         protected void doStop() {
27                 // Empty.       
28         }
29 }