Class AbstractApplication

java.lang.Object
com.yahoo.jdisc.application.AbstractApplication
All Implemented Interfaces:
Application
Direct Known Subclasses:
AbstractClientApplication

public abstract class AbstractApplication extends Object implements Application

This class is a convenient parent class for Application developers that require simple access to the most commonly used jDISC APIs.

A simple hello world application could be implemented like this:

 class HelloApplication extends AbstractApplication {

     @Inject
     public HelloApplication(BundleInstaller bundleInstaller, ContainerActivator activator,
                             CurrentContainer container) {
         super(bundleInstaller, activator, container);
     }

     @Override
     public void start() {
         ContainerBuilder builder = newContainerBuilder();
         ServerProvider myServer = new MyHttpServer();
         builder.serverProviders().install(myServer);
         builder.serverBindings().bind("http://*/*", new MyHelloWorldHandler());

         activateContainer(builder);
         myServer.start();
         myServer.release();
     }
 }
 
Author:
Simon Thoresen Hult