public class RestletComponent extends HeaderFilterStrategyComponent implements RestConsumerFactory, RestApiConsumerFactory
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
RestletComponent() |
RestletComponent(org.restlet.Component component) |
Modifier and Type | Method and Description |
---|---|
protected void |
addServerIfNecessary(RestletEndpoint endpoint) |
void |
connect(RestletConsumer consumer) |
Consumer |
createApiConsumer(CamelContext camelContext,
Processor processor,
String contextPath,
RestConfiguration configuration,
Map<String,Object> parameters)
Creates a new REST API Event
Driven Consumer, which provides API listing of the REST services
|
Consumer |
createConsumer(CamelContext camelContext,
Processor processor,
String verb,
String basePath,
String uriTemplate,
String consumes,
String produces,
RestConfiguration configuration,
Map<String,Object> parameters)
Creates a new REST Event
Driven Consumer, which consumes messages from the endpoint using the given processor
|
protected Endpoint |
createEndpoint(String uri,
String remaining,
Map<String,Object> parameters)
A factory method allowing derived components to create a new endpoint
from the given URI, remaining path and optional parameters
|
protected org.restlet.Server |
createServer(RestletEndpoint endpoint) |
void |
disconnect(RestletConsumer consumer) |
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
Boolean |
getControllerDaemon() |
Integer |
getControllerSleepTimeMs() |
Integer |
getInboundBufferSize() |
Integer |
getLowThreads() |
Integer |
getMaxConnectionsPerHost() |
Integer |
getMaxQueued() |
Integer |
getMaxThreads() |
Integer |
getMaxTotalConnections() |
Integer |
getMinThreads() |
Integer |
getOutboundBufferSize() |
Boolean |
getPersistingConnections() |
Boolean |
getPipeliningConnections() |
int |
getPort() |
Boolean |
getReuseAddress() |
Boolean |
getSynchronous() |
Integer |
getThreadMaxIdleTimeMs() |
Boolean |
getUseForwardedForHeader() |
boolean |
isDisableStreamCache() |
protected String |
preProcessUri(String uri)
Deprecated.
|
void |
setControllerDaemon(Boolean controllerDaemon)
Indicates if the controller thread should be a daemon (not blocking JVM exit).
|
void |
setControllerSleepTimeMs(Integer controllerSleepTimeMs)
Time for the controller thread to sleep between each control.
|
void |
setDisableStreamCache(boolean disableStreamCache)
Determines whether or not the raw input stream from Restlet is cached or not
(Camel will read the stream into a in memory/overflow to file, Stream caching) cache.
|
void |
setInboundBufferSize(Integer inboundBufferSize)
The size of the buffer when reading messages.
|
void |
setLowThreads(Integer lowThreads)
Number of worker threads determining when the connector is considered overloaded.
|
void |
setMaxConnectionsPerHost(Integer maxConnectionsPerHost)
Maximum number of concurrent connections per host (IP address).
|
void |
setMaxQueued(Integer maxQueued)
Maximum number of calls that can be queued if there aren't any worker thread available to service them.
|
void |
setMaxThreads(Integer maxThreads)
Maximum threads that will service requests.
|
void |
setMaxTotalConnections(Integer maxTotalConnections)
Maximum number of concurrent connections in total.
|
void |
setMinThreads(Integer minThreads)
Minimum threads waiting to service requests.
|
void |
setOutboundBufferSize(Integer outboundBufferSize)
The size of the buffer when writing messages.
|
void |
setPersistingConnections(Boolean persistingConnections)
Indicates if connections should be kept alive after a call.
|
void |
setPipeliningConnections(Boolean pipeliningConnections)
Indicates if pipelining connections are supported.
|
void |
setPort(int port)
To configure the port number for the restlet consumer routes.
|
void |
setReuseAddress(Boolean reuseAddress)
Enable/disable the SO_REUSEADDR socket option.
|
void |
setSynchronous(Boolean synchronous)
Whether to use synchronous Restlet Client for the producer.
|
void |
setThreadMaxIdleTimeMs(Integer threadMaxIdleTimeMs)
Time for an idle thread to wait for an operation before being collected.
|
protected void |
setupServerWithSSLContext(org.restlet.util.Series<org.restlet.data.Parameter> params,
SSLContextParameters scp) |
void |
setUseForwardedForHeader(Boolean useForwardedForHeader)
Lookup the "X-Forwarded-For" header supported by popular proxies and caches and uses it to populate the Request.getClientAddresses()
method result.
|
protected String |
stringArrayToString(String[] strings) |
protected boolean |
useIntrospectionOnEndpoint()
Derived classes may wish to overload this to prevent the default introspection of URI parameters
on the created Endpoint instance
|
getHeaderFilterStrategy, setEndpointHeaderFilterStrategy, setHeaderFilterStrategy
createComponentConfiguration, createParameterConfigurationMap, getEndpointClass, getParameterConfigurationMap, populateParameterConfigurationMap, setEndpointClass
afterConfiguration, createConfiguration, createEndpoint, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, ifStartsWithReturnRemainder, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setCamelContext, setProperties, setProperties, useRawUri, validateParameters, validateURI
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public RestletComponent()
public RestletComponent(org.restlet.Component component)
protected Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
DefaultComponent
createEndpoint
in class DefaultComponent
uri
- the full URI of the endpointremaining
- the remaining part of the URI without the query
parameters or component prefixparameters
- the optional parameters passed inException
- is thrown if error creating the endpointprotected void doStart() throws Exception
ServiceSupport
Important: See ServiceSupport.doStop()
for more details.
doStart
in class DefaultComponent
Exception
ServiceSupport.doStop()
protected void doStop() throws Exception
ServiceSupport
Important: Camel will invoke this ServiceSupport.doStop()
method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext
is shutting down.
doStop
in class DefaultComponent
Exception
ServiceSupport.doStart()
protected boolean useIntrospectionOnEndpoint()
DefaultComponent
useIntrospectionOnEndpoint
in class DefaultComponent
public void connect(RestletConsumer consumer) throws Exception
Exception
public void disconnect(RestletConsumer consumer) throws Exception
Exception
protected org.restlet.Server createServer(RestletEndpoint endpoint)
protected void setupServerWithSSLContext(org.restlet.util.Series<org.restlet.data.Parameter> params, SSLContextParameters scp) throws GeneralSecurityException, IOException
GeneralSecurityException
IOException
protected void addServerIfNecessary(RestletEndpoint endpoint) throws Exception
Exception
@Deprecated protected String preProcessUri(String uri)
preProcessUri
in class DefaultComponent
public Boolean getControllerDaemon()
public void setControllerDaemon(Boolean controllerDaemon)
public Integer getControllerSleepTimeMs()
public void setControllerSleepTimeMs(Integer controllerSleepTimeMs)
public Integer getInboundBufferSize()
public void setInboundBufferSize(Integer inboundBufferSize)
public Integer getMaxConnectionsPerHost()
public void setMaxConnectionsPerHost(Integer maxConnectionsPerHost)
public Integer getMaxThreads()
public void setMaxThreads(Integer maxThreads)
public Integer getLowThreads()
public void setLowThreads(Integer lowThreads)
public Integer getMaxTotalConnections()
public void setMaxTotalConnections(Integer maxTotalConnections)
public Integer getMinThreads()
public void setMinThreads(Integer minThreads)
public Integer getOutboundBufferSize()
public void setOutboundBufferSize(Integer outboundBufferSize)
public Boolean getPersistingConnections()
public void setPersistingConnections(Boolean persistingConnections)
public Boolean getPipeliningConnections()
public void setPipeliningConnections(Boolean pipeliningConnections)
public Integer getThreadMaxIdleTimeMs()
public void setThreadMaxIdleTimeMs(Integer threadMaxIdleTimeMs)
public Boolean getUseForwardedForHeader()
public void setUseForwardedForHeader(Boolean useForwardedForHeader)
public Boolean getReuseAddress()
public void setReuseAddress(Boolean reuseAddress)
public Integer getMaxQueued()
public void setMaxQueued(Integer maxQueued)
public boolean isDisableStreamCache()
public void setDisableStreamCache(boolean disableStreamCache)
public int getPort()
public void setPort(int port)
public Boolean getSynchronous()
public void setSynchronous(Boolean synchronous)
public Consumer createConsumer(CamelContext camelContext, Processor processor, String verb, String basePath, String uriTemplate, String consumes, String produces, RestConfiguration configuration, Map<String,Object> parameters) throws Exception
RestConsumerFactory
createConsumer
in interface RestConsumerFactory
camelContext
- the camel contextprocessor
- the processorverb
- HTTP verb such as GET, POSTbasePath
- base pathuriTemplate
- uri templateconsumes
- media-types for what this REST service consume as input (accept-type), is null or */* for anythingproduces
- media-types for what this REST service produces as output, can be nullparameters
- additional parametersException
- can be thrownpublic Consumer createApiConsumer(CamelContext camelContext, Processor processor, String contextPath, RestConfiguration configuration, Map<String,Object> parameters) throws Exception
RestApiConsumerFactory
createApiConsumer
in interface RestApiConsumerFactory
camelContext
- the camel contextprocessor
- the processorcontextPath
- the context-pathparameters
- additional parametersException
- can be thrownCopyright © 2007–2016 The Apache Software Foundation. All rights reserved.