org.tuckey.web.filters.urlrewrite
Class Run

java.lang.Object
  extended by org.tuckey.web.filters.urlrewrite.Run

public class Run
extends java.lang.Object

Defines a run element, the ability to run a methodStr (eg, xx(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse))

Version:
$Revision: 43 $ $Date: 2006-10-31 17:29:59 +1300 (Tue, 31 Oct 2006) $
Author:
Paul Tuckey

Constructor Summary
Run()
           
 
Method Summary
 void addInitParam(java.lang.String name, java.lang.String value)
           
 void destroy()
          Run the underlying destroy methodStr on the run classStr.
 RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse)
          Deprecated. see #execute(HttpServletRequest,HttpServletResponse,Object[],FilterChain)
 RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, java.lang.Object[] params)
          Deprecated. use execute(HttpServletRequest, HttpServletResponse, Object[], FilterChain)
 RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, java.lang.Object[] params, javax.servlet.FilterChain chain)
           
 RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, StringMatchingMatcher matcher, ConditionMatch conditionMatch, javax.servlet.FilterChain chain)
           
 RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, java.lang.Throwable throwable)
          Will invoke the instance created in initialise.
 java.lang.String getClassStr()
          The name of the classStr that will be run for each rule match.
 java.lang.String getDisplayName()
           
 java.lang.String getError()
           
 int getId()
           
 java.lang.String getInitParam(java.lang.String paramName)
           
 java.lang.String getMethodSignature()
          The name of the method signature ie, setDate(java.util.Date, int).
 java.lang.String getMethodStr()
          The name of the methodStr that will be run for each rule match.
 java.lang.Object getRunClassInstance()
          Gets a handle on the instance of the class run is running.
 boolean initialise(javax.servlet.ServletContext context)
           
 boolean initialise(javax.servlet.ServletContext context, java.lang.Class extraParam)
          Initialise the Run, this will check specified classStr, constructor and methodStr exist.
 boolean isFilter()
           
 boolean isInitialised()
           
 boolean isNewEachTime()
           
 boolean isValid()
           
 void setClassStr(java.lang.String classStr)
           
 void setError(java.lang.String error)
           
 void setError(java.lang.String error, java.lang.Throwable t)
           
 void setId(int id)
           
 void setJsonHandler(boolean jsonHandler)
           
static void setLoadClass(boolean loadClass)
           
 void setMethodStr(java.lang.String methodStr)
           
 void setNewEachTime(boolean newEachTime)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Run

public Run()
Method Detail

initialise

public boolean initialise(javax.servlet.ServletContext context)
See Also:
initialise

initialise

public boolean initialise(javax.servlet.ServletContext context,
                          java.lang.Class extraParam)
Initialise the Run, this will check specified classStr, constructor and methodStr exist.


destroy

public void destroy()
Run the underlying destroy methodStr on the run classStr.


execute

public RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest,
                            javax.servlet.http.HttpServletResponse httpServletResponse)
                     throws java.io.IOException,
                            javax.servlet.ServletException,
                            java.lang.reflect.InvocationTargetException
Deprecated. see #execute(HttpServletRequest,HttpServletResponse,Object[],FilterChain)

Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.reflect.InvocationTargetException

execute

public RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest,
                            javax.servlet.http.HttpServletResponse httpServletResponse,
                            StringMatchingMatcher matcher,
                            ConditionMatch conditionMatch,
                            javax.servlet.FilterChain chain)
                     throws java.io.IOException,
                            javax.servlet.ServletException,
                            java.lang.reflect.InvocationTargetException
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.reflect.InvocationTargetException

execute

public RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest,
                            javax.servlet.http.HttpServletResponse httpServletResponse,
                            java.lang.Throwable throwable)
                     throws java.io.IOException,
                            javax.servlet.ServletException,
                            java.lang.reflect.InvocationTargetException
Will invoke the instance created in initialise.

Parameters:
httpServletRequest -
httpServletResponse -
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.reflect.InvocationTargetException

execute

public RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest,
                            javax.servlet.http.HttpServletResponse httpServletResponse,
                            java.lang.Object[] params)
                     throws java.io.IOException,
                            javax.servlet.ServletException,
                            java.lang.reflect.InvocationTargetException
Deprecated. use execute(HttpServletRequest, HttpServletResponse, Object[], FilterChain)

Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.reflect.InvocationTargetException

execute

public RewriteMatch execute(javax.servlet.http.HttpServletRequest httpServletRequest,
                            javax.servlet.http.HttpServletResponse httpServletResponse,
                            java.lang.Object[] params,
                            javax.servlet.FilterChain chain)
                     throws java.io.IOException,
                            javax.servlet.ServletException,
                            java.lang.reflect.InvocationTargetException
Throws:
java.io.IOException
javax.servlet.ServletException
java.lang.reflect.InvocationTargetException

getError

public java.lang.String getError()

setId

public void setId(int id)

getId

public int getId()

isValid

public boolean isValid()

isInitialised

public boolean isInitialised()

getClassStr

public java.lang.String getClassStr()
The name of the classStr that will be run for each rule match.

Returns:
String eg, org.tuckey.YellowObject

getMethodStr

public java.lang.String getMethodStr()
The name of the methodStr that will be run for each rule match.

Returns:
String eg, setDate

getMethodSignature

public java.lang.String getMethodSignature()
The name of the method signature ie, setDate(java.util.Date, int). Includes fully qualified object names for paramters.


isNewEachTime

public boolean isNewEachTime()

setNewEachTime

public void setNewEachTime(boolean newEachTime)

getRunClassInstance

public java.lang.Object getRunClassInstance()
Gets a handle on the instance of the class run is running.

If newEachTime is set to true this will always return null.


addInitParam

public void addInitParam(java.lang.String name,
                         java.lang.String value)

getInitParam

public java.lang.String getInitParam(java.lang.String paramName)

setClassStr

public void setClassStr(java.lang.String classStr)

setMethodStr

public void setMethodStr(java.lang.String methodStr)

setLoadClass

public static void setLoadClass(boolean loadClass)

setError

public void setError(java.lang.String error,
                     java.lang.Throwable t)

setError

public void setError(java.lang.String error)

getDisplayName

public java.lang.String getDisplayName()

isFilter

public boolean isFilter()

setJsonHandler

public void setJsonHandler(boolean jsonHandler)