org.talika.tarsis.context
Interface Context

All Known Implementing Classes:
ContextImpl

public interface Context

Interface that defines the context in Tarsis MVC Framework.

Context defines a set of methods that allows access services provided by it. These services includes access to object factories, init parameters or logger.

Context is passed to all components defined in Tarsis MVC Framework when they are initialized.

Version:
$Revision: 117 $
Author:
Jose M. Palomar

Method Summary
 Authenticator getAuthenticator()
          Returns default Authenticator for this context.
 Authorizator getAuthorizator()
          Returns default Authorizator for this context.
 CommandFactory getCommandFactory()
          Returns default CommandFactory for this context.
 Factory getFactory(java.lang.String name)
          Returns an object Factory for given name in this context.
 java.lang.String getInitParameter(java.lang.String name)
          Returns an init parameter of this context.
 java.util.Map getInitParameters()
          Returns a map with all the init parameters of this context.
 Logger getLogger()
          Returns Logger of this context.
 java.lang.String getRealPath(java.lang.String path)
          Returns a String containing the real path for a given virtual path.
 java.net.URL getResource(java.lang.String path)
          Returns a URL to the resource that is mapped to a specified path.
 java.io.InputStream getResourceAsStream(java.lang.String path)
          Returns the resource located at the named path as an InputStream object.
 

Method Detail

getInitParameter

java.lang.String getInitParameter(java.lang.String name)
Returns an init parameter of this context.

Parameters:
name - String name of parameter.
Returns:
String value of parameter or null if parameter does not exist.

getInitParameters

java.util.Map getInitParameters()
Returns a map with all the init parameters of this context.

Returns:
Map map with all the init parameters of this context.

getAuthenticator

Authenticator getAuthenticator()
Returns default Authenticator for this context.

Returns:
Authenticator default Authenticator for this context.

getAuthorizator

Authorizator getAuthorizator()
Returns default Authorizator for this context.

Returns:
Authorizator default Authorizator for this context.

getLogger

Logger getLogger()
Returns Logger of this context.

Returns:
Logger Logger of this context.

getCommandFactory

CommandFactory getCommandFactory()
Returns default CommandFactory for this context.

Returns:
CommandFactory default CommandFactory for this context.

getFactory

Factory getFactory(java.lang.String name)
Returns an object Factory for given name in this context.

Parameters:
name - String name of factory.
Returns:
Factory object Factory for given name in this context or null if does not exist.

getResource

java.net.URL getResource(java.lang.String path)
                         throws java.net.MalformedURLException
Returns a URL to the resource that is mapped to a specified path.

Parameters:
path - String a String specifying the path to the resource.
Returns:
URL the resource located at the named path, or null if there is no resource at that path.
Throws:
java.net.MalformedURLException - if the pathname is not given in the correct form.
See Also:
ServletContext.getResource(java.lang.String)

getResourceAsStream

java.io.InputStream getResourceAsStream(java.lang.String path)
Returns the resource located at the named path as an InputStream object.

Parameters:
path - String a String specifying the path to the resource.
Returns:
InputStream the InputStream returned to the servlet, or null if no resource exists at the specified path.
See Also:
ServletContext.getResourceAsStream(java.lang.String)

getRealPath

java.lang.String getRealPath(java.lang.String path)
Returns a String containing the real path for a given virtual path.

Parameters:
path - String a String specifying the path to the resource.
Returns:
String a String specifying the real path, or null if the translation cannot be performed
See Also:
ServletContext.getRealPath(java.lang.String)


Copyright © 2002-2012 Talika Open Source Group. All Rights Reserved.