Class ServletComponent
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultComponent
-
- org.apache.camel.support.HeaderFilterStrategyComponent
-
- org.apache.camel.http.common.HttpCommonComponent
-
- org.apache.camel.component.servlet.ServletComponent
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Component
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HeaderFilterStrategyAware
,org.apache.camel.spi.RestApiConsumerFactory
,org.apache.camel.spi.RestConsumerFactory
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@Component("servlet") public class ServletComponent extends org.apache.camel.http.common.HttpCommonComponent implements org.apache.camel.spi.RestConsumerFactory, org.apache.camel.spi.RestApiConsumerFactory
-
-
Constructor Summary
Constructors Constructor Description ServletComponent()
ServletComponent(Class<? extends ServletEndpoint> endpointClass)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(org.apache.camel.http.common.HttpConsumer consumer)
org.apache.camel.Consumer
createApiConsumer(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String contextPath, org.apache.camel.spi.RestConfiguration configuration, Map<String,Object> parameters)
org.apache.camel.Consumer
createConsumer(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String verb, String basePath, String uriTemplate, String consumes, String produces, org.apache.camel.spi.RestConfiguration configuration, Map<String,Object> parameters)
protected org.apache.camel.Endpoint
createEndpoint(String uri, String remaining, Map<String,Object> parameters)
protected ServletEndpoint
createServletEndpoint(String endpointUri, ServletComponent component, URI httpUri)
Strategy to create the servlet endpoint.void
disconnect(org.apache.camel.http.common.HttpConsumer consumer)
protected void
doInit()
String
getFileNameExtWhitelist()
org.apache.camel.http.common.HttpRegistry
getHttpRegistry()
String
getServletName()
boolean
isAttachmentMultipartBinding()
protected boolean
lenientContextPath()
Whether defining the context-path is lenient and do not require an exact leading slash.void
setAttachmentMultipartBinding(boolean attachmentMultipartBinding)
Whether to automatic bind multipart/form-data as attachments on the CamelExchange
.void
setFileNameExtWhitelist(String fileNameExtWhitelist)
Whitelist of accepted filename extensions for accepting uploaded files.void
setHttpRegistry(org.apache.camel.http.common.HttpRegistry httpRegistry)
To use a custom org.apache.camel.component.servlet.HttpRegistry.void
setServletName(String servletName)
Default name of servlet to use.-
Methods inherited from class org.apache.camel.http.common.HttpCommonComponent
canConnect, getHttpBinding, getHttpConfiguration, getParameter, getParameter, isAllowJavaSerializedObject, isMuteException, setAllowJavaSerializedObject, setHttpBinding, setHttpConfiguration, setMuteException, useIntrospectionOnEndpoint
-
Methods inherited from class org.apache.camel.support.HeaderFilterStrategyComponent
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy
-
Methods inherited from class org.apache.camel.support.DefaultComponent
afterConfiguration, createEndpoint, createEndpoint, doBuild, doStart, doStop, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getDefaultName, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useRawUri, validateParameters, validateURI
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
ServletComponent
public ServletComponent()
-
ServletComponent
public ServletComponent(Class<? extends ServletEndpoint> endpointClass)
-
-
Method Detail
-
createEndpoint
protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
- Specified by:
createEndpoint
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
lenientContextPath
protected boolean lenientContextPath()
Whether defining the context-path is lenient and do not require an exact leading slash.
-
createServletEndpoint
protected ServletEndpoint createServletEndpoint(String endpointUri, ServletComponent component, URI httpUri) throws Exception
Strategy to create the servlet endpoint.- Throws:
Exception
-
connect
public void connect(org.apache.camel.http.common.HttpConsumer consumer) throws Exception
- Overrides:
connect
in classorg.apache.camel.http.common.HttpCommonComponent
- Throws:
Exception
-
disconnect
public void disconnect(org.apache.camel.http.common.HttpConsumer consumer) throws Exception
- Overrides:
disconnect
in classorg.apache.camel.http.common.HttpCommonComponent
- Throws:
Exception
-
getServletName
public String getServletName()
-
setServletName
public void setServletName(String servletName)
Default name of servlet to use. The default name is CamelServlet.
-
getHttpRegistry
public org.apache.camel.http.common.HttpRegistry getHttpRegistry()
-
setHttpRegistry
public void setHttpRegistry(org.apache.camel.http.common.HttpRegistry httpRegistry)
To use a custom org.apache.camel.component.servlet.HttpRegistry.
-
isAttachmentMultipartBinding
public boolean isAttachmentMultipartBinding()
-
setAttachmentMultipartBinding
public void setAttachmentMultipartBinding(boolean attachmentMultipartBinding)
Whether to automatic bind multipart/form-data as attachments on the CamelExchange
. The options attachmentMultipartBinding=true and disableStreamCache=false cannot work together. Remove disableStreamCache to use AttachmentMultipartBinding. This is turn off by default as this may require servlet specific configuration to enable this when using Servlet's.
-
getFileNameExtWhitelist
public String getFileNameExtWhitelist()
-
setFileNameExtWhitelist
public void setFileNameExtWhitelist(String fileNameExtWhitelist)
Whitelist of accepted filename extensions for accepting uploaded files. Multiple extensions can be separated by comma, such as txt,xml.
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String verb, String basePath, String uriTemplate, String consumes, String produces, org.apache.camel.spi.RestConfiguration configuration, Map<String,Object> parameters) throws Exception
- Specified by:
createConsumer
in interfaceorg.apache.camel.spi.RestConsumerFactory
- Throws:
Exception
-
createApiConsumer
public org.apache.camel.Consumer createApiConsumer(org.apache.camel.CamelContext camelContext, org.apache.camel.Processor processor, String contextPath, org.apache.camel.spi.RestConfiguration configuration, Map<String,Object> parameters) throws Exception
- Specified by:
createApiConsumer
in interfaceorg.apache.camel.spi.RestApiConsumerFactory
- Throws:
Exception
-
-