Example #1
0
 static SinkContext()
 {
     IAOPConfig cfg = AOPConfig.AOPConfiguration;
     Type factory = cfg.LoadSinkFactory();
     if (factory == null)
         _instance = new DefaultSinkFactory();
     else
         _instance = (ISinkFactory)Activator.CreateInstance(factory);
 }
Example #2
0
 public FrontendRoutingService(ISinkFactory <IMessage> sinkFactory, INotifierFactory notifierFactory)
 {
     this.sinkFactory     = Preconditions.CheckNotNull(sinkFactory, nameof(sinkFactory));
     this.notifierFactory = Preconditions.CheckNotNull(notifierFactory, nameof(notifierFactory));
     this.closed          = new AtomicBoolean(false);
     this.cts             = new CancellationTokenSource();
     this.sinks           = new AtomicReference <ImmutableDictionary <string, ISink <IMessage> > >(ImmutableDictionary <string, ISink <IMessage> > .Empty);
     this.notifiers       = new AtomicReference <ImmutableDictionary <string, INotifier> >(ImmutableDictionary <string, INotifier> .Empty);
 }
Example #3
0
        static SinkContext()
        {
            IAOPConfig cfg     = AOPConfig.AOPConfiguration;
            Type       factory = cfg.LoadSinkFactory();

            if (factory == null)
            {
                _instance = new DefaultSinkFactory();
            }
            else
            {
                _instance = (ISinkFactory)Activator.CreateInstance(factory);
            }
        }
Example #4
0
 public RetryingSinkFactory(ISinkFactory <T> underlying, RetryPolicy retryPolicy)
 {
     this.underlying  = Preconditions.CheckNotNull(underlying, nameof(underlying));
     this.retryPolicy = Preconditions.CheckNotNull(retryPolicy, nameof(retryPolicy));
 }
Example #5
0
        public IMessageSink GetObjectSink(MarshalByRefObject obj, IMessageSink nextSink)
        {
            ISinkFactory factory = SinkContext.GetFactory();

            return(factory.Create(obj, nextSink));
        }