org.norther.tammi.spray.connector
Interface Connector

All Superinterfaces:
Startable
All Known Subinterfaces:
ChannelConnector, ExecutableConnector, LocalConnector, RMIConnector, ServletConnector, SocketConnector, TCPConnector
All Known Implementing Classes:
DefaultChannelConnector, DefaultConnector, DefaultExecutableConnector, DefaultLocalConnector, DefaultRMIConnector, DefaultServletConnector, DefaultSocketConnector, DefaultTCPConnector

public interface Connector
extends Startable

An interface to connectors listening and processing client requests. Note that many of the connector attributes may take effect only after the connector is restarted.

Version:
$Id: Connector.java,v 1.16 2009/09/28 15:08:30 cvsimp Exp $
Author:
Ilkka Priha

Method Summary
 String getAddress()
          Gets the address of the server of the connection.
 int getConnectionCount()
          Gets a snapshot of the number of active and idle connections.
 int getConnectionTimeout()
          Gets the timeout to wait for a request from an idle connection.
 ObjectName getFilterName()
          Gets the filter processing the requests.
 String getKeyAlias()
          Gets the certificate key alias of the connection.
 ObjectName getLoggerName()
          Gets the the access logger of this connector.
 int getMaxIdleConnections()
          Gets the maximum number of idle connections to keep alive.
 String getName()
          Gets the name of the server of the connection.
 int getPort()
          Gets the port of the connector.
 String getProvider()
          Gets the provider of the connection.
 int getRedirectPort()
          Gets the port of the corresponding secure/non-secure port to redirect requests.
 int getRequestTimeout()
          Gets the timeout for the processing time of one client request.
 boolean isKeepConnection()
          Checks whether to keep connections alive on idle after processing the corresponding requests if applicable.
 boolean isLoggingDisabled()
          Checks whether access logging of this connector is disabled.
 boolean isSecure()
          Checks the secure connections flag.
 boolean keepConnection(Connection con)
          Keeps the specified connection alive on idle after processing the corresponding request if applicable.
 void setConnectionTimeout(int timeout)
          Sets the timeout to wait for a request in an idle connection.
 void setFilterName(ObjectName filter)
          Sets the filter processing the requests.
 void setKeyAlias(String alias)
          Sets the certificate key alias of the connection.
 void setKeyPassword(String pswd)
          Sets the certificate key password of the connection.
 void setLoggerName(ObjectName logger)
          Sets the access logger of this connector.
 void setLoggingDisabled(boolean flag)
          Sets whether access logging of this connector is disabled.
 void setMaxIdleConnections(int count)
          Sets the maximum number of idle connections to keep alive.
 void setPort(int port)
          Sets the port of the connector.
 void setProvider(String name)
          Sets the provider of the connection.
 void setRedirectPort(int port)
          Sets the port of the corresponding secure/non-secure port to redirect requests.
 void setRequestTimeout(int timeout)
          Sets the timeout for the processing time of one client request.
 void setSecure(boolean secure)
          Sets the secure connections flag.
 
Methods inherited from interface org.norther.tammi.core.base.Startable
isStarted, start, stop
 

Method Detail

getName

String getName()
Gets the name of the server of the connection.

Returns:
the name of the server.

getAddress

String getAddress()
Gets the address of the server of the connection.

Returns:
the address of the server.

getProvider

String getProvider()
Gets the provider of the connection.

Returns:
the name of the provider.

setProvider

void setProvider(String name)
Sets the provider of the connection.

Parameters:
name - the name of the provider.

getKeyAlias

String getKeyAlias()
Gets the certificate key alias of the connection.

Returns:
the key alias.

setKeyAlias

void setKeyAlias(String alias)
Sets the certificate key alias of the connection.

Parameters:
alias - the key alias.

setKeyPassword

void setKeyPassword(String pswd)
Sets the certificate key password of the connection.

Parameters:
pswd - the key pssword.

getPort

int getPort()
Gets the port of the connector.

Returns:
the port number.

setPort

void setPort(int port)
Sets the port of the connector.

Parameters:
port - the port number.

getRedirectPort

int getRedirectPort()
Gets the port of the corresponding secure/non-secure port to redirect requests.

Returns:
the redirect port number.

setRedirectPort

void setRedirectPort(int port)
Sets the port of the corresponding secure/non-secure port to redirect requests.

Parameters:
port - the redirect port number.

isSecure

boolean isSecure()
Checks the secure connections flag.

Returns:
true if connections are secure.

setSecure

void setSecure(boolean secure)
Sets the secure connections flag.

Parameters:
secure - the secure connections flag.

getFilterName

ObjectName getFilterName()
Gets the filter processing the requests.

Returns:
the name or pattern of the filter.

setFilterName

void setFilterName(ObjectName filter)
Sets the filter processing the requests.

Parameters:
filter - the name or pattern of the filter.

getRequestTimeout

int getRequestTimeout()
Gets the timeout for the processing time of one client request.

Returns:
the timeout for requests in msecs.

setRequestTimeout

void setRequestTimeout(int timeout)
Sets the timeout for the processing time of one client request. -1 grants endless processing time.

Parameters:
timeout - a new timeout for requests in msecs.

getConnectionTimeout

int getConnectionTimeout()
Gets the timeout to wait for a request from an idle connection.

Returns:
the timeout for connections in msecs.

setConnectionTimeout

void setConnectionTimeout(int timeout)
Sets the timeout to wait for a request in an idle connection. The timeout is used only if connections are to be kept alive after request processing. -1 waits until the client closes the connection, 0 waits only if the next request is already available and other values wait for the specified time.

Parameters:
timeout - the timeout for connections in msecs.

getMaxIdleConnections

int getMaxIdleConnections()
Gets the maximum number of idle connections to keep alive.

Returns:
the max number of idle connections.

setMaxIdleConnections

void setMaxIdleConnections(int count)
Sets the maximum number of idle connections to keep alive. -1 indicates an indefinite number of connections.

Note that how to apply the limit to the active number of connections is implementation dependent.

Parameters:
count - the max number of idle connections.

getConnectionCount

int getConnectionCount()
Gets a snapshot of the number of active and idle connections.

Note that the count is implementation dependent and its accuracy may vary.

Returns:
the number of connections.

isLoggingDisabled

boolean isLoggingDisabled()
Checks whether access logging of this connector is disabled.

Returns:
true if logging is disabled, false otherwise.

setLoggingDisabled

void setLoggingDisabled(boolean flag)
Sets whether access logging of this connector is disabled.

Parameters:
flag - true if logging is disabled, false otherwise.

getLoggerName

ObjectName getLoggerName()
Gets the the access logger of this connector.

Returns:
the object name of the logger or a query.

setLoggerName

void setLoggerName(ObjectName logger)
Sets the access logger of this connector. If it is not set, the default one will be used.

Parameters:
logger - the object name of the logger or a query.

isKeepConnection

boolean isKeepConnection()
Checks whether to keep connections alive on idle after processing the corresponding requests if applicable.

Returns:
true to keep, false otherwise.

keepConnection

boolean keepConnection(Connection con)
Keeps the specified connection alive on idle after processing the corresponding request if applicable.

Parameters:
con - the connection.
Returns:
true if kept, false otherwise.


Copyright © 2004 The Norther Organization. All rights reserved.