Weaver 3.1.0a1-D1

com.oldlight.weaver.context
Interface WeaverApplicationContext

All Known Implementing Classes:
WeaverApplicationContextImpl

public interface WeaverApplicationContext

The WeaverApplicationContext interface manages application scoped (context wide) values.

Author:
Paul Harvey

Method Summary
 Object getAttribute(String name)
          Gets an application scoped attribute.
 String getConfigValue(String name)
          Retrieves a global/context-wide configuration value.
 Set getConfigValueNames()
          Gets all configuration value names.
 String getInitParameter(String name)
          Gets an application scoped init parameter.
 String getMimeType(String file)
          Returns a MIME type of derived from a file name.
 String getRealPath(String thePath)
          Returns a String containing the real path for a given virtual path.
 void removeAttribute(String name)
          Removes an application scoped attribute.
 void setAttribute(String name, Object value)
          Sets an application scoped attribute.
 

Method Detail

getMimeType

public String getMimeType(String file)
Returns a MIME type of derived from a file name.

Parameters:
file - The name of the file from which to determine the MIME type.
Returns:
The MIME type.

getConfigValue

public String getConfigValue(String name)
Retrieves a global/context-wide configuration value.

Parameters:
name - Name of the config value to retrieve.
Returns:
Configuration value, or null if it can't be found.

getConfigValueNames

public Set getConfigValueNames()
Gets all configuration value names.

Returns:
Set of configuration value names.

getRealPath

public String getRealPath(String thePath)
Returns a String containing the real path for a given virtual path. See the documentation for ServletContext.getRealPath.

Parameters:
thePath - The virtual path.
Returns:
The real path determined from the given virtual path.

getAttribute

public Object getAttribute(String name)
Gets an application scoped attribute.

Parameters:
name - The name of the attribute to be retrieved.
Returns:
The retrieved attribute - or null if the attribute cannot be found.

setAttribute

public void setAttribute(String name,
                         Object value)
Sets an application scoped attribute.

Parameters:
name - The name of the attribute to set.
value - The value to set the attribute to.

removeAttribute

public void removeAttribute(String name)
Removes an application scoped attribute.

Parameters:
name - The name of the attribute to remove.

getInitParameter

public String getInitParameter(String name)
Gets an application scoped init parameter.

Parameters:
name - of the parameter.
Returns:
Value of the named parameter, or null if it cannot be found.

Copyright ©Paul Harvey