Package com.ngrok.jetty
Class NgrokConnector
- java.lang.Object
-
- org.eclipse.jetty.util.component.AbstractLifeCycle
-
- org.eclipse.jetty.util.component.ContainerLifeCycle
-
- org.eclipse.jetty.server.AbstractConnector
-
- com.ngrok.jetty.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.AbstractConnectorA 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
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaccept(int i)Accepts a new connection on this ngrok connector.protected voiddoStart()Starts this ngrok connector.protected voiddoStop()Stops this ngrok connector.ObjectgetTransport()Throws anUnsupportedOperationException, 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.jetty.util.component.Container
addBean, addBean, addEventListener, getBean, getBeans, getBeans, getCachedBeans, getContainedBeans, getEventListeners, isManaged, manage, removeBean, removeEventListener, unmanage
-
-
-
-
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 connectorsessionSupplier- the supplier for the session used by the connectorlistenerFunction- the function for creating the listener
-
-
Method Detail
-
doStart
protected void doStart() throws ExceptionStarts this ngrok connector.- Overrides:
doStartin classorg.eclipse.jetty.server.AbstractConnector- Throws:
Exception- if an error occurs while starting the connector
-
accept
protected void accept(int i) throws IOException, InterruptedExceptionAccepts a new connection on this ngrok connector.- Specified by:
acceptin classorg.eclipse.jetty.server.AbstractConnector- Parameters:
i- the ID of the connection- Throws:
IOException- if an I/O error occursInterruptedException- if the thread is interrupted
-
doStop
protected void doStop() throws ExceptionStops this ngrok connector.- Overrides:
doStopin classorg.eclipse.jetty.server.AbstractConnector- Throws:
Exception- if an error occurs while stopping the connector
-
getTransport
public Object getTransport()
Throws anUnsupportedOperationException, as the transport used by ngrok connector is not supported.- Throws:
UnsupportedOperationException- if the method is called
-
-