Examples of AbstractConnector

  • org.mortbay.jetty.AbstractConnector
    Abstract Connector implementation. This abstract implemenation of the Connector interface provides: @author gregwTODO - allow multiple Acceptor threads
  • org.mule.transport.AbstractConnector
    AbstractConnector provides base functionality for all connectors provided with Mule. Connectors are the mechanism used to connect to external systems and protocols in order to send and receive data.

    The AbstractConnector provides getter and setter methods for endpoint name, transport name and protocol. It also provides methods to stop and start connectors and sets up a dispatcher threadpool which allows deriving connectors the possibility to dispatch work to separate threads. This functionality is controlled with the doThreading property on the threadingProfiles for dispatchers and receivers. The lifecycle for a connector is -

    1. Create
    2. Initialise
    3. Connect
    4. Connect receivers
    5. Start
    6. Start Receivers
    7. Stop
    8. Stop Receivers
    9. Disconnect
    10. Disconnect Receivers
    11. Dispose
    12. Dispose Receivers

  • Examples of com.google.gwt.thirdparty.org.mortbay.jetty.AbstractConnector

        // Turn off XML validation.
        System.setProperty("org.mortbay.xml.XmlParser.Validating", "false");

        Server server = new Server();

        AbstractConnector connector = getConnector(logger);
        setupConnector(connector, bindAddress, port);
        server.addConnector(connector);

        // Create a new web app in the war directory.
        WebAppContext wac = createWebAppContext(logger, appRootDir);

        RequestLogHandler logHandler = new RequestLogHandler();
        logHandler.setRequestLog(new JettyRequestLogger(logger, getBaseLogLevel()));
        logHandler.setHandler(wac);
        server.setHandler(logHandler);
        server.start();
        server.setStopAtShutdown(true);

        // Now that we're started, log to the top level logger.
        Log.setLog(new JettyTreeLogger(logger));

        // DevMode#doStartUpServer() fails from time to time (rarely) due
        // to an unknown error. Adding some logging to pinpoint the problem.
        int connectorPort = connector.getLocalPort();
        if (connector.getLocalPort() < 0) {
          branch.log(TreeLogger.ERROR, String.format(
              "Failed to connect to open channel with port %d (return value %d)",
              port, connectorPort));
          if (connector.getConnection() == null) {
            branch.log(TreeLogger.TRACE, "Connection is null");
          }
        }

        return createServletContainer(logger, appRootDir, server, wac,
    View Full Code Here

    Examples of diva.canvas.connector.AbstractConnector

    public class BasicEdgeRenderer implements EdgeRenderer {
        /**
         * Render a visual representation of the given edge.
         */
        public Connector render(Object edge, Site tailSite, Site headSite) {
            AbstractConnector c;
            Figure tf = tailSite.getFigure();
            Figure hf = headSite.getFigure();

            //if the edge is a self loop, create an ArcConnector instead!
            if ((tf != null) && (hf != null) && (tf == hf)) {
                c = new ArcConnector(tailSite, headSite);
            } else {
                c = new StraightConnector(tailSite, headSite);
            }

            Arrowhead arrow = new Arrowhead(headSite.getX(), headSite.getY(),
                    headSite.getNormal());
            c.setHeadEnd(arrow);
            return c;
        }
    View Full Code Here

    Examples of org.eclipse.jetty.server.AbstractConnector

            registedPaths.add(url.getPath());
            ++servantCount;
        }
       
        protected void setupThreadPool() {
            AbstractConnector aconn = (AbstractConnector) connector;
            if (isSetThreadingParameters()) {
                ThreadPool pool = aconn.getThreadPool();
                if (pool == null) {
                    pool = aconn.getServer().getThreadPool();
                }
                if (pool == null) {
                    pool = new QueuedThreadPool();
                    aconn.getServer().setThreadPool(pool);
                    aconn.setThreadPool(pool);
                }
                //threads for the acceptors and selectors are taken from
                //the pool so we need to have room for those
                int acc = aconn.getAcceptors() * 2;
                if (getThreadingParameters().isSetMaxThreads()
                    && getThreadingParameters().getMaxThreads() <= acc) {
                    throw new Fault(new Message("NOT_ENOUGH_THREADS", LOG,
                                                port,
                                                acc + 1,
    View Full Code Here

    Examples of org.eclipse.jetty.server.AbstractConnector

            ConnectorFactory factory = new ConnectorFactory()
            {
                @Override
                public Connector createConnector()
                {
                    return new AbstractConnector()
                    {
                        @Override
                        public void open() throws IOException
                        {
                            openLatch.countDown();
    View Full Code Here

    Examples of org.eclipse.jetty.server.AbstractConnector

               
            ++servantCount;
        }
       
        protected void setupThreadPool() {
            AbstractConnector aconn = (AbstractConnector) connector;
            if (isSetThreadingParameters()) {
                ThreadPool pool = aconn.getThreadPool();
                if (pool == null) {
                    pool = aconn.getServer().getThreadPool();
                }
                if (pool == null) {
                    pool = new QueuedThreadPool();
                    aconn.getServer().setThreadPool(pool);
                    aconn.setThreadPool(pool);
                }
                //threads for the acceptors and selectors are taken from
                //the pool so we need to have room for those
                int acc = aconn.getAcceptors() * 2;
                if (getThreadingParameters().isSetMaxThreads()
                    && getThreadingParameters().getMaxThreads() <= acc) {
                    throw new Fault(new Message("NOT_ENOUGH_THREADS", LOG,
                                                port,
                                                acc + 1,
    View Full Code Here

    Examples of org.eclipse.jetty.server.AbstractConnector

               
            ++servantCount;
        }
       
        protected void setupThreadPool() {
            AbstractConnector aconn = (AbstractConnector) connector;
            if (isSetThreadingParameters()) {
                ThreadPool pool = aconn.getThreadPool();
                if (pool == null) {
                    pool = new QueuedThreadPool();
                    aconn.setThreadPool(pool);
                }
                if (pool instanceof QueuedThreadPool) {
                    QueuedThreadPool pl = (QueuedThreadPool)pool;
                    if (getThreadingParameters().isSetMinThreads()) {
                        pl.setMinThreads(getThreadingParameters().getMinThreads());
    View Full Code Here

    Examples of org.eclipse.jetty.server.AbstractConnector

               
            ++servantCount;
        }
       
        protected void setupThreadPool() {
            AbstractConnector aconn = (AbstractConnector) connector;
            if (isSetThreadingParameters()) {
                ThreadPool pool = aconn.getThreadPool();
                if (pool == null) {
                    pool = aconn.getServer().getThreadPool();
                }
                if (pool == null) {
                    pool = new QueuedThreadPool();
                    aconn.getServer().setThreadPool(pool);
                    aconn.setThreadPool(pool);
                }
                //threads for the acceptors and selectors are taken from
                //the pool so we need to have room for those
                int acc = aconn.getAcceptors() * 2;
                if (getThreadingParameters().isSetMaxThreads()
                    && getThreadingParameters().getMaxThreads() <= acc) {
                    throw new Fault(new Message("NOT_ENOUGH_THREADS", LOG,
                                                port,
                                                acc + 1,
    View Full Code Here

    Examples of org.eclipse.jetty.server.AbstractConnector

               
            ++servantCount;
        }
       
        protected void setupThreadPool() {
            AbstractConnector aconn = (AbstractConnector) connector;
            if (isSetThreadingParameters()) {
                ThreadPool pool = aconn.getThreadPool();
                if (pool == null) {
                    pool = aconn.getServer().getThreadPool();
                }
                if (pool == null) {
                    pool = new QueuedThreadPool();
                    aconn.getServer().setThreadPool(pool);
                    aconn.setThreadPool(pool);
                }
                if (pool instanceof QueuedThreadPool) {
                    QueuedThreadPool pl = (QueuedThreadPool)pool;
                    if (getThreadingParameters().isSetMinThreads()) {
                        pl.setMinThreads(getThreadingParameters().getMinThreads());
    View Full Code Here

    Examples of org.eclipse.jetty.server.AbstractConnector

            registedPaths.add(url.getPath());
            ++servantCount;
        }
       
        protected void setupThreadPool() {
            AbstractConnector aconn = (AbstractConnector) connector;
            if (isSetThreadingParameters()) {
                ThreadPool pool = aconn.getThreadPool();
                if (pool == null) {
                    pool = aconn.getServer().getThreadPool();
                }
                if (pool == null) {
                    pool = new QueuedThreadPool();
                    aconn.getServer().setThreadPool(pool);
                    aconn.setThreadPool(pool);
                }
                //threads for the acceptors and selectors are taken from
                //the pool so we need to have room for those
                int acc = aconn.getAcceptors() * 2;
                if (getThreadingParameters().isSetMaxThreads()
                    && getThreadingParameters().getMaxThreads() <= acc) {
                    throw new Fault(new Message("NOT_ENOUGH_THREADS", LOG,
                                                port,
                                                acc + 1,
    View Full Code Here

    Examples of org.eclipse.jetty.server.AbstractConnector

               
            ++servantCount;
        }
       
        protected void setupThreadPool() {
            AbstractConnector aconn = (AbstractConnector) connector;
            if (isSetThreadingParameters()) {
                ThreadPool pool = aconn.getThreadPool();
                if (pool == null) {
                    pool = new QueuedThreadPool();
                    aconn.setThreadPool(pool);
                }
                if (pool instanceof OldQueuedThreadPool) {
                    OldQueuedThreadPool pl = (OldQueuedThreadPool)pool;
                    if (getThreadingParameters().isSetMinThreads()) {
                        pl.setMinThreads(getThreadingParameters().getMinThreads());
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. All rights reserved.
    All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.