com.neeve.server.app
Class SrvAppLoader

java.lang.Object
  extended by com.neeve.root.RootObject
      extended by com.neeve.server.app.SrvAppLoader

public final class SrvAppLoader
extends RootObject

The server application loader.

Threading:
This class is safe for concurrent access by multiple threads.

Nested Class Summary
 class SrvAppLoader.AepEngineWatcher
           
 
Method Summary
 SrvConfigAppDescriptor getAppDescriptor()
          Get the application's descriptor
 AepEngine getAppEngine()
          Get the application's AEP engine.
 String getAppJarVersion()
          Get the application's version.
 Object getAppMain()
          Get the application's main class
 SrvAppManager getAppManager()
          Get the server's application manager
 String getAppName()
          Get the application name.
 short getAppVersion()
          Get the application's version.
 SrvConfigDescriptor getServerDescriptor()
          Get the hosting server's descriptor.
static void main(String[] args)
           
 void scheduleAppEvent(Object event)
          Schedule an application event.
 void scheduleAppReload()
          Schedule an application reload.
 void scheduleAppUnload()
          Schedule the unload of an application.
 
Methods inherited from class com.neeve.root.RootObject
getChecked, getThreaded, getTracer, setChecked, setTracer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServerDescriptor

public final SrvConfigDescriptor getServerDescriptor()
Get the hosting server's descriptor.

Threading:
This method can be invoked concurrently by multiple threads.

getAppDescriptor

public final SrvConfigAppDescriptor getAppDescriptor()
Get the application's descriptor

Threading:
This method can be invoked concurrently by multiple threads.

This method returns the application's descriptor. It is not permissible for the application to modify the returned descriptor.


getAppName

public final String getAppName()
Get the application name.

Threading:
This method can be invoked concurrently by multiple threads.

getAppVersion

public final short getAppVersion()
Get the application's version.

Threading:
This method can be invoked concurrently by multiple threads.

getAppJarVersion

public final String getAppJarVersion()
Get the application's version.

If a MANIFEST.MF can be found from the same url as the app main class is loaded then the Implementation-Version in that manifest is returned here. If the manifest does not include an Implementation-Version or is empty then the Specification-Version is returned.

Threading:
This method can be invoked concurrently by multiple threads.

getAppMain

public final Object getAppMain()
Get the application's main class

Threading:
This method can be invoked concurrently by multiple threads.

getAppEngine

public final AepEngine getAppEngine()
Get the application's AEP engine.

Threading:
This method can be invoked concurrently by multiple threads.

Note: The application loader is injected into the application before the engine is created. To receive the engine during startup, the application should create an engine injection point.


getAppManager

public final SrvAppManager getAppManager()
Get the server's application manager

Threading:
This method can be invoked concurrently by multiple threads.

scheduleAppUnload

public final void scheduleAppUnload()
                             throws ESrvAppException
Schedule the unload of an application.

Throws:
IllegalStateException - Thrown if the server application manager has been closed (typically due to server shutdown concurrently occuring with the invocation of this method)
ESrvAppException - Thrown in case an error is encountered while scheduling the background task.

This method schedules a background task to unload the application managed by a loader. This method schedules the unload and returns immediately. The application unload proceeds concurrently in the background.

Threading:
This method can be invoked concurrently by multiple threads.

scheduleAppReload

public final void scheduleAppReload()
                             throws ESrvAppException
Schedule an application reload.

Throws:
IllegalStateException - Thrown if the server application manager has been closed (typically due to server shutdown concurrently occuring with the invocation of this method)
ESrvAppException - Thrown in case an error is encountered while scheduling the background task.

This method schedules a background task to unload and then immediately reload the application managed by a loader. This method schedules the unload and returns immediately. The application reload proceeds concurrently in the background. This method can also be invoked to just load an application that is not currently loaded.

Threading:
This method can be invoked concurrently by multiple threads.

scheduleAppEvent

public final void scheduleAppEvent(Object event)
                            throws ESrvAppException
Schedule an application event.

Parameters:
event - An event object to supply to the invoked event handlers
Throws:
IllegalStateException - Thrown if the server application manager has been closed (typically due to server shutdown concurrently occuring with the invocation of this method)
ESrvAppException - Thrown in case an error is encountered while scheduling the background task.

This method schedules an event in the server's 'admin' thread. The method schedules the background dispatch of the event and returns immediately. The event is then subsequently dispatched to the application's event handler whose method signature contains a parameter that matches the type of the object supplied to this method.

This method is designed for use by administrative applications that actively interact with the server in doing their tasks e.g. actively starting and stopping applications. By scheduling tasks in the server's admin thread, the application automatically synchronizes its activities with the server's administration activities.

Threading:
This method can be invoked concurrently by multiple threads.

main

public static final void main(String[] args)


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.