Class CometdComponent
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.support.DefaultComponent
-
- org.apache.camel.component.cometd.CometdComponent
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Component
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.SSLContextParametersAware
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@Component("cometd,cometds") public class CometdComponent extends org.apache.camel.support.DefaultComponent implements org.apache.camel.SSLContextParametersAware
Component for Jetty Cometd
-
-
Constructor Summary
Constructors Constructor Description CometdComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addExtension(org.cometd.bayeux.server.BayeuxServer.Extension extension)
void
addServerListener(org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener serverListener)
void
connect(CometdProducerConsumer prodcon)
Connects the URL specified on the endpoint to the specified processor.protected org.apache.camel.Endpoint
createEndpoint(String uri, String remaining, Map<String,Object> parameters)
protected org.eclipse.jetty.server.Server
createServer()
protected org.cometd.server.CometDServlet
createServletForConnector(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.Connector connector, CometdEndpoint endpoint)
void
disconnect(CometdProducerConsumer prodcon)
Disconnects the URL specified on the endpoint from the specified processor.protected void
doStart()
protected void
doStop()
List<org.cometd.bayeux.server.BayeuxServer.Extension>
getExtensions()
org.cometd.bayeux.server.SecurityPolicy
getSecurityPolicy()
org.apache.camel.support.jsse.SSLContextParameters
getSslContextParameters()
String
getSslKeyPassword()
String
getSslKeystore()
String
getSslPassword()
protected org.eclipse.jetty.server.ServerConnector
getSslSocketConnector(org.eclipse.jetty.server.Server server)
boolean
isUseGlobalSslContextParameters()
void
setExtensions(List<org.cometd.bayeux.server.BayeuxServer.Extension> extensions)
To use a list of custom BayeuxServer.Extension that allows modifying incoming and outgoing requests.void
setSecurityPolicy(org.cometd.bayeux.server.SecurityPolicy securityPolicy)
To use a custom configured SecurityPolicy to control authorizationvoid
setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
To configure security using SSLContextParametersvoid
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
setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
Enable usage of global SSL context parameters.-
Methods inherited from class org.apache.camel.support.DefaultComponent
afterConfiguration, createEndpoint, createEndpoint, doBuild, doInit, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, getComponentPropertyConfigurer, getEndpointPropertyConfigurer, getExtension, getSupportedExtensions, ifStartsWithReturnRemainder, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, registerExtension, registerExtension, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, resolveRawParameterValues, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setLazyStartProducer, setProperties, setProperties, setProperties, useIntrospectionOnEndpoint, 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
-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
Methods inherited from interface org.apache.camel.SSLContextParametersAware
retrieveGlobalSslContextParameters
-
-
-
-
Method Detail
-
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
-
connect
public void connect(CometdProducerConsumer prodcon) throws Exception
Connects the URL specified on the endpoint to the specified processor.- Throws:
Exception
-
disconnect
public void disconnect(CometdProducerConsumer prodcon) throws Exception
Disconnects the URL specified on the endpoint from the specified processor.- Throws:
Exception
-
createServletForConnector
protected org.cometd.server.CometDServlet createServletForConnector(org.eclipse.jetty.server.Server server, org.eclipse.jetty.server.Connector connector, CometdEndpoint endpoint) throws Exception
- Throws:
Exception
-
getSslSocketConnector
protected org.eclipse.jetty.server.ServerConnector getSslSocketConnector(org.eclipse.jetty.server.Server server) throws Exception
- Throws:
Exception
-
getSslKeyPassword
public String getSslKeyPassword()
-
getSslPassword
public String getSslPassword()
-
getSslKeystore
public String getSslKeystore()
-
setSslKeyPassword
public void setSslKeyPassword(String sslKeyPassword)
The password for the keystore when using SSL.
-
setSslPassword
public void setSslPassword(String sslPassword)
The password when using SSL.
-
setSslKeystore
public void setSslKeystore(String sslKeystore)
The path to the keystore.
-
setSecurityPolicy
public void setSecurityPolicy(org.cometd.bayeux.server.SecurityPolicy securityPolicy)
To use a custom configured SecurityPolicy to control authorization
-
getSecurityPolicy
public org.cometd.bayeux.server.SecurityPolicy getSecurityPolicy()
-
getExtensions
public List<org.cometd.bayeux.server.BayeuxServer.Extension> getExtensions()
-
setExtensions
public void setExtensions(List<org.cometd.bayeux.server.BayeuxServer.Extension> extensions)
To use a list of custom BayeuxServer.Extension that allows modifying incoming and outgoing requests.
-
addExtension
public void addExtension(org.cometd.bayeux.server.BayeuxServer.Extension extension)
-
addServerListener
public void addServerListener(org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener serverListener)
-
getSslContextParameters
public org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters()
-
setSslContextParameters
public void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)
To configure security using SSLContextParameters
-
isUseGlobalSslContextParameters
public boolean isUseGlobalSslContextParameters()
- Specified by:
isUseGlobalSslContextParameters
in interfaceorg.apache.camel.SSLContextParametersAware
-
setUseGlobalSslContextParameters
public void setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
Enable usage of global SSL context parameters.- Specified by:
setUseGlobalSslContextParameters
in interfaceorg.apache.camel.SSLContextParametersAware
-
createServer
protected org.eclipse.jetty.server.Server createServer() throws Exception
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.DefaultComponent
- Throws:
Exception
-
-