Exemplo n.º 1
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));
        }
Exemplo n.º 2
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));
        }
Exemplo n.º 3
0
 public WampClientContainer(IWampClientBuilderFactory <TMessage, IWampClient> clientBuilderFactory) :
     base(clientBuilderFactory)
 {
 }
Exemplo n.º 4
0
 public WampClientContainer(IWampClientBuilderFactory <TMessage, IWampClientProxy <TMessage> > clientBuilderFactory) :
     this(clientBuilderFactory, new WampSessionMapper())
 {
 }
Exemplo n.º 5
0
 public WampClientContainer(IWampClientBuilderFactory <TMessage, IWampClientProxy <TMessage> > clientBuilderFactory, IWampSessionMapper sessionIdMap) :
     base(clientBuilderFactory)
 {
     mSessionIdMap = sessionIdMap;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Creates a new instance of <see cref="WampClientContainer{TMessage,TClient}"/>
 /// using a client builder that is activated using the given
 /// <paramref name="clientBuilderFactory"/> and this container.
 /// </summary>
 /// <param name="clientBuilderFactory">The given <see cref="IWampClientBuilderFactory{TMessage,TClient}"/>.</param>
 public WampClientContainer(IWampClientBuilderFactory <TMessage, TClient> clientBuilderFactory)
 {
     mClientBuilder = clientBuilderFactory.GetClientBuilder(this);
 }