public class WebsocketComponent
extends org.apache.camel.impl.UriEndpointComponent
implements org.apache.camel.SSLContextParametersAware
Modifier and Type | Field and Description |
---|---|
protected static HashMap<String,org.apache.camel.component.websocket.WebsocketComponent.ConnectorRef> |
CONNECTORS |
protected boolean |
enableJmx |
protected String |
host |
protected static org.slf4j.Logger |
LOG |
protected Integer |
maxThreads |
protected org.eclipse.jetty.jmx.MBeanContainer |
mbContainer |
protected Integer |
minThreads |
protected Integer |
port |
protected Map<String,WebSocketFactory> |
socketFactory |
protected org.apache.camel.util.jsse.SSLContextParameters |
sslContextParameters |
protected String |
sslKeyPassword |
protected String |
sslKeystore |
protected String |
sslPassword |
protected String |
staticResources |
protected org.eclipse.jetty.server.Server |
staticResourcesServer |
protected org.eclipse.jetty.util.thread.ThreadPool |
threadPool |
protected boolean |
useGlobalSslContextParameters |
Constructor and Description |
---|
WebsocketComponent() |
Modifier and Type | Method and Description |
---|---|
protected WebsocketComponentServlet |
addServlet(NodeSynchronization sync,
WebsocketProducerConsumer prodcon,
String resourceUri) |
void |
connect(WebsocketProducerConsumer prodcon)
Connects the URL specified on the endpoint to the specified processor.
|
protected org.eclipse.jetty.servlet.ServletContextHandler |
createContext(org.eclipse.jetty.server.Server server,
org.eclipse.jetty.server.Connector connector,
List<org.eclipse.jetty.server.Handler> handlers) |
protected org.apache.camel.Endpoint |
createEndpoint(String uri,
String remaining,
Map<String,Object> parameters) |
static String |
createPathSpec(String remaining) |
protected org.eclipse.jetty.server.Server |
createServer() |
protected WebsocketComponentServlet |
createServlet(NodeSynchronization sync,
String pathSpec,
Map<String,WebsocketComponentServlet> servlets,
org.eclipse.jetty.servlet.ServletContextHandler handler) |
protected org.eclipse.jetty.server.Server |
createStaticResourcesServer(org.eclipse.jetty.server.Server server,
org.eclipse.jetty.servlet.ServletContextHandler context,
String home) |
protected org.eclipse.jetty.server.Server |
createStaticResourcesServer(org.eclipse.jetty.servlet.ServletContextHandler context,
String host,
int port,
String home) |
void |
disconnect(WebsocketProducerConsumer prodcon)
Disconnects the URL specified on the endpoint from the specified
processor.
|
protected void |
doStart() |
void |
doStop() |
static HashMap<String,org.apache.camel.component.websocket.WebsocketComponent.ConnectorRef> |
getConnectors() |
String |
getHost() |
Integer |
getMaxThreads() |
org.eclipse.jetty.jmx.MBeanContainer |
getMbContainer() |
Integer |
getMinThreads() |
Integer |
getPort() |
Map<String,WebSocketFactory> |
getSocketFactory() |
org.apache.camel.util.jsse.SSLContextParameters |
getSslContextParameters() |
String |
getSslKeyPassword() |
String |
getSslKeystore() |
String |
getSslPassword() |
String |
getStaticResources() |
org.eclipse.jetty.util.thread.ThreadPool |
getThreadPool() |
boolean |
isEnableJmx() |
boolean |
isUseGlobalSslContextParameters() |
void |
setEnableJmx(boolean enableJmx)
If this option is true, Jetty JMX support will be enabled for this endpoint.
|
void |
setHost(String host)
The hostname.
|
void |
setMaxThreads(Integer maxThreads)
To set a value for maximum number of threads in server thread pool.
|
void |
setMinThreads(Integer minThreads)
To set a value for minimum number of threads in server thread pool.
|
void |
setPort(Integer port)
The port number.
|
void |
setSocketFactory(Map<String,WebSocketFactory> socketFactory)
To configure a map which contains custom WebSocketFactory for sub protocols.
|
void |
setSslContextParameters(org.apache.camel.util.jsse.SSLContextParameters sslContextParameters)
To configure security using SSLContextParameters
|
void |
setSslKeyPassword(String sslKeyPassword)
The password for the keystore when using SSL.
|
void |
setSslKeystore(String sslKeystore)
The path to the keystore.
|
void |
setSslPassword(String sslPassword)
The password when using SSL.
|
void |
setStaticResources(String staticResources)
Set a resource path for static resources (such as .html files etc).
|
void |
setThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)
To use a custom thread pool for the server.
|
void |
setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
Enable usage of global SSL context parameters.
|
protected void |
setWebSocketComponentServletInitialParameter(org.eclipse.jetty.servlet.ServletContextHandler context,
WebsocketEndpoint endpoint) |
createComponentConfiguration, createParameterConfigurationMap, getEndpointClass, getParameterConfigurationMap, populateParameterConfigurationMap, setEndpointClass
afterConfiguration, createConfiguration, createEndpoint, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, ifStartsWithReturnRemainder, isResolvePropertyPlaceholders, preProcessUri, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setCamelContext, setProperties, setProperties, setResolvePropertyPlaceholders, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
protected static final org.slf4j.Logger LOG
protected static final HashMap<String,org.apache.camel.component.websocket.WebsocketComponent.ConnectorRef> CONNECTORS
protected Map<String,WebSocketFactory> socketFactory
protected org.eclipse.jetty.server.Server staticResourcesServer
protected org.eclipse.jetty.jmx.MBeanContainer mbContainer
@Metadata(label="security") protected org.apache.camel.util.jsse.SSLContextParameters sslContextParameters
@Metadata(label="security", defaultValue="false") protected boolean useGlobalSslContextParameters
@Metadata(label="advanced") protected org.eclipse.jetty.util.thread.ThreadPool threadPool
@Metadata(defaultValue="9292") protected Integer port
@Metadata(label="advanced") protected Integer minThreads
@Metadata(label="advanced") protected Integer maxThreads
@Metadata(label="advanced") protected boolean enableJmx
@Metadata(defaultValue="0.0.0.0") protected String host
@Metadata(label="consumer") protected String staticResources
@Metadata(label="security", secret=true) protected String sslKeyPassword
@Metadata(label="security", secret=true) protected String sslPassword
@Metadata(label="security", secret=true) protected String sslKeystore
public void connect(WebsocketProducerConsumer prodcon) throws Exception
Exception
public void disconnect(WebsocketProducerConsumer prodcon) throws Exception
Exception
public org.eclipse.jetty.jmx.MBeanContainer getMbContainer()
protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
createEndpoint
in class org.apache.camel.impl.DefaultComponent
Exception
protected void setWebSocketComponentServletInitialParameter(org.eclipse.jetty.servlet.ServletContextHandler context, WebsocketEndpoint endpoint)
protected org.eclipse.jetty.server.Server createServer() throws Exception
Exception
protected org.eclipse.jetty.server.Server createStaticResourcesServer(org.eclipse.jetty.server.Server server, org.eclipse.jetty.servlet.ServletContextHandler context, String home) throws Exception
Exception
protected org.eclipse.jetty.server.Server createStaticResourcesServer(org.eclipse.jetty.servlet.ServletContextHandler context, String host, int port, String home) throws Exception
Exception
protected WebsocketComponentServlet addServlet(NodeSynchronization sync, WebsocketProducerConsumer prodcon, String resourceUri) throws Exception
Exception
protected WebsocketComponentServlet createServlet(NodeSynchronization sync, String pathSpec, Map<String,WebsocketComponentServlet> servlets, org.eclipse.jetty.servlet.ServletContextHandler handler)
protected org.eclipse.jetty.servlet.ServletContextHandler createContext(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.Connector connector, List<org.eclipse.jetty.server.Handler> handlers) throws Exception
Exception
public String getStaticResources()
public void setStaticResources(String staticResources)
public String getHost()
public void setHost(String host)
public Integer getPort()
public void setPort(Integer port)
public String getSslKeyPassword()
public String getSslPassword()
public String getSslKeystore()
public void setSslKeyPassword(String sslKeyPassword)
public void setSslPassword(String sslPassword)
public void setSslKeystore(String sslKeystore)
public void setEnableJmx(boolean enableJmx)
public boolean isEnableJmx()
public Integer getMinThreads()
public void setMinThreads(Integer minThreads)
public Integer getMaxThreads()
public void setMaxThreads(Integer maxThreads)
public org.eclipse.jetty.util.thread.ThreadPool getThreadPool()
public void setThreadPool(org.eclipse.jetty.util.thread.ThreadPool threadPool)
public org.apache.camel.util.jsse.SSLContextParameters getSslContextParameters()
public void setSslContextParameters(org.apache.camel.util.jsse.SSLContextParameters sslContextParameters)
public boolean isUseGlobalSslContextParameters()
isUseGlobalSslContextParameters
in interface org.apache.camel.SSLContextParametersAware
public void setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
setUseGlobalSslContextParameters
in interface org.apache.camel.SSLContextParametersAware
public Map<String,WebSocketFactory> getSocketFactory()
public void setSocketFactory(Map<String,WebSocketFactory> socketFactory)
public static HashMap<String,org.apache.camel.component.websocket.WebsocketComponent.ConnectorRef> getConnectors()
protected void doStart() throws Exception
doStart
in class org.apache.camel.impl.DefaultComponent
Exception
Apache Camel