예제 #1
0
        private static WampListener <TMessage> GetWampListener(IWampConnectionListener <TMessage> connectionListener, IWampFormatter <TMessage> formatter, IWampServer <TMessage> server)
        {
            IWampClientBuilderFactory <TMessage, IWampClient> clientBuilderFactory =
                GetWampClientBuilder(formatter);

            IWampClientContainer <TMessage, IWampClient> clientContainer =
                new WampClientContainer <TMessage>(clientBuilderFactory);

            IWampRequestMapper <TMessage> requestMapper =
                new WampRequestMapper <TMessage>(server.GetType(),
                                                 formatter);

            WampMethodBuilder <TMessage, IWampClient> methodBuilder =
                new WampMethodBuilder <TMessage, IWampClient>(server, formatter);

            IWampIncomingMessageHandler <TMessage, IWampClient> wampIncomingMessageHandler =
                new WampIncomingMessageHandler <TMessage, IWampClient>
                    (requestMapper,
                    methodBuilder);

            return(new WampListener <TMessage>
                       (connectionListener,
                       wampIncomingMessageHandler,
                       clientContainer));
        }
예제 #2
0
        private WampListener <TMessage> GetWampListener(IWampConnectionListener <TMessage> connectionListener, IWampBinding <TMessage> binding, IWampOutgoingRequestSerializer outgoingRequestSerializer)
        {
            IWampClientBuilderFactory <TMessage, IWampClientProxy <TMessage> > clientBuilderFactory =
                GetWampClientBuilder(binding, outgoingRequestSerializer);

            IWampClientContainer <TMessage, IWampClientProxy <TMessage> > clientContainer =
                new WampClientContainer <TMessage>(clientBuilderFactory);

            IWampRequestMapper <TMessage> requestMapper =
                new WampRequestMapper <TMessage>(typeof(WampServer <TMessage>),
                                                 binding.Formatter);

            WampRealmMethodBuilder <TMessage> methodBuilder =
                new WampRealmMethodBuilder <TMessage>(mSession, binding.Formatter);

            IWampIncomingMessageHandler <TMessage, IWampClientProxy <TMessage> > wampIncomingMessageHandler =
                new WampIncomingMessageHandler <TMessage, IWampClientProxy <TMessage> >
                    (requestMapper,
                    methodBuilder);

            return(new WampListener <TMessage>
                       (connectionListener,
                       wampIncomingMessageHandler,
                       clientContainer,
                       mSession));
        }
예제 #3
0
        private IWampIncomingMessageHandler <JToken, IWampClient> GetHandler(IWampServer <JToken> wampServer)
        {
            IWampIncomingMessageHandler <JToken, IWampClient> handler =
                new WampIncomingMessageHandler <JToken, IWampClient>
                    (new WampRequestMapper <JToken>(wampServer.GetType(),
                                                    mFormatter),
                    new WampMethodBuilder <JToken, IWampClient>(wampServer, mFormatter));

            return(handler);
        }
예제 #4
0
        private IWampIncomingMessageHandler <JToken, IWampClient> GetHandler(object instance)
        {
            IWampIncomingMessageHandler <JToken, IWampClient> handler =
                new WampIncomingMessageHandler <JToken, IWampClient>
                    (new WampRequestMapper <JToken>(instance.GetType(),
                                                    mFormatter),
                    new WampMethodBuilder <JToken, IWampClient>(instance, mFormatter));

            return(handler);
        }
예제 #5
0
        private IWampIncomingMessageHandler<JToken, IWampClient> GetHandler(IWampServer<JToken> wampServer)
        {
            IWampIncomingMessageHandler<JToken, IWampClient> handler =
                new WampIncomingMessageHandler<JToken, IWampClient>
                    (new WampRequestMapper<JToken>(wampServer.GetType(),
                                                   mFormatter),
                     new WampMethodBuilder<JToken, IWampClient>(wampServer, mFormatter));

            return handler;
        }
예제 #6
0
        public BaseScenario()
        {
            Binding = new MockBinding();

            ClientBuilder = new WampMockClientBuilder <MockRaw>(Binding);

            mServer = CreateServer();

            Handler =
                new WampIncomingMessageHandler <MockRaw, IWampClientProxy <MockRaw> >
                    (new WampRequestMapper <MockRaw>(mServer.GetType(),
                                                     Binding.Formatter),
                    new WampMethodBuilder <MockRaw, IWampClientProxy <MockRaw> >
                        (mServer, Binding.Formatter));
        }
        private IWampIncomingMessageHandler<JToken, IWampClient> GetHandler(object instance)
        {
            IWampIncomingMessageHandler<JToken, IWampClient> handler =
                new WampIncomingMessageHandler<JToken, IWampClient>
                    (new WampRequestMapper<JToken>(instance.GetType(),
                                                   mFormatter),
                     new WampMethodBuilder<JToken, IWampClient>(instance, mFormatter));

            return handler;
        }