Package org.appng.api
Interface ApplicationController
-
public interface ApplicationController
Provides methods to startup and shutdown aApplication
. AApplication
is NOT forced to provide an implementation of this, it's completely optional.Application
s which need to allocate/free some resources on startup/shutdown should use this interface. In eachApplication
there can only be one bean implementingApplicationController
.- Author:
- Matthias Müller
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
addSite(Site site, Application application, Environment environment)
This method is called immediately after adding aApplication
from aSite
, which has not been reloaded at this point.boolean
removeSite(Site site, Application application, Environment environment)
This method is called immediately after removing aApplication
from aSite
, which has not been reloaded at this point.boolean
shutdown(Site site, Application application, Environment environment)
This method is called when aSite
is being shutdown.boolean
start(Site site, Application application, Environment environment)
This method is called when aSite
is being (re)loaded.
-
-
-
Method Detail
-
start
boolean start(Site site, Application application, Environment environment)
This method is called when aSite
is being (re)loaded. AApplication
is supposed to initialize itself within this method.- Parameters:
site
- theSite
to which theApplication
is assigned toapplication
- theApplication
which is assigned to theSite
environment
- the currentEnvironment
- Returns:
true
on success,false
otherwise
-
shutdown
boolean shutdown(Site site, Application application, Environment environment)
This method is called when aSite
is being shutdown. AApplication
is supposed to shutdown itself within this method (free resources etc.).- Parameters:
site
- theSite
to which theApplication
is assigned toapplication
- theApplication
which is assigned to theSite
environment
- the currentEnvironment
- Returns:
true
on success,false
otherwise
-
removeSite
boolean removeSite(Site site, Application application, Environment environment)
This method is called immediately after removing aApplication
from aSite
, which has not been reloaded at this point. The purpose is, similar toshutdown(Site, Application, Environment)
, to free resources.- Parameters:
site
- theSite
from which theApplication
is being removedapplication
- theApplication
which is being removed from theSite
environment
- the currentEnvironment
- Returns:
true
on success,false
otherwise
-
addSite
boolean addSite(Site site, Application application, Environment environment)
This method is called immediately after adding aApplication
from aSite
, which has not been reloaded at this point.- Parameters:
site
- theSite
to which theApplication
was assigned toapplication
- theApplication
which was assigned to theSite
environment
- the currentEnvironment
- Returns:
true
on success,false
otherwise
-
-