Package com.consol.citrus.http.server
Class HttpServer
- java.lang.Object
-
- com.consol.citrus.endpoint.AbstractEndpoint
-
- com.consol.citrus.server.AbstractServer
-
- com.consol.citrus.http.server.HttpServer
-
- All Implemented Interfaces:
InitializingPhase
,Named
,ShutdownPhase
,Endpoint
,Server
,com.consol.citrus.spi.ReferenceResolverAware
,Runnable
public class HttpServer extends AbstractServer
Simple Http server implementation starting an embedded Jetty server instance with Spring Application context support. Incoming requests are handled with Spring MVC.- Since:
- 2007
- Author:
- Christoph Deppisch
-
-
Field Summary
-
Fields inherited from class com.consol.citrus.server.AbstractServer
DEFAULT_CHANNEL_ID_SUFFIX
-
-
Constructor Summary
Constructors Constructor Description HttpServer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.springframework.http.MediaType>
getBinaryMediaTypes()
Gets the binaryMediaTypes.org.eclipse.jetty.server.Connector
getConnector()
Gets the connector.org.eclipse.jetty.server.Connector[]
getConnectors()
Gets the connectors.String
getContextConfigLocation()
Gets the contextConfigLocation.String
getContextPath()
Gets the contextPath.int
getDefaultStatusCode()
Gets the defaultStatusCode.protected org.springframework.web.servlet.DispatcherServlet
getDispatcherServlet()
Gets the Citrus dispatcher servlet.Map<String,String>
getFilterMappings()
Gets the value of the filterMappings property.Map<String,javax.servlet.Filter>
getFilters()
Gets the value of the filters property.HttpMessageConverter
getMessageConverter()
Gets the message converter.int
getPort()
Gets the port.String
getResourceBase()
Gets the resourceBase.int
getResponseCacheSize()
Gets the response cache size.org.eclipse.jetty.security.SecurityHandler
getSecurityHandler()
Gets the securityHandler.org.eclipse.jetty.servlet.ServletHandler
getServletHandler()
Gets the servletHandler.String
getServletMappingPath()
Gets the servletMappingPath.String
getServletName()
Gets the customized servlet name or default name if not set.void
initialize()
boolean
isHandleAttributeHeaders()
Gets the handleAttributeHeaders.boolean
isHandleCookies()
Gets the handleCookies.boolean
isUseRootContextAsParent()
Gets the useRootContextAsParent.void
setBinaryMediaTypes(List<org.springframework.http.MediaType> binaryMediaTypes)
Sets the binaryMediaTypes.void
setConnector(org.eclipse.jetty.server.Connector connector)
Sets the connector.void
setConnectors(org.eclipse.jetty.server.Connector[] connectors)
Sets the connectors.void
setContextConfigLocation(String contextConfigLocation)
Sets the contextConfigLocation.void
setContextPath(String contextPath)
Sets the contextPath.void
setDefaultStatusCode(int defaultStatusCode)
Sets the defaultStatusCode.void
setFilterMappings(Map<String,String> filterMappings)
Sets the filterMappings property.void
setFilters(Map<String,javax.servlet.Filter> filters)
Sets the filters property.void
setHandleAttributeHeaders(boolean handleAttributeHeaders)
Sets the handleAttributeHeaders.void
setHandleCookies(boolean handleCookies)
Sets the handleCookies.void
setMessageConverter(HttpMessageConverter messageConverter)
Sets the message converter.void
setPort(int port)
Sets the port.void
setResourceBase(String resourceBase)
Sets the resourceBase.void
setResponseCacheSize(int responseCacheSize)
Sets the response cache size.void
setSecurityHandler(org.eclipse.jetty.security.SecurityHandler securityHandler)
Sets the securityHandler.void
setServletHandler(org.eclipse.jetty.servlet.ServletHandler servletHandler)
Sets the servletHandler.void
setServletMappingPath(String servletMappingPath)
Sets the servletMappingPath.void
setServletName(String servletName)
Sets the servletName.void
setUseRootContextAsParent(boolean useRootContextAsParent)
Sets the useRootContextAsParent.protected void
shutdown()
protected void
startup()
-
Methods inherited from class com.consol.citrus.server.AbstractServer
createConsumer, createProducer, destroy, getDefaultTimeout, getEndpointAdapter, getEndpointConfiguration, getInterceptors, getReferenceResolver, isAutoStart, isDebugLogging, isRunning, join, run, setAutoStart, setDebugLogging, setDefaultTimeout, setEndpointAdapter, setInterceptors, setReferenceResolver, setRunning, start, stop
-
Methods inherited from class com.consol.citrus.endpoint.AbstractEndpoint
getActor, getConsumerName, getName, getProducerName, setActor, setName
-
-
-
-
Method Detail
-
shutdown
protected void shutdown()
- Specified by:
shutdown
in classAbstractServer
-
startup
protected void startup()
- Specified by:
startup
in classAbstractServer
-
initialize
public void initialize()
- Specified by:
initialize
in interfaceInitializingPhase
- Overrides:
initialize
in classAbstractServer
-
getDispatcherServlet
protected org.springframework.web.servlet.DispatcherServlet getDispatcherServlet()
Gets the Citrus dispatcher servlet.- Returns:
-
getServletName
public String getServletName()
Gets the customized servlet name or default name if not set.- Returns:
- the servletName
-
getPort
public int getPort()
Gets the port.- Returns:
- the port the port to get.
-
setPort
public void setPort(int port)
Sets the port.- Parameters:
port
- the port to set
-
getResourceBase
public String getResourceBase()
Gets the resourceBase.- Returns:
- the resourceBase the resourceBase to get.
-
setResourceBase
public void setResourceBase(String resourceBase)
Sets the resourceBase.- Parameters:
resourceBase
- the resourceBase to set
-
getContextConfigLocation
public String getContextConfigLocation()
Gets the contextConfigLocation.- Returns:
- the contextConfigLocation the contextConfigLocation to get.
-
setContextConfigLocation
public void setContextConfigLocation(String contextConfigLocation)
Sets the contextConfigLocation.- Parameters:
contextConfigLocation
- the contextConfigLocation to set
-
getConnector
public org.eclipse.jetty.server.Connector getConnector()
Gets the connector.- Returns:
- the connector the connector to get.
-
setConnector
public void setConnector(org.eclipse.jetty.server.Connector connector)
Sets the connector.- Parameters:
connector
- the connector to set
-
setFilters
public void setFilters(Map<String,javax.servlet.Filter> filters)
Sets the filters property.- Parameters:
filters
-
-
getFilters
public Map<String,javax.servlet.Filter> getFilters()
Gets the value of the filters property.- Returns:
- the filters
-
setFilterMappings
public void setFilterMappings(Map<String,String> filterMappings)
Sets the filterMappings property.- Parameters:
filterMappings
-
-
getFilterMappings
public Map<String,String> getFilterMappings()
Gets the value of the filterMappings property.- Returns:
- the filterMappings
-
getConnectors
public org.eclipse.jetty.server.Connector[] getConnectors()
Gets the connectors.- Returns:
- the connectors
-
setConnectors
public void setConnectors(org.eclipse.jetty.server.Connector[] connectors)
Sets the connectors.- Parameters:
connectors
- the connectors to set
-
getServletMappingPath
public String getServletMappingPath()
Gets the servletMappingPath.- Returns:
- the servletMappingPath the servletMappingPath to get.
-
setServletMappingPath
public void setServletMappingPath(String servletMappingPath)
Sets the servletMappingPath.- Parameters:
servletMappingPath
- the servletMappingPath to set
-
getContextPath
public String getContextPath()
Gets the contextPath.- Returns:
- the contextPath the contextPath to get.
-
setContextPath
public void setContextPath(String contextPath)
Sets the contextPath.- Parameters:
contextPath
- the contextPath to set
-
getSecurityHandler
public org.eclipse.jetty.security.SecurityHandler getSecurityHandler()
Gets the securityHandler.- Returns:
- the securityHandler the securityHandler to get.
-
setSecurityHandler
public void setSecurityHandler(org.eclipse.jetty.security.SecurityHandler securityHandler)
Sets the securityHandler.- Parameters:
securityHandler
- the securityHandler to set
-
getServletHandler
public org.eclipse.jetty.servlet.ServletHandler getServletHandler()
Gets the servletHandler.- Returns:
- the servletHandler the servletHandler to get.
-
setServletHandler
public void setServletHandler(org.eclipse.jetty.servlet.ServletHandler servletHandler)
Sets the servletHandler.- Parameters:
servletHandler
- the servletHandler to set
-
setServletName
public void setServletName(String servletName)
Sets the servletName.- Parameters:
servletName
- the servletName to set
-
isUseRootContextAsParent
public boolean isUseRootContextAsParent()
Gets the useRootContextAsParent.- Returns:
- the useRootContextAsParent the useRootContextAsParent to get.
-
setUseRootContextAsParent
public void setUseRootContextAsParent(boolean useRootContextAsParent)
Sets the useRootContextAsParent.- Parameters:
useRootContextAsParent
- the useRootContextAsParent to set
-
getMessageConverter
public HttpMessageConverter getMessageConverter()
Gets the message converter.- Returns:
-
setMessageConverter
public void setMessageConverter(HttpMessageConverter messageConverter)
Sets the message converter.- Parameters:
messageConverter
-
-
isHandleAttributeHeaders
public boolean isHandleAttributeHeaders()
Gets the handleAttributeHeaders.- Returns:
-
setHandleAttributeHeaders
public void setHandleAttributeHeaders(boolean handleAttributeHeaders)
Sets the handleAttributeHeaders.- Parameters:
handleAttributeHeaders
-
-
isHandleCookies
public boolean isHandleCookies()
Gets the handleCookies.- Returns:
-
setHandleCookies
public void setHandleCookies(boolean handleCookies)
Sets the handleCookies.- Parameters:
handleCookies
-
-
getResponseCacheSize
public int getResponseCacheSize()
Gets the response cache size.- Returns:
-
setResponseCacheSize
public void setResponseCacheSize(int responseCacheSize)
Sets the response cache size.- Parameters:
responseCacheSize
-
-
getDefaultStatusCode
public int getDefaultStatusCode()
Gets the defaultStatusCode.- Returns:
-
setDefaultStatusCode
public void setDefaultStatusCode(int defaultStatusCode)
Sets the defaultStatusCode.- Parameters:
defaultStatusCode
-
-
getBinaryMediaTypes
public List<org.springframework.http.MediaType> getBinaryMediaTypes()
Gets the binaryMediaTypes.- Returns:
-
setBinaryMediaTypes
public void setBinaryMediaTypes(List<org.springframework.http.MediaType> binaryMediaTypes)
Sets the binaryMediaTypes.- Parameters:
binaryMediaTypes
-
-
-