com.google.enterprise.adaptor
Class Application

java.lang.Object
  extended by com.google.enterprise.adaptor.Application

public final class Application
extends Object

Provides framework for adaptors to act as a stand-alone application. This entails creating well-configured HttpServer instances, argument parsing, shutdown handling, and more.


Constructor Summary
Application(Adaptor adaptor, Config config)
           
 
Method Summary
 Config getConfig()
          Returns the Config used by this instance.
 GsaCommunicationHandler getGsaCommunicationHandler()
          Returns the GsaCommunicationHandler used by this instance.
static Application main(Adaptor adaptor, String[] args)
          Main for adaptors to utilize when wanting to act as an application.
 void start()
          Start necessary services for receiving requests and managing background tasks.
 void stop(long time, TimeUnit unit)
          Stop processing incoming requests and background tasks, allowing graceful shutdown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application(Adaptor adaptor,
                   Config config)
Method Detail

start

public void start()
           throws IOException,
                  InterruptedException,
                  StartupException
Start necessary services for receiving requests and managing background tasks. Non-daemon threads are created, so call stop(long, java.util.concurrent.TimeUnit) for graceful manual shutdown. A shutdown hook is automatically installed that calls stop().

Throws:
IOException
InterruptedException
StartupException

stop

public void stop(long time,
                 TimeUnit unit)
Stop processing incoming requests and background tasks, allowing graceful shutdown.


getGsaCommunicationHandler

public GsaCommunicationHandler getGsaCommunicationHandler()
Returns the GsaCommunicationHandler used by this instance.


getConfig

public Config getConfig()
Returns the Config used by this instance.


main

public static Application main(Adaptor adaptor,
                               String[] args)
Main for adaptors to utilize when wanting to act as an application. This method primarily parses arguments and creates an application instance before calling it's start().

Returns:
the application instance in use