org.abstracthorizon.danube.tapestry
Class DanubeContext

java.lang.Object
  extended by org.abstracthorizon.danube.tapestry.DanubeContext
All Implemented Interfaces:
Describable, AttributeHolder, InitializationParameterHolder, WebContext
Direct Known Subclasses:
SpringDanubeContext

public class DanubeContext
extends Object
implements WebContext

WebContext interface implementation.

Author:
Daniel Sendula

Field Summary
protected  Map<String,Object> attributes
          Contexct attributes
protected  TapestryConnectionHandler handler
          Reference to handler
 
Constructor Summary
DanubeContext(TapestryConnectionHandler handler)
          Constructor
 
Method Summary
 void describeTo(DescriptionReceiver receiver)
          Does nothing
 Object getAttribute(String name)
          Returns attribute
 List getAttributeNames()
          Returns attribute names
 List getInitParameterNames()
          Returns initial parameters names.
 String getInitParameterValue(String name)
          Gets initial parameter's value
 String getMimeType(String resourcePath)
          Returns mime type of given resource path
 URL getResource(String path)
          Returns resource as URL.
 void setAttribute(String name, Object attribute)
          Sets attribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

protected Map<String,Object> attributes
Contexct attributes


handler

protected TapestryConnectionHandler handler
Reference to handler

Constructor Detail

DanubeContext

public DanubeContext(TapestryConnectionHandler handler)
Constructor

Parameters:
handler - handler
Method Detail

getResource

public URL getResource(String path)
Returns resource as URL. It uses this classes class loader.

Specified by:
getResource in interface WebContext
Parameters:
path - resource path. If starts with "/" then it is removed.
Returns:
resource as URL.

getMimeType

public String getMimeType(String resourcePath)
Returns mime type of given resource path

Specified by:
getMimeType in interface WebContext
Parameters:
resourcePath - resource path
Returns:
mime type of given resource path

getAttributeNames

public List getAttributeNames()
Returns attribute names

Specified by:
getAttributeNames in interface AttributeHolder
Returns:
attribute names as a list

getAttribute

public Object getAttribute(String name)
Returns attribute

Specified by:
getAttribute in interface AttributeHolder
Parameters:
name - attribute name
Returns:
attribute

setAttribute

public void setAttribute(String name,
                         Object attribute)
Sets attribute

Specified by:
setAttribute in interface AttributeHolder
Parameters:
name - attribte name
attribute - attribute value

getInitParameterNames

public List getInitParameterNames()
Returns initial parameters names.

Specified by:
getInitParameterNames in interface InitializationParameterHolder
Returns:
list of initial parameter names

getInitParameterValue

public String getInitParameterValue(String name)
Gets initial parameter's value

Specified by:
getInitParameterValue in interface InitializationParameterHolder
Parameters:
name - attribute name
Returns:
initial parameter's value

describeTo

public void describeTo(DescriptionReceiver receiver)
Does nothing

Specified by:
describeTo in interface Describable
Parameters:
receiver - receiver


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.