Package com.facebook.nifty.core

Examples of com.facebook.nifty.core.ThriftServerDefBuilder


        }
        catch (IOException e) {
            port = 8080;
        }

        return new ThriftServerDefBuilder()
                .listen(port)
                .withProcessor(new scribe.Processor<>(new scribe.Iface() {
                    @Override
                    public ResultCode Log(List<LogEntry> messages)
                            throws TException {
View Full Code Here


                new NiftyModule()
                {
                    @Override
                    protected void configureNifty()
                    {
                        bind().toInstance(new ThriftServerDefBuilder()
                                .listen(port)
                                .withProcessor(new scribe.Processor<>(new scribe.Iface()
                                {
                                    @Override
                                    public ResultCode Log(List<LogEntry> messages)
View Full Code Here

                new NiftyModule()
                {
                    @Override
                    protected void configureNifty()
                    {
                        bind().toInstance(new ThriftServerDefBuilder()
                                .listen(8080)
                                .withProcessor(new scribe.Processor<scribe.Iface>(new scribe.Iface()
                                {
                                    @Override
                                    public ResultCode Log(List<LogEntry> messages)
View Full Code Here

        port = ((InetSocketAddress)server.getServerChannel().getLocalAddress()).getPort();
    }

    private ThriftServerDefBuilder getThriftServerDefBuilder()
    {
        return new ThriftServerDefBuilder()
                .listen(0)
                .withProcessor(new scribe.Processor<>(new scribe.Iface() {
                    @Override
                    public ResultCode Log(List<LogEntry> messages)
                            throws TException
View Full Code Here

        }
        catch (IOException e) {
            port = 8080;
        }

        return new ThriftServerDefBuilder()
                .listen(port)
                .withProcessor(new scribe.Processor<>(new scribe.Iface() {
                    @Override
                    public ResultCode Log(List<LogEntry> messages)
                            throws TException {
View Full Code Here

                new NiftyModule()
                {
                    @Override
                    protected void configureNifty()
                    {
                        bind().toInstance(new ThriftServerDefBuilder()
                                                  .listen(8080)
                                                  .withProcessor(new scribe.Processor<scribe
                                                          .Iface>(new scribe.Iface()
                                                  {
                                                      @Override
View Full Code Here

      this.lifeCycleManager = lifeCycleManager;
    }

    @Override
    public ThriftServerDef get() {
      ThriftServerDefBuilder builder = new ThriftServerDefBuilder()
        .listen(config.getServerPort())
        .limitFrameSizeTo(config.getMaxFrameSize())
        .limitQueuedResponsesPerConnection(config.getQueuedResponseLimit())
        .withProcessor(new LoadTest.Processor<LoadTest.Iface>(new LoadTestHandler()));

      if (config.getUseTaskQueue()) {
        builder.using(Executors.newFixedThreadPool(config.getNumTaskThreads()));
      }

      return builder.build();
    }
View Full Code Here

        }
        catch (IOException e) {
            port = 8080;
        }

        return new ThriftServerDefBuilder()
                .listen(port)
                .withProcessor(new scribe.Processor<>(new scribe.Iface() {
                    @Override
                    public ResultCode Log(List<LogEntry> messages)
                            throws TException {
View Full Code Here

                new NiftyModule()
                {
                    @Override
                    protected void configureNifty()
                    {
                        bind().toInstance(new ThriftServerDefBuilder()
                                .listen(port)
                                .withProcessor(new scribe.Processor<>(new scribe.Iface()
                                {
                                    @Override
                                    public ResultCode Log(List<LogEntry> messages)
View Full Code Here

        s.close();

        bootstrap = Guice.createInjector(Stage.PRODUCTION, new NiftyModule() {
            @Override
            protected void configureNifty() {
                ThriftServerDefBuilder serverDefBuilder;

                serverDefBuilder = new ThriftServerDefBuilder()
                        .listen(port)
                        .withProcessor(new scribe.Processor<>(new scribe.Iface() {
                            @Override
                            public ResultCode Log(List<LogEntry> messages)
                                    throws TException {
                                for (LogEntry message : messages) {
                                    log.info("{}: {}", message.getCategory(),
                                             message.getMessage());
                                }
                                return ResultCode.OK;
                            }
                        }));

                bind().toInstance(serverDefBuilder.build());
            }
        }).getInstance(NiftyBootstrap.class);

        bootstrap.start();
    }
View Full Code Here

TOP

Related Classes of com.facebook.nifty.core.ThriftServerDefBuilder

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.