some major refactoring.
[utils] / trunk / system / general / src / test / java / org / wamblee / system / Application.java
index 07b1e34cbc7939d6e30ce44b9acc8d7fcebfc40c..b84ca5e247410ea6d0ec7c690edc539b87683c9b 100644 (file)
@@ -2,19 +2,21 @@ package org.wamblee.system;
 
 import javax.sql.DataSource;
 
-public class Application extends AbstractSubSystem {
-       private static final ServiceDescriptor[] REQUIRED = 
-               new ServiceDescriptor[] { 
-                       new DefaultRequiredServiceDescriptor("datasource", DataSource.class), 
-                       new DefaultRequiredServiceDescriptor("integer", Integer.class)
+public class Application extends AbstractComponent {
+       private static RequiredInterface[] required() {
+               return
+               new RequiredInterface[] { 
+                       new DefaultRequiredInterfaceDescriptor("datasource", DataSource.class), 
+                       new DefaultRequiredInterfaceDescriptor("integer", Integer.class)
        };
+       }
        
-       public Application(ServiceRegistry aRegistry) {
-               super("application", aRegistry, new ServiceDescriptor[0], REQUIRED); 
+       public Application() {
+               super("application", new ProvidedInterface[0], required()); 
        }
 
        @Override
-       protected void doStart(String aContext, Service[] aRequiredServices) {
+       protected void doStart(String aContext) {
                // Empty, no services provided externally. 
        }