Package com.facebook.swift.codec

Examples of com.facebook.swift.codec.ThriftCodecManager


    {
        SwiftScribe scribeService = new SwiftScribe();
        EventHandler eventHandler = new EventHandler(niftyProcessor);
        EventHandler secondHandler = new EventHandler(niftyProcessor);
        List<EventHandler> handlers = ImmutableList.of(eventHandler, secondHandler);
        final ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), handlers, scribeService);

        List<LogEntry> messages = niftyProcessor ?
                testProcessor(processor) : testProcessor(NiftyProcessorAdapters.processorToTProcessor(processor));
        assertEquals(scribeService.getMessages(), newArrayList(concat(toSwiftLogEntry(messages), toSwiftLogEntry(messages))));
        assertTrue(eventHandler.validate(2));
View Full Code Here


  private final ClientProxyService proxyService;
  private final ThriftServer server;

  public TClientProxyProtocolServer(ClientProxyCommons commons, ClientProxyService proxyService) {
    this.proxyService = proxyService;
    ThriftCodecManager codecManager = new ThriftCodecManager();
    ThriftEventHandler eventHandler = new ThriftEventHandler();
    ThriftServiceProcessor processor = new ThriftServiceProcessor(codecManager, Arrays.asList(
        eventHandler), this);
    server = new ThriftServer(processor, getServerConfig(commons.conf)).start();
  }
View Full Code Here

  }

  /** Helper verifier */
  private <T extends Writable> void verifyStruct(T object) throws Exception {
    @SuppressWarnings("unchecked") Class<T> clazz = (Class<T>) object.getClass();
    ThriftCodec<T> codec = new ThriftCodecManager().getCodec(clazz);
    codec.write(object, protocol);
    T thriftCopy = codec.read(protocol);
    assertEqualsVerbose(object, thriftCopy);
    T writableCopy = WritableUtils.clone(object, new Configuration());
    assertEqualsVerbose(object, writableCopy);
View Full Code Here

  }

  /** Helper verifier */
  private <T extends Writable> void verifyStruct(T object) throws Exception {
    @SuppressWarnings("unchecked") Class<T> clazz = (Class<T>) object.getClass();
    ThriftCodec<T> codec = new ThriftCodecManager().getCodec(clazz);
    codec.write(object, protocol);
    T thriftCopy = codec.read(protocol);
    assertEqualsVerbose(object, thriftCopy);
    T writableCopy = WritableUtils.clone(object, new Configuration());
    assertEqualsVerbose(object, writableCopy);
View Full Code Here

TOP

Related Classes of com.facebook.swift.codec.ThriftCodecManager

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.