Package org.simpleframework.transport.connect

Examples of org.simpleframework.transport.connect.SocketConnection


   * @return a closable that can be invoked in case the service is to be shut
   *         down
   */
  public Closeable initialize() {
    try {
      Connection connection = new SocketConnection(this);
      SocketAddress address = new InetSocketAddress(PORT_NUMBER);
      connection.connect(address);
      logger.info("HTTP service for ExtensionSwap installation running on port {}", PORT_NUMBER);
      return connection;
    } catch (IOException e) {
      logger.warn("Could not host HTTP service for ExtensionSwap installation on port " + PORT_NUMBER
          + ". Automatic installations of extensions will not be available.", e);
View Full Code Here


        // Complete initialization
        Container container = new SimpleContainer(this);
        ContainerServer server = new ContainerServer(container,
                getDefaultThreads());
        SimpleServer filter = new SimpleServer(server);
        Connection connection = new SocketConnection(filter);
        setConfidential(true);
        setContainerServer(server);
        setConnection(connection);

        // Effectively connect the server socket
View Full Code Here

        }
        final Container container = new SimpleContainer(this);
        final ContainerServer server = new ContainerServer(container,
                getDefaultThreads());
        final SimpleServer restletServer = new SimpleServer(server);
        final Connection connection = new SocketConnection(restletServer);

        setConfidential(false);
        setContainerServer(server);
        setConnection(connection);
View Full Code Here

        this.container = container;
    }

    public void start() throws IOException
    {
        connection = new SocketConnection(container);
        connection.connect(address);
    }
View Full Code Here

    public String host() {
        return host;
    }

    public void run(final Application app) throws IOException {
        connection = new SocketConnection(new ContainerServer(new ApplicationContainer(app)));
        connection.connect(new InetSocketAddress(host, port));
    }
View Full Code Here

  public Tracker(InetSocketAddress address, String version)
    throws IOException {
    this.address = address;

    this.torrents = new ConcurrentHashMap<String, TrackedTorrent>();
    this.connection = new SocketConnection(
        new TrackerService(version, this.torrents));
  }
View Full Code Here

      SSLContext sslContext = context.getContext();
      Agent agent = new MockAgent();
      TransportProcessor processor = new TransportProcessor();
      ProcessorServer server = new ProcessorServer(processor);
      ConfigurableCertificateServer certServer = new ConfigurableCertificateServer(server);
      SocketConnection con = new SocketConnection(certServer, agent);
      SocketAddress serverAddress = new InetSocketAddress(listenPort);
     
      certServer.setCertRequired(certificateRequired);
      con.connect(serverAddress, sslContext);
     
      return con;
   }
View Full Code Here

      TransportGrabber grabber = new TransportGrabber(processor);
      ProcessorServer processorServer = new ProcessorServer(grabber);
     
      this.server = new ConfigurableCertificateServer(processorServer, certRequired)
      this.agent = new ConsoleAgent();
      this.connection = new SocketConnection(server, agent);
      this.address = new InetSocketAddress(port);
      this.context = context;
   }  
View Full Code Here

    }

    public static void main(String[] list) throws Exception {
        Container container = new HelloWorld();
        Server server = new ContainerServer(container);
        Connection connection = new SocketConnection(server);
        SocketAddress address = new InetSocketAddress(8080);

        connection.connect(address);
    }
View Full Code Here

               }
            }
         }
      };
      ContainerServer server = new ContainerServer(container);
      Connection connection = new SocketConnection(server);
      InetSocketAddress address = (InetSocketAddress)connection.connect(null); // ephemeral port
     
      return new ServerCriteria(connection, address);
   }
View Full Code Here

TOP

Related Classes of org.simpleframework.transport.connect.SocketConnection

Copyright © 2018 www.massapicom. 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.