X-Git-Url: https://code.wpia.club/?p=gigi.git;a=blobdiff_plain;f=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fserver%2FConnector.java;fp=lib%2Fjetty%2Forg%2Feclipse%2Fjetty%2Fserver%2FConnector.java;h=ce4544c90057a087ae01535bd01b5b9ef3a099af;hp=0000000000000000000000000000000000000000;hb=73ef54a38e3930a1a789cdc6b5fa23cdd4c9d086;hpb=515007c7c1351045420669d65b59c08fa46850f2 diff --git a/lib/jetty/org/eclipse/jetty/server/Connector.java b/lib/jetty/org/eclipse/jetty/server/Connector.java new file mode 100644 index 00000000..ce4544c9 --- /dev/null +++ b/lib/jetty/org/eclipse/jetty/server/Connector.java @@ -0,0 +1,105 @@ +// +// ======================================================================== +// Copyright (c) 1995-2014 Mort Bay Consulting Pty. Ltd. +// ------------------------------------------------------------------------ +// All rights reserved. This program and the accompanying materials +// are made available under the terms of the Eclipse Public License v1.0 +// and Apache License v2.0 which accompanies this distribution. +// +// The Eclipse Public License is available at +// http://www.eclipse.org/legal/epl-v10.html +// +// The Apache License v2.0 is available at +// http://www.opensource.org/licenses/apache2.0.php +// +// You may elect to redistribute this code under either of these licenses. +// ======================================================================== +// + +package org.eclipse.jetty.server; + +import java.util.Collection; +import java.util.List; +import java.util.concurrent.Executor; + +import org.eclipse.jetty.io.ByteBufferPool; +import org.eclipse.jetty.io.EndPoint; +import org.eclipse.jetty.server.handler.ContextHandler; +import org.eclipse.jetty.util.annotation.ManagedAttribute; +import org.eclipse.jetty.util.annotation.ManagedObject; +import org.eclipse.jetty.util.component.Graceful; +import org.eclipse.jetty.util.component.LifeCycle; +import org.eclipse.jetty.util.thread.Scheduler; + +/** + *

A {@link Connector} accept connections and data from remote peers, + * and allows applications to send data to remote peers, by setting up + * the machinery needed to handle such tasks.

+ */ +@ManagedObject("Connector Interface") +public interface Connector extends LifeCycle, Graceful +{ + /** + * @return the {@link Server} instance associated with this {@link Connector} + */ + public Server getServer(); + + /** + * @return the {@link Executor} used to submit tasks + */ + public Executor getExecutor(); + + /** + * @return the {@link Scheduler} used to schedule tasks + */ + public Scheduler getScheduler(); + + /** + * @return the {@link ByteBufferPool} to acquire buffers from and release buffers to + */ + public ByteBufferPool getByteBufferPool(); + + /** + * @return the {@link ConnectionFactory} associated with the protocol name + */ + public ConnectionFactory getConnectionFactory(String nextProtocol); + + + public T getConnectionFactory(Class factoryType); + + /** + * @return the default {@link ConnectionFactory} associated with the default protocol name + */ + public ConnectionFactory getDefaultConnectionFactory(); + + public Collection getConnectionFactories(); + + public List getProtocols(); + + /** + * @return the max idle timeout for connections in milliseconds + */ + @ManagedAttribute("maximum time a connection can be idle before being closed (in ms)") + public long getIdleTimeout(); + + /** + * @return the underlying socket, channel, buffer etc. for the connector. + */ + public Object getTransport(); + + /** + * @return immutable collection of connected endpoints + */ + public Collection getConnectedEndPoints(); + + + /* ------------------------------------------------------------ */ + /** + * Get the connector name if set. + *

A {@link ContextHandler} may be configured with + * virtual hosts in the form "@connectorName" and will only serve + * requests from the named connector. + * @return The connector name or null. + */ + public String getName(); +}