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.spi.HasCamelContext, 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
  • Field Summary

    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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addExtension(org.cometd.bayeux.server.BayeuxServer.Extension extension)
     
    void
    addServerListener(org.cometd.bayeux.server.BayeuxServer.BayeuxServerListener serverListener)
     
    void
    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
     
    protected org.cometd.server.CometDServlet
    createServletForConnector(org.eclipse.jetty.server.Server server, CometdEndpoint endpoint)
     
    void
    Disconnects the URL specified on the endpoint from the specified processor.
    protected void
     
    List<org.cometd.bayeux.server.BayeuxServer.Extension>
     
    org.cometd.bayeux.server.SecurityPolicy
     
    org.apache.camel.support.jsse.SSLContextParameters
     
     
     
     
    protected org.eclipse.jetty.server.ServerConnector
    getSslSocketConnector(org.eclipse.jetty.server.Server server)
     
    boolean
     
    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 authorization
    void
    setSslContextParameters(org.apache.camel.support.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
    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, getDefaultName, 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, doStart, 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

    setCamelContext

    Methods inherited from interface org.apache.camel.spi.HasCamelContext

    getCamelContext

    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.SSLContextParametersAware

    retrieveGlobalSslContextParameters

    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

    • CometdComponent

      public CometdComponent()
  • Method Details

    • createEndpoint

      protected org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters) throws Exception
      Specified by:
      createEndpoint in class org.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, 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 interface org.apache.camel.SSLContextParametersAware
    • setUseGlobalSslContextParameters

      public void setUseGlobalSslContextParameters(boolean useGlobalSslContextParameters)
      Enable usage of global SSL context parameters.
      Specified by:
      setUseGlobalSslContextParameters in interface org.apache.camel.SSLContextParametersAware
    • createServer

      protected org.eclipse.jetty.server.Server createServer()
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception