org.norther.tammi.spray.servlet
Class DefaultServletMediaProvider

java.lang.Object
  extended by org.norther.tammi.core.base.Adaptee
      extended by org.norther.tammi.spray.media.DefaultMediaProvider
          extended by org.norther.tammi.spray.media.DefaultCachedMediaProvider
              extended by org.norther.tammi.spray.servlet.DefaultServletMediaProvider
All Implemented Interfaces:
Serializable, NotificationBroadcaster, NotificationEmitter, Manageable, MBeanDelegate, Refreshable, CacheClient, CachedMediaProvider, MediaProvider, ServletMediaProvider

public class DefaultServletMediaProvider
extends DefaultCachedMediaProvider
implements ServletMediaProvider

A default implementation of ServletMediaProvider.

Author:
Ilkka Priha
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.norther.tammi.core.base.Adaptee
ADAPTEE_NOTIF_DESCRIPTION, ADAPTEE_NOTIFICATIONS
 
Fields inherited from interface org.norther.tammi.core.base.MBeanDelegate
ARRAY_TYPE, OBJECT_TYPE, PRIMITIVE_TYPE, STRING_TYPE
 
Constructor Summary
DefaultServletMediaProvider()
          Counstructs a new preovider.
 
Method Summary
 ObjectName getContextName()
          Gets the startup context name.
 Resource getResource(String path, boolean cached, ServletRequest request, ServletResponse response, FilterChain chain)
          Gets the media content resource.
 void setContextName(ObjectName name)
          Sets the startup context name.
 
Methods inherited from class org.norther.tammi.spray.media.DefaultCachedMediaProvider
clearCached, expireCached, expireFraction, getCache, getCachedResource, getRefreshed, getResourceCacheName, isCachingDisabled, postmanaged, refresh, removeCache, removeCachedResource, setCachedResource, setCachedResource, setCachingDisabled, setResourceCacheName, unmanaged
 
Methods inherited from class org.norther.tammi.spray.media.DefaultMediaProvider
getDefaultIndex, getDefaultIndex, getMediaKey, isLocalizedContent, setDefaultIndex, setLocalizedContent, setMediaKey
 
Methods inherited from class org.norther.tammi.core.base.Adaptee
addAdaptee, addNotificationListener, getAttributeSupport, getBroker, getCanonicalName, getDomain, getFactory, getLoader, getLog, getLog, getMBean, getMBeanServer, getNotificationInfo, getObjectName, getRegistrationTime, getSequenceNumber, hasListeners, isRegistered, premanaged, removeNotificationListener, removeNotificationListener, sendNotification, sendNotification, sendNotification, sendNotification, unregister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.norther.tammi.spray.media.CachedMediaProvider
getCachedResource, getResourceCacheName, removeCachedResource, setCachedResource, setCachedResource, setResourceCacheName
 
Methods inherited from interface org.norther.tammi.spray.media.MediaProvider
getDefaultIndex, getMediaKey, isLocalizedContent, setDefaultIndex, setLocalizedContent, setMediaKey
 
Methods inherited from interface org.norther.tammi.core.cache.CacheClient
clearCached, expireCached, expireFraction, getCache, isCachingDisabled, removeCache, setCachingDisabled
 
Methods inherited from interface org.norther.tammi.core.base.Refreshable
getRefreshed, refresh
 

Constructor Detail

DefaultServletMediaProvider

public DefaultServletMediaProvider()
Counstructs a new preovider.

Method Detail

getContextName

public ObjectName getContextName()
Description copied from interface: ServletMediaProvider
Gets the startup context name.

Specified by:
getContextName in interface ServletMediaProvider
Returns:
the name of the context or a query.

setContextName

public void setContextName(ObjectName name)
Description copied from interface: ServletMediaProvider
Sets the startup context name.

Specified by:
setContextName in interface ServletMediaProvider
Parameters:
name - the name of the context or a query.

getResource

public Resource getResource(String path,
                            boolean cached,
                            ServletRequest request,
                            ServletResponse response,
                            FilterChain chain)
                     throws IOException,
                            ConstructionException,
                            AccessDeniedException
Description copied from interface: MediaProvider
Gets the media content resource.

Specified by:
getResource in interface MediaProvider
Overrides:
getResource in class DefaultCachedMediaProvider
Parameters:
path - the content path.
cached - true if caching is enabled, false otherwise.
request - the servlet request.
response - the servlet response.
chain - the filter chain.
Returns:
the resource source.
Throws:
IOException - on I/O errors.
ConstructionException - on resource errors.
AccessDeniedException - for access restrictions.


Copyright © 2004 The Norther Organization. All rights reserved.