Class NgrokConnector

  • All Implemented Interfaces:
    org.eclipse.jetty.server.Connector, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.Graceful, org.eclipse.jetty.util.component.LifeCycle

    public class NgrokConnector
    extends org.eclipse.jetty.server.AbstractConnector
    A class representing a connector implementation for ngrok listeners.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

        org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

        org.eclipse.jetty.util.component.Dumpable.DumpableContainer
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Graceful

        org.eclipse.jetty.util.component.Graceful.Shutdown, org.eclipse.jetty.util.component.Graceful.ThrowingRunnable
      • Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

        org.eclipse.jetty.util.component.LifeCycle.Listener
    • Field Summary

      • Fields inherited from class org.eclipse.jetty.server.AbstractConnector

        LOG
      • Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        FAILED, STARTED, STARTING, STOPPED, STOPPING
      • Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

        KEY
    • Constructor Summary

      Constructors 
      Constructor Description
      NgrokConnector​(org.eclipse.jetty.server.Server server, Supplier<Session> sessionSupplier, Function<Session,​Listener> listenerFunction)
      Constructs a new ngrok connector with the specified server, session supplier, and listener function.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void accept​(int i)
      Accepts a new connection on this ngrok connector.
      protected void doStart()
      Starts this ngrok connector.
      protected void doStop()
      Stops this ngrok connector.
      Object getTransport()
      Throws an UnsupportedOperationException, as the transport used by ngrok connector is not supported.
      • Methods inherited from class org.eclipse.jetty.server.AbstractConnector

        addConnectionFactory, addFirstConnectionFactory, addIfAbsentConnectionFactory, clearConnectionFactories, getAcceptorPriorityDelta, getAcceptors, getByteBufferPool, getConnectedEndPoints, getConnectionFactories, getConnectionFactory, getConnectionFactory, getDefaultConnectionFactory, getDefaultProtocol, getExecutor, getHttpChannelListeners, getIdleTimeout, getName, getProtocols, getScheduler, getServer, getShutdownIdleTimeout, handleAcceptFailure, interruptAcceptors, isAccepting, isShutdown, join, join, onEndPointClosed, onEndPointOpened, removeConnectionFactory, setAccepting, setAcceptorPriorityDelta, setConnectionFactories, setDefaultProtocol, setIdleTimeout, setName, setShutdownIdleTimeout, shutdown, toString
      • Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

        addBean, addBean, addEventListener, addManaged, contains, destroy, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans
      • Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

        getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop
      • Methods inherited from interface org.eclipse.jetty.util.component.Container

        addBean, addBean, addEventListener, getBean, getBeans, getBeans, getCachedBeans, getContainedBeans, getEventListeners, isManaged, manage, removeBean, removeEventListener, unmanage
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

        dump, dump, dumpSelf
      • Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

        isDumpable
      • Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle

        addEventListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeEventListener, start, stop
    • Constructor Detail

      • NgrokConnector

        public NgrokConnector​(org.eclipse.jetty.server.Server server,
                              Supplier<Session> sessionSupplier,
                              Function<Session,​Listener> listenerFunction)
        Constructs a new ngrok connector with the specified server, session supplier, and listener function.
        Parameters:
        server - the server to use for the connector
        sessionSupplier - the supplier for the session used by the connector
        listenerFunction - the function for creating the listener
    • Method Detail

      • doStart

        protected void doStart()
                        throws Exception
        Starts this ngrok connector.
        Overrides:
        doStart in class org.eclipse.jetty.server.AbstractConnector
        Throws:
        Exception - if an error occurs while starting the connector
      • accept

        protected void accept​(int i)
                       throws IOException,
                              InterruptedException
        Accepts a new connection on this ngrok connector.
        Specified by:
        accept in class org.eclipse.jetty.server.AbstractConnector
        Parameters:
        i - the ID of the connection
        Throws:
        IOException - if an I/O error occurs
        InterruptedException - if the thread is interrupted
      • doStop

        protected void doStop()
                       throws Exception
        Stops this ngrok connector.
        Overrides:
        doStop in class org.eclipse.jetty.server.AbstractConnector
        Throws:
        Exception - if an error occurs while stopping the connector