public RegistrationDescriptorService(IWampRealm realm) : base(new RegistrationMetadataSubscriber(realm.TopicContainer), WampErrors.NoSuchRegistration) { IWampRpcOperationCatalog rpcCatalog = realm.RpcCatalog; IObservable <IWampProcedureRegistration> removed = GetRegistrationRemoved(rpcCatalog); var observable = from registration in GetRegistrationAdded(rpcCatalog) let registrationRemoved = removed.Where(x => x == registration) let calleeRegistered = GetCalleeRegistered(registration, registrationRemoved) let calleeUnregistered = GetCalleeUnregistered(registration, registrationRemoved) select new { registration, calleeRegistered, calleeUnregistered }; var addObservable = from item in observable from operation in item.calleeRegistered select new { Registration = item.registration, Operation = operation }; var removeObservable = from item in observable from operation in item.calleeUnregistered select new { Registration = item.registration, Operation = operation }; IDisposable addDisposable = addObservable.Subscribe(x => OnRegistrationAdded(x.Registration, x.Operation)); IDisposable removeDisposable = removeObservable.Subscribe(x => OnRegistrationRemoved(x.Registration, x.Operation)); mDisposable = new CompositeDisposable(addDisposable, removeDisposable); mOperationCatalog = rpcCatalog; }
private static IObservable <IWampProcedureRegistration> GetRegistrationAdded(IWampRpcOperationCatalog rpcCatalog) { return(Observable.FromEventPattern <WampProcedureRegisterEventArgs> (x => rpcCatalog.RegistrationAdded += x, x => rpcCatalog.RegistrationAdded -= x) .Select(x => x.EventArgs.Registration) .Where(x => !WampRestrictedUris.IsRestrictedUri(x.Procedure))); }
public WampRpcServer(IWampRpcOperationCatalog catalog, IWampBinding <TMessage> binding, IWampUriValidator uriValidator) { mInvoker = catalog; mUriValidator = uriValidator; mLogger = LogProvider.GetLogger(this.GetType()); mFormatter = binding.Formatter; mHandler = new WampCalleeInvocationHandler <TMessage>(binding.Formatter); mCalleeCatalog = new WampCalleeOperationCatalog <TMessage> (catalog, mHandler); }
public WampRealm(string name, IWampRpcOperationCatalog catalog, IWampTopicContainer topicContainer) { Name = name; RpcCatalog = catalog; TopicContainer = topicContainer; }
public WampCalleeOperationCatalog(IWampRpcOperationCatalog catalog, IWampCalleeInvocationHandler <TMessage> invocationHandler) { mCatalog = catalog; mInvocationHandler = invocationHandler; }
public ForwardingRpcCatalog(IWampRpcOperationCatalog rpcCatalog, IWampChannel channel) { this._rpcCatalog = rpcCatalog; this._channel = channel; }