org.jmage.filterchain
Class XmlFilterChainFactory

java.lang.Object
  extended by org.jmage.filterchain.XmlFilterChainFactory
All Implemented Interfaces:
Configurable, FilterChainFactory

public class XmlFilterChainFactory
extends java.lang.Object
implements FilterChainFactory

Creates a filter filterchain from serialized xml format


Field Summary
protected  ApplicationContext applicationContext
           
protected static org.apache.log4j.Logger log
           
protected  javax.servlet.ServletContext servletContext
           
protected  XmlFilterChainDeserializer xmlFilterChainDeserializer
           
 
Constructor Summary
XmlFilterChainFactory()
           
 
Method Summary
 void configure(ApplicationContext context)
           
 FilterChain createFrom(java.net.URI filterChainUri)
          Creates a FilterChain for a given filterChainUri by deserializing it from xml.
 FilterChain createFrom(java.net.URI name, java.util.Properties filterProperties)
          Creates a FilterChain for a given name by deserializing it from xml and then applying additional filter properties on top.
protected  java.io.InputStream getClassPathResource(java.io.File file)
          Get the file from the classpath as a system resource
protected  java.io.InputStream getCurrentDirFile(java.io.File file)
          Get the file from the current application directory.
protected  java.io.InputStream getFromFile(java.io.File file)
          Get the image resource from a file.
protected  java.io.InputStream getJMAGEResourceDirFile(java.io.File file)
          Get the file from the dir specified trough the resourcedir property
protected  java.io.InputStream getServletContainerResource(java.io.File file)
          Get the xml file as inputstream from the ServletContainer.
protected  boolean hasInternalChain(java.net.URI filterChainUri)
           
protected  java.io.File mapURItoFile(java.net.URI uri)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

xmlFilterChainDeserializer

protected XmlFilterChainDeserializer xmlFilterChainDeserializer

applicationContext

protected ApplicationContext applicationContext

servletContext

protected javax.servlet.ServletContext servletContext

log

protected static org.apache.log4j.Logger log
Constructor Detail

XmlFilterChainFactory

public XmlFilterChainFactory()
Method Detail

configure

public void configure(ApplicationContext context)
Specified by:
configure in interface Configurable

createFrom

public FilterChain createFrom(java.net.URI filterChainUri)
                       throws FilterChainException
Creates a FilterChain for a given filterChainUri by deserializing it from xml.

Specified by:
createFrom in interface FilterChainFactory
Parameters:
filterChainUri - the unique filterChainUri
Returns:
the filter filterchain
Throws:
FilterChainException

createFrom

public FilterChain createFrom(java.net.URI name,
                              java.util.Properties filterProperties)
                       throws FilterChainException
Creates a FilterChain for a given name by deserializing it from xml and then applying additional filter properties on top.

Specified by:
createFrom in interface FilterChainFactory
Parameters:
name - the unique name
filterProperties - the additional filter properties
Returns:
the FilterChain
Throws:
FilterChainException

mapURItoFile

protected java.io.File mapURItoFile(java.net.URI uri)

hasInternalChain

protected boolean hasInternalChain(java.net.URI filterChainUri)

getFromFile

protected java.io.InputStream getFromFile(java.io.File file)
                                   throws ResourceException
Get the image resource from a file.

Parameters:
file - the file
Returns:
the image
Throws:
ResourceException

getServletContainerResource

protected java.io.InputStream getServletContainerResource(java.io.File file)
Get the xml file as inputstream from the ServletContainer.

Parameters:
file - the file
Returns:
the inputstream

getClassPathResource

protected java.io.InputStream getClassPathResource(java.io.File file)
                                            throws ResourceException
Get the file from the classpath as a system resource

Parameters:
file -
Returns:
true | false
Throws:
ResourceException

getCurrentDirFile

protected java.io.InputStream getCurrentDirFile(java.io.File file)
Get the file from the current application directory.

Parameters:
file - the file
Returns:
the image

getJMAGEResourceDirFile

protected java.io.InputStream getJMAGEResourceDirFile(java.io.File file)
Get the file from the dir specified trough the resourcedir property

Parameters:
file - the file
Returns:
the image or null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2004-2008 Sourceforge. All Rights Reserved.