org.apache.avalon.phoenix.interfaces
Interface ApplicationContext


public interface ApplicationContext

Manage the "context" in which Applications operate.

Author:
Peter Donald

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 void exportObject(java.lang.String name, java.lang.Class[] interfaceClasses, java.lang.Object object)
          Export specified object into management system.
 java.lang.ClassLoader getClassLoader()
          Get ClassLoader for the current application.
 Configuration getConfiguration(java.lang.String component)
          Get the Configuration for specified component.
 Logger getLogger(java.lang.String name)
          Get logger with category for application.
 SarMetaData getMetaData()
           
 java.io.InputStream getResourceAsStream(java.lang.String name)
          Retrieve a resource from the SAR file.
 ThreadContext getThreadContext()
           
 void requestShutdown()
          A application can request that it be be shutdown.
 void unexportObject(java.lang.String name)
          Unexport specified object from management system.
 

Field Detail

ROLE

public static final java.lang.String ROLE
Method Detail

getMetaData

public SarMetaData getMetaData()

getThreadContext

public ThreadContext getThreadContext()

requestShutdown

public void requestShutdown()
A application can request that it be be shutdown. In most cases the kernel will schedule the shutdown to occur in another thread.


exportObject

public void exportObject(java.lang.String name,
                         java.lang.Class[] interfaceClasses,
                         java.lang.Object object)
                  throws java.lang.Exception
Export specified object into management system. The object is exported using specifed interface and using the specified name.

Parameters:
name - the name of object to export
interfaceClasses - the interface of object with which to export
object - the actual object to export
java.lang.Exception

unexportObject

public void unexportObject(java.lang.String name)
                    throws java.lang.Exception
Unexport specified object from management system.

Parameters:
name - the name of object to unexport
java.lang.Exception

getClassLoader

public java.lang.ClassLoader getClassLoader()
Get ClassLoader for the current application.

Returns:
the ClassLoader

getResourceAsStream

public java.io.InputStream getResourceAsStream(java.lang.String name)
Retrieve a resource from the SAR file. The specified name is relative the root of the archive. So you could use it to retrieve a html page from within sar by loading the resource named "data/main.html" or similar.


getConfiguration

public Configuration getConfiguration(java.lang.String component)
                               throws ConfigurationException
Get the Configuration for specified component.

Parameters:
component - the component
Returns:
the Configuration
ConfigurationException

getLogger

public Logger getLogger(java.lang.String name)
Get logger with category for application. Note that this name may not be the absolute category.

Parameters:
name - the name of logger
Returns:
the Logger


Copyright © 2001 Apache Jakarta Project. All Rights Reserved.