org.apache.servicemix.http
Class HttpConfiguration

java.lang.Object
  extended by org.apache.servicemix.http.HttpConfiguration
All Implemented Interfaces:
HttpConfigurationMBean

public class HttpConfiguration
extends Object
implements HttpConfigurationMBean

Class to hold the configuration for the Jetty instance used by an HTTP endpoint.

Author:
gnodet

Field Summary
static String CONFIG_FILE
           
static String DEFAULT_JETTY_CONNECTOR_CLASS_NAME
           
static String MAPPING_DEFAULT
           
 
Constructor Summary
HttpConfiguration()
           
 
Method Summary
 Object getAuthenticationService()
          Gets the authentication service being used.
 String getAuthenticationServiceName()
          Gets the JNDI name of the authentication service object.
 String getComponentName()
           
 int getConnectorMaxIdleTime()
          Gets the amount of time, in milliseconds, that a connection will sit idle before timing out.
 int getConsumerProcessorSuspendTime()
          Gets the number of milliseconds passed to the susspend method of the Jetty Continuation object used to process requests.
 int getJettyClientThreadPoolSize()
          Get the maximum number of threads in the client-side thread pool.
 String getJettyConnectorClassName()
          Returns the name of the class implementing the Jetty connector used by an HTTP endpoint.
 int getJettyThreadPoolSize()
          Gets the number of maximum number of threads in the server-side threadpool.
 Object getKeystoreManager()
          Gets the object used as the keystore manager.
 String getKeystoreManagerName()
          Gets the JNDI name of the keystore manager object.
 String getMapping()
           
 int getMaxConnectionsPerHost()
          Gets the maximum number of concurent requests allowed from a particular host.
 int getMaxTotalConnections()
          Gets the maximum number of concurent connections allowed to an endpoint.
 String getProxyHost()
           
 int getProxyPort()
           
 int getRetryCount()
          Gets the number of times a request will be tried before an error is created.
 String getRootDir()
           
 boolean isJettyClientPerProvider()
          Determines if each HTTP provider endpoint uses its own Jetty client.
 boolean isJettyManagement()
           
 boolean isManaged()
           
 boolean isStreamingEnabled()
          Determines if client-side requests use HTTP streaming.
 boolean isWantHeadersFromHttpIntoExchange()
          Determines if the HTTP provider processor copies the HTTP headers from the HTTP response into the JBI exchange.
 boolean load()
           
 void save()
           
 void setAuthenticationService(Object authenticationService)
          Directly sets the authenitcation service object to be used for authentication.
 void setAuthenticationServiceName(String authenticationServiceName)
          Sets the JNDI name of the authentication service object.
 void setComponentName(String componentName)
           
 void setConnectorMaxIdleTime(int connectorMaxIdleTime)
          Sets the amount of time, in milliseconds, that a connection will sit idle before timing out.
 void setConsumerProcessorSuspendTime(int consumerProcessorSuspendTime)
          Sets the number of milliseconds passed to the susspend method of the Jetty Continuation object used to process requests.
 void setJettyClientPerProvider(boolean jettyClientPerProvider)
          Specifies whether each HTTP provider endpoint uses its own Jetty client.
 void setJettyClientThreadPoolSize(int jettyClientThreadPoolSize)
          Sets the maximum number of threads in the client-side thread pool.
 void setJettyConnectorClassName(String jettyConnectorClassName)
          Sets the classname of the Jetty connector used by an HTTP endpoint.
 void setJettyManagement(boolean jettyManagement)
           
 void setJettyThreadPoolSize(int jettyThreadPoolSize)
          Sets the maximum number of threads in the server-side thread pool.
 void setKeystoreManager(Object keystoreManager)
          Directly sets the keystore manager object to be used for authentication.
 void setKeystoreManagerName(String keystoreManagerName)
          Sets the JNDI name of the keystore manager object.
 void setManaged(boolean managed)
           
 void setMapping(String mapping)
           
 void setMaxConnectionsPerHost(int maxConnectionsPerHost)
          Sets the maximum number of connections allowed from a particular host.
 void setMaxTotalConnections(int maxTotalConnections)
          Sets the maximum number of total concurrent connections allowed to an endpoint.
protected  void setProperty(String name, String value)
           
 void setProxyHost(String proxyHost)
           
 void setProxyPort(int proxyPort)
           
 void setRetryCount(int retryCount)
          Sets the number of times a request will be tried before an error is created.
 void setRootDir(String rootDir)
           
 void setStreamingEnabled(boolean streamingEnabled)
          Sets whether or not client-side requests use HTTP streaming.
 void setWantHeadersFromHttpIntoExchange(boolean wantHeadersFromHttpIntoExchange)
          Specifies if the HTTP provider processor copies the HTTP headers from the HTTP response into the JBI exchange.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_JETTY_CONNECTOR_CLASS_NAME

public static final String DEFAULT_JETTY_CONNECTOR_CLASS_NAME

MAPPING_DEFAULT

public static final String MAPPING_DEFAULT
See Also:
Constant Field Values

CONFIG_FILE

public static final String CONFIG_FILE
See Also:
Constant Field Values
Constructor Detail

HttpConfiguration

public HttpConfiguration()
Method Detail

getRootDir

public String getRootDir()
Returns:
Returns the rootDir.

setRootDir

public void setRootDir(String rootDir)
Parameters:
rootDir - The rootDir to set.

getComponentName

public String getComponentName()
Returns:
Returns the componentName.

setComponentName

public void setComponentName(String componentName)
Parameters:
componentName - The componentName to set.

getMapping

public String getMapping()
Returns:
the mapping

setMapping

public void setMapping(String mapping)
Parameters:
mapping - the mapping to set

isManaged

public boolean isManaged()
Returns:
the managed

setManaged

public void setManaged(boolean managed)
Parameters:
managed - the managed to set

isJettyManagement

public boolean isJettyManagement()
Specified by:
isJettyManagement in interface HttpConfigurationMBean
Returns:
the jettyManagement

setJettyManagement

public void setJettyManagement(boolean jettyManagement)
Specified by:
setJettyManagement in interface HttpConfigurationMBean
Parameters:
jettyManagement - the jettyManagement to set

getAuthenticationService

public Object getAuthenticationService()
Gets the authentication service being used.

Returns:
the authenticationService object

setAuthenticationService

public void setAuthenticationService(Object authenticationService)
Directly sets the authenitcation service object to be used for authentication. This object takes precedence over the JNDI name specified by setAuthenticationServiceName.

Parameters:
authenticationService - the authenticationService object

getAuthenticationServiceName

public String getAuthenticationServiceName()
Gets the JNDI name of the authentication service object.

Specified by:
getAuthenticationServiceName in interface HttpConfigurationMBean
Returns:
a string representing the JNDI name for the authentication service object.

setAuthenticationServiceName

public void setAuthenticationServiceName(String authenticationServiceName)
Sets the JNDI name of the authentication service object.

Specified by:
setAuthenticationServiceName in interface HttpConfigurationMBean
Parameters:
authenticationServiceName - a string representing the JNDI name for the authentication service object.

getKeystoreManager

public Object getKeystoreManager()
Gets the object used as the keystore manager.

Returns:
the keystoreManager object

setKeystoreManager

public void setKeystoreManager(Object keystoreManager)
Directly sets the keystore manager object to be used for authentication. This object takes precedence over the JNDI name specified by setKeystoreManagerName.

Parameters:
keystoreManager - the keystoreManager object

getKeystoreManagerName

public String getKeystoreManagerName()
Gets the JNDI name of the keystore manager object.

Specified by:
getKeystoreManagerName in interface HttpConfigurationMBean
Returns:
a string representing the JNDI name for the keystore manager object.

setKeystoreManagerName

public void setKeystoreManagerName(String keystoreManagerName)
Sets the JNDI name of the keystore manager object.

Specified by:
setKeystoreManagerName in interface HttpConfigurationMBean
Parameters:
keystoreManagerName - a string representing the JNDI name for the keystore manager object.

isStreamingEnabled

public boolean isStreamingEnabled()
Determines if client-side requests use HTTP streaming.

Specified by:
isStreamingEnabled in interface HttpConfigurationMBean
Returns:
true if client-side requests use streaming

setStreamingEnabled

public void setStreamingEnabled(boolean streamingEnabled)
Sets whether or not client-side requests use HTTP streaming.

Specified by:
setStreamingEnabled in interface HttpConfigurationMBean
Parameters:
streamingEnabled - Set to true to enable client-side HTTP streaming.

getJettyConnectorClassName

public String getJettyConnectorClassName()
Returns the name of the class implementing the Jetty connector used by an HTTP endpoint.

Specified by:
getJettyConnectorClassName in interface HttpConfigurationMBean
Returns:
a string representing the classname of the Jetty conector being used

setJettyConnectorClassName

public void setJettyConnectorClassName(String jettyConnectorClassName)
Sets the classname of the Jetty connector used by an HTTP endpoint.

Specified by:
setJettyConnectorClassName in interface HttpConfigurationMBean
Parameters:
jettyConnectorClassName - a String representing the classname of the Jetty connector to use.

getJettyThreadPoolSize

public int getJettyThreadPoolSize()
Gets the number of maximum number of threads in the server-side threadpool.

Specified by:
getJettyThreadPoolSize in interface HttpConfigurationMBean
Returns:
an integer representing the maximum number of threads in the server-side threadpool

setJettyThreadPoolSize

public void setJettyThreadPoolSize(int jettyThreadPoolSize)
Sets the maximum number of threads in the server-side thread pool. The default is 255 to match Jetty's default setting.

Specified by:
setJettyThreadPoolSize in interface HttpConfigurationMBean
Parameters:
jettyThreadPoolSize - an integer representing the maximum number of threads in the server-side thread pool

getJettyClientThreadPoolSize

public int getJettyClientThreadPoolSize()
Get the maximum number of threads in the client-side thread pool.

Specified by:
getJettyClientThreadPoolSize in interface HttpConfigurationMBean
Returns:
an int representing the maximum number of threads in the client-side thread pool.

setJettyClientThreadPoolSize

public void setJettyClientThreadPoolSize(int jettyClientThreadPoolSize)
Sets the maximum number of threads in the client-side thread pool.

Specified by:
setJettyClientThreadPoolSize in interface HttpConfigurationMBean
Parameters:
jettyClientThreadPoolSize - an int specifiying the maximum number of threads available in the client-side thread pool

isJettyClientPerProvider

public boolean isJettyClientPerProvider()
Determines if each HTTP provider endpoint uses its own Jetty client. The default is for all HTTP provider endpoints to use a shared Jetty client.

Specified by:
isJettyClientPerProvider in interface HttpConfigurationMBean
Returns:
true if HTTP providers use individual Jetty clients

setJettyClientPerProvider

public void setJettyClientPerProvider(boolean jettyClientPerProvider)
Specifies whether each HTTP provider endpoint uses its own Jetty client. The default behavior is that all HTTP provider endpoints use a shrared Jetty client.

Specified by:
setJettyClientPerProvider in interface HttpConfigurationMBean
Parameters:
jettyClientProvider - true if HTTP providers are to use individual Jetty clients

getMaxConnectionsPerHost

public int getMaxConnectionsPerHost()
Gets the maximum number of concurent requests allowed from a particular host.

Specified by:
getMaxConnectionsPerHost in interface HttpConfigurationMBean
Returns:
an int representing the maximum number of connections

setMaxConnectionsPerHost

public void setMaxConnectionsPerHost(int maxConnectionsPerHost)
Sets the maximum number of connections allowed from a particular host. The default is 65536.

Specified by:
setMaxConnectionsPerHost in interface HttpConfigurationMBean
Parameters:
maxConnectionsPerHost - an int specifying the max number of connecitons

getMaxTotalConnections

public int getMaxTotalConnections()
Gets the maximum number of concurent connections allowed to an endpoint.

Specified by:
getMaxTotalConnections in interface HttpConfigurationMBean
Returns:
an int representing the total number of allowed concurrent connections

setMaxTotalConnections

public void setMaxTotalConnections(int maxTotalConnections)
Sets the maximum number of total concurrent connections allowed to an endpoint.

Specified by:
setMaxTotalConnections in interface HttpConfigurationMBean
Parameters:
maxTotalConnections - an int specifying the total number of concurrent connections allowed to an endpoint

getConnectorMaxIdleTime

public int getConnectorMaxIdleTime()
Gets the amount of time, in milliseconds, that a connection will sit idle before timing out.

Specified by:
getConnectorMaxIdleTime in interface HttpConfigurationMBean
Returns:
an int representing the number of milliseconds before an idle connection will timeout

setConnectorMaxIdleTime

public void setConnectorMaxIdleTime(int connectorMaxIdleTime)
Sets the amount of time, in milliseconds, that a connection will sit idle before timing out. The default is 30000.

Specified by:
setConnectorMaxIdleTime in interface HttpConfigurationMBean
Parameters:
connectorMaxIdleTime - an int specifying the number of milliseconds that a connection will sit idle before timing out

getConsumerProcessorSuspendTime

public int getConsumerProcessorSuspendTime()
Gets the number of milliseconds passed to the susspend method of the Jetty Continuation object used to process requests.

Specified by:
getConsumerProcessorSuspendTime in interface HttpConfigurationMBean
Returns:
an int representing the number of milliseconds the Jetty Continuation object will susspend the processing of the current request

setConsumerProcessorSuspendTime

public void setConsumerProcessorSuspendTime(int consumerProcessorSuspendTime)
Sets the number of milliseconds passed to the susspend method of the Jetty Continuation object used to process requests. The Continuation object is used to optimize connection resources when the endpoint is under heavy load. The default is 60000.

Specified by:
setConsumerProcessorSuspendTime in interface HttpConfigurationMBean
Parameters:
consumerProcessorSuspendTime - an int representing the number of milliseconds the Jetty Continuation object will susspend the processing of the current request

getRetryCount

public int getRetryCount()
Gets the number of times a request will be tried before an error is created.

Specified by:
getRetryCount in interface HttpConfigurationMBean
Returns:
an int representing the number of times a request will be attempted before an error is raised

setRetryCount

public void setRetryCount(int retryCount)
Sets the number of times a request will be tried before an error is created. The default is 3. If streaming is enabled, the value will always be 0.

Specified by:
setRetryCount in interface HttpConfigurationMBean
Parameters:
retryCount - an int representing the number of times a request will be attempted before an error is raised

getProxyHost

public String getProxyHost()
Specified by:
getProxyHost in interface HttpConfigurationMBean
Returns:
Returns the proxyHost.

setProxyHost

public void setProxyHost(String proxyHost)
Specified by:
setProxyHost in interface HttpConfigurationMBean
Parameters:
proxyHost - The proxyHost to set.

getProxyPort

public int getProxyPort()
Specified by:
getProxyPort in interface HttpConfigurationMBean
Returns:
Returns the proxyPort.

setProxyPort

public void setProxyPort(int proxyPort)
Specified by:
setProxyPort in interface HttpConfigurationMBean
Parameters:
proxyPort - The proxyPort to set.

isWantHeadersFromHttpIntoExchange

public boolean isWantHeadersFromHttpIntoExchange()
Determines if the HTTP provider processor copies the HTTP headers from the HTTP response into the JBI exchange.

Specified by:
isWantHeadersFromHttpIntoExchange in interface HttpConfigurationMBean
Returns:
true if the HTTP headers will be copied into the exchange

setWantHeadersFromHttpIntoExchange

public void setWantHeadersFromHttpIntoExchange(boolean wantHeadersFromHttpIntoExchange)
Specifies if the HTTP provider processor copies the HTTP headers from the HTTP response into the JBI exchange. If the headers will be used for a new HTTP reuquest, setting this to true leads to an error.

Specified by:
setWantHeadersFromHttpIntoExchange in interface HttpConfigurationMBean
Parameters:
wantHeadersFromHttpIntoExchange - true if the HTTP headers will be copied into the exchange

save

public void save()

setProperty

protected void setProperty(String name,
                           String value)

load

public boolean load()


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.