org.norther.tammi.spray.servlet
Interface ServletConnector

All Superinterfaces:
Connector, Filter, Startable
All Known Implementing Classes:
DefaultServletConnector

public interface ServletConnector
extends Connector, Filter

An interface to servlet connectors.

ServletConnector implements both Connector and Filter interfaces allowing it to be configured as a connector between servlets and filters or as a startup filter without a separate servlet.

* A separate connector in addition to the servlet allows configuration of the connector separately from the server, which is instantiated by the servlet container.

Version:
$Id: ServletConnector.java,v 1.14 2009/09/28 15:08:27 cvsimp Exp $
Author:
Ilkka Priha

Field Summary
static String CONNECTION_TIMEOUT_PROPERTY
          The connection timeout property.
static String CONTINUE_PROPERTY
          The continue property.
static String FILTER_NAME_PROPERTY
          The filter name property.
static String INIT_PROPERTY_PREFIX
          The property prefix.
static String LOGGER_NAME_PROPERTY
          The logger name property.
static String OBJECT_NAME_PROPERTY
          The object name property.
static String PASS_THROUGHS_PROPERTY
          The pass throughs property.
static String PORT_PROPERTY
          The port property.
static String REDIRECT_PORT_PROPERTY
          The redirect port property.
static String REQUEST_TIMEOUT_PROPERTY
          The request timeout property.
 
Method Summary
 void doFilter(ServletRequest request, ServletResponse response)
          Connects a servlet and filters the request and response.
 String[] getPassThroughs()
          Gets the servlet path patterns to pass through this filter.
 boolean isContinue()
          Checks whether to continue filtering after the connector filter.
 void setContinue(boolean flag)
          Sets whether to continue filtering after the connector filter.
 void setPassThroughs(String[] patterns)
          Sets the servlet path patterns to pass through this filter.
 
Methods inherited from interface org.norther.tammi.spray.connector.Connector
getAddress, getConnectionCount, getConnectionTimeout, getFilterName, getKeyAlias, getLoggerName, getMaxIdleConnections, getName, getPort, getProvider, getRedirectPort, getRequestTimeout, isKeepConnection, isLoggingDisabled, isSecure, keepConnection, setConnectionTimeout, setFilterName, setKeyAlias, setKeyPassword, setLoggerName, setLoggingDisabled, setMaxIdleConnections, setPort, setProvider, setRedirectPort, setRequestTimeout, setSecure
 
Methods inherited from interface org.norther.tammi.core.base.Startable
isStarted, start, stop
 
Methods inherited from interface javax.servlet.Filter
destroy, doFilter, init
 

Field Detail

INIT_PROPERTY_PREFIX

static final String INIT_PROPERTY_PREFIX
The property prefix.


OBJECT_NAME_PROPERTY

static final String OBJECT_NAME_PROPERTY
The object name property.


FILTER_NAME_PROPERTY

static final String FILTER_NAME_PROPERTY
The filter name property.


LOGGER_NAME_PROPERTY

static final String LOGGER_NAME_PROPERTY
The logger name property.


PORT_PROPERTY

static final String PORT_PROPERTY
The port property.


REDIRECT_PORT_PROPERTY

static final String REDIRECT_PORT_PROPERTY
The redirect port property.


REQUEST_TIMEOUT_PROPERTY

static final String REQUEST_TIMEOUT_PROPERTY
The request timeout property.


CONNECTION_TIMEOUT_PROPERTY

static final String CONNECTION_TIMEOUT_PROPERTY
The connection timeout property.


PASS_THROUGHS_PROPERTY

static final String PASS_THROUGHS_PROPERTY
The pass throughs property.


CONTINUE_PROPERTY

static final String CONTINUE_PROPERTY
The continue property.

Method Detail

isContinue

boolean isContinue()
Checks whether to continue filtering after the connector filter.

Returns:
true to continue filtering, false otherwise.

setContinue

void setContinue(boolean flag)
Sets whether to continue filtering after the connector filter.

Parameters:
flag - true to continue filtering, false otherwise.

getPassThroughs

String[] getPassThroughs()
Gets the servlet path patterns to pass through this filter.

Returns:
an array of servlet path patterns.

setPassThroughs

void setPassThroughs(String[] patterns)
Sets the servlet path patterns to pass through this filter.

Each pattern is matched only against the first part of the servlet path and against the extension of the path info. So a pattern should be either of the form /<name>/* or .*<ext>. Correspondingly, the pattern /* matches root level files with an extension, not every path.

Parameters:
patterns - an array of servlet path patterns.

doFilter

void doFilter(ServletRequest request,
              ServletResponse response)
              throws ServletException,
                     IOException
Connects a servlet and filters the request and response.

Parameters:
request - the servlet request.
response - the servlet response.
Throws:
ServletException - for servlet errors.
IOException - for general errors.


Copyright © 2004 The Norther Organization. All rights reserved.