Package com.facebook.swift.codec

Examples of com.facebook.swift.codec.ThriftCodecManager


    @BeforeMethod(alwaysRun = true)
    public void setup()
            throws IllegalAccessException, InstantiationException, TException
    {
        codecManager = new ThriftCodecManager();
        clientManager = new ThriftClientManager(codecManager);
    }
View Full Code Here


    @BeforeMethod(alwaysRun = true)
    private void setup() throws Exception
    {
        InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());

        codecManager = new ThriftCodecManager();
        clientManager = new ThriftClientManager(codecManager);
        syncServer = createTargetServer(TARGET_SERVER_THREAD_COUNT);
        asyncServer = createAsyncServer(PROXY_SERVER_THREAD_COUNT, clientManager, syncServer);
    }
View Full Code Here

    public void testPumaSwift()
            throws Exception
    {
        // create server and start
        PumaReadServer puma = new PumaReadServer();
        ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), ImmutableList.<ThriftEventHandler>of(), puma);

        // create server and client
        try (
                ThriftServer server = new ThriftServer(processor).start();
                ThriftClientManager clientManager = new ThriftClientManager();
View Full Code Here

    {
        PumaReadServer puma = new PumaReadServer();
        ReadSemanticException exception = new ReadSemanticException("my exception");
        puma.setException(exception);

        NiftyProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), ImmutableList.<ThriftEventHandler>of(), puma);
        try (
                ThriftServer server = new ThriftServer(processor).start();
                ThriftClientManager clientManager = new ThriftClientManager();
                PumaReadService pumaClient = clientManager.createClient(
                        new FramedClientConnector(HostAndPort.fromParts("localhost", server.getPort())),
View Full Code Here

    @Test
    public void testSwiftService()
            throws Exception
    {
        SwiftScribe scribeService = new SwiftScribe();
        NiftyProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(), ImmutableList.<ThriftEventHandler>of(), scribeService);

        List<LogEntry> messages = testProcessor(processor);
        assertEquals(scribeService.getMessages(), newArrayList(concat(toSwiftLogEntry(messages), toSwiftLogEntry(messages))));
    }
View Full Code Here

    @BeforeMethod(alwaysRun = true)
    public void setup()
            throws IllegalAccessException, InstantiationException, TException
    {
        codecManager = new ThriftCodecManager();
        clientManager = new ThriftClientManager(codecManager);
        syncServer = createSyncServer();
    }
View Full Code Here

    @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "duplicate key.*")
    public void testConflictingServices()
            throws Exception
    {
        new ThriftServiceProcessor(new ThriftCodecManager(), ImmutableList.<ThriftEventHandler>of(),
                new SwiftScribe(), new ConflictingLogService());
    }
View Full Code Here

    {
        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 NettyServerTransport server;

        public ScopedServer(TProtocolFactory protocolFactory)
                throws TTransportException, InterruptedException
        {
            ThriftServiceProcessor processor = new ThriftServiceProcessor(new ThriftCodecManager(),
                    ImmutableList.<ThriftEventHandler>of(), new ScribeHandler());

            ThriftServerDef def = ThriftServerDef.newBuilder()
                                                 .listen(0)
                                                 .withProcessor(processor)
View Full Code Here

        }

        public ServerCreator invoke()
        {
            ThriftServiceProcessor processor = new ThriftServiceProcessor(
                    new ThriftCodecManager(),
                    ImmutableList.<ThriftEventHandler>of(),
                    new SimpleService()
            );

            taskWorkerExecutor = newFixedThreadPool(1);
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.