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 voidconnect(org.apache.camel.http.common.HttpConsumer consumer)org.apache.camel.ConsumercreateApiConsumer(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.ConsumercreateConsumer(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.EndpointcreateEndpoint(String uri, String remaining, Map<String,Object> parameters)protected ServletEndpointcreateServletEndpoint(String endpointUri, ServletComponent component, URI httpUri)Strategy to create the servlet endpoint.voiddisconnect(org.apache.camel.http.common.HttpConsumer consumer)protected voiddoInit()StringgetFileNameExtWhitelist()org.apache.camel.http.common.HttpRegistrygetHttpRegistry()StringgetServletName()booleanisAttachmentMultipartBinding()protected booleanlenientContextPath()Whether defining the context-path is lenient and do not require an exact leading slash.voidsetAttachmentMultipartBinding(boolean attachmentMultipartBinding)Whether to automatic bind multipart/form-data as attachments on the CamelExchange.voidsetFileNameExtWhitelist(String fileNameExtWhitelist)Whitelist of accepted filename extensions for accepting uploaded files.voidsetHttpRegistry(org.apache.camel.http.common.HttpRegistry httpRegistry)To use a custom org.apache.camel.component.servlet.HttpRegistry.voidsetServletName(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:
createEndpointin 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:
connectin classorg.apache.camel.http.common.HttpCommonComponent- Throws:
Exception
-
disconnect
public void disconnect(org.apache.camel.http.common.HttpConsumer consumer) throws Exception- Overrides:
disconnectin 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:
createConsumerin 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:
createApiConsumerin interfaceorg.apache.camel.spi.RestApiConsumerFactory- Throws:
Exception
-
-