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, muteExceptionFields 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 TypeMethodDescriptionvoidconnect(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.Endpointprotected ServletEndpointcreateServletEndpoint(String endpointUri, ServletComponent component, URI httpUri) Strategy to create the servlet endpoint.voiddisconnect(org.apache.camel.http.common.HttpConsumer consumer) protected voiddoInit()org.apache.camel.http.common.HttpRegistrybooleanprotected booleanWhether 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, useIntrospectionOnEndpointMethods inherited from class org.apache.camel.support.HeaderFilterStrategyComponent
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategyMethods 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, validateURIMethods inherited from class org.apache.camel.support.service.BaseService
build, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods 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:
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
- Overrides:
connectin classorg.apache.camel.http.common.HttpCommonComponent- Throws:
Exception
-
disconnect
- Overrides:
disconnectin 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:
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
-
doInit
- Overrides:
doInitin classorg.apache.camel.support.DefaultComponent- Throws:
Exception
-