|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AbstractLogEnabled | +--org.apache.avalon.phoenix.components.application.DefaultApplication
This is the basic container of blocks. A server application represents an aggregation of blocks that act together to form an application.
Field Summary |
Fields inherited from interface org.apache.avalon.phoenix.interfaces.Application |
ROLE |
Fields inherited from interface org.apache.avalon.phoenix.interfaces.ApplicationMBean |
ROLE |
Constructor Summary | |
DefaultApplication()
|
Method Summary | |
void |
dispose()
|
void |
enableLogging(Logger logger)
|
Object |
getBlock(String name)
Retrieve Block with specified name. |
String[] |
getBlockNames()
Retrieve names of Blocks contained in application. |
String |
getDescription()
Get the string used to describe the application in the UI. |
String |
getDisplayName()
Get the name to display in Management UI. |
String |
getHomeDirectory()
Get location of Application installation |
protected SarMetaData |
getMetaData()
|
String |
getName()
Get the name of the application. |
void |
initialize()
|
boolean |
isRunning()
Return true if the application is running or false otherwise. |
void |
restart()
Shutdown and restart the application running. |
void |
setApplicationContext(ApplicationContext context)
Set the context in which the Application is "executed". |
void |
shutdown(org.apache.avalon.phoenix.components.application.BlockEntry entry)
Method to run a Block through it's shutdown phase. |
void |
start()
Start the application running. |
void |
startup(org.apache.avalon.phoenix.components.application.BlockEntry entry)
Method to run a Block through it's startup phase. |
void |
startupListener(BlockListenerMetaData metaData)
Method to run a BlockListener through it's startup phase. |
void |
stop()
Stop the application running. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DefaultApplication()
Method Detail |
public void enableLogging(Logger logger)
public void initialize() throws Exception
Exception
public void start() throws IllegalStateException, ApplicationException
start
in interface ApplicationMBean
IllegalStateException
- if application is already running
ApplicationException
- if the application failed to start.
the message part of exception will contain more information
pertaining to why the application failed to startuppublic void restart() throws IllegalStateException, ApplicationException
restart
in interface ApplicationMBean
IllegalStateException
- if application is not already running
ApplicationException
- if the application failed to stop or start.
the message part of exception will contain more information
pertaining to why the application failed to startup/shutdownpublic void stop() throws IllegalStateException, ApplicationException
stop
in interface ApplicationMBean
IllegalStateException
- if application is not already running
ApplicationException
- if the application failed to shutdown.
the message part of exception will contain more information
pertaining to why the application failed to shutodwnpublic void dispose()
public void setApplicationContext(ApplicationContext context)
Application
setApplicationContext
in interface Application
context
- the applications contextpublic String[] getBlockNames()
Application
getBlockNames
in interface Application
public Object getBlock(String name)
Application
getBlock
in interface Application
name
-
public String getName()
getName
in interface ApplicationMBean
public String getDisplayName()
getDisplayName
in interface ApplicationMBean
public String getDescription()
getDescription
in interface ApplicationMBean
public String getHomeDirectory()
getHomeDirectory
in interface ApplicationMBean
public boolean isRunning()
isRunning
in interface ApplicationMBean
protected final SarMetaData getMetaData()
public void startup(org.apache.avalon.phoenix.components.application.BlockEntry entry) throws Exception
BlockListener
objects, creation of the Block/Block Proxy object, calling the startup
Avalon Lifecycle methods and updating State property of BlockEntry.
Errors that occur during shutdown will be logged appropriately and
cause exceptions with useful messages to be raised.
entry
- the entry containing Block
Exception
- if an error occurs when block passes
through a specific lifecycle stagepublic void shutdown(org.apache.avalon.phoenix.components.application.BlockEntry entry) throws LifecycleException
BlockListener
objects, invalidating the proxy object, calling the shutdown
Avalon Lifecycle methods and updating State property of BlockEntry.
Errors that occur during shutdown will be logged appropraitely.
entry
- the entry containing Block
LifecycleException
public void startupListener(BlockListenerMetaData metaData) throws Exception
BlockListener
through it's startup phase.
This will involve creation of BlockListener object and configuration of
object if appropriate.
metaData
- the BlockListenerMetaData
Exception
- if an error occurs when listener passes
through a specific lifecycle stage
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |