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.HasCamelContext
,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
-
Field Summary
Fields inherited from class org.apache.camel.http.common.HttpCommonComponent
allowJavaSerializedObject, httpBinding, httpConfiguration, muteException
Fields inherited from class org.apache.camel.support.service.BaseService
BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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()
org.apache.camel.http.common.HttpRegistry
boolean
protected boolean
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, 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, doStart, doStop, 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
Methods inherited from interface org.apache.camel.Service
build, close, init, start, stop
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
Methods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending
Methods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
ServletComponent
public ServletComponent() -
ServletComponent
-
-
Method Details
-
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
- Overrides:
connect
in classorg.apache.camel.http.common.HttpCommonComponent
- Throws:
Exception
-
disconnect
- Overrides:
disconnect
in classorg.apache.camel.http.common.HttpCommonComponent
- Throws:
Exception
-
getServletName
-
setServletName
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
-
setFileNameExtWhitelist
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
-
doInit
- Overrides:
doInit
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-