예제 #1
0
 public SnsCallbackEndpoint(SnsAdapter snsAdapter, ILogger logger, LogLevel logAllIncommingCalls)
 {
     _SnsAdapter           = snsAdapter;
     _Logger               = logger;
     _LogAllIncommingCalls = logAllIncommingCalls;
     _SnsAdapter.BindObject(this);
 }
예제 #2
0
 public SubscriptionInfo(SnsAdapter parentEndpoint, string topicArn, string subscriptionArn, bool isLocalPending)
 {
     this.ParentEndpoint  = parentEndpoint;
     this.TopicArn        = topicArn;
     this.SubscriptionArn = subscriptionArn;
     this.IsLocalPending  = isLocalPending;
     this.Initiated       = DateTime.Now;
 }
                public InboundPipe(SnsAdapter ep, object obj, MethodInfo mth, string topicArn)
                {
                    _Ep       = ep;
                    _Mth      = mth;
                    _Obj      = obj;
                    _TopicArn = topicArn;
                    _Ep.IncommingRawMessage += this.OnIncommingMessage;

                    // trigger subscription
                    _Ep.GetOrSubscribe(_TopicArn);
                }
            public ObjectBindingAdapter(object target, SnsAdapter endpoint, bool doWireUp = true)
            {
                _Target     = target;
                _TargetType = target.GetType();
                _Endpoint   = endpoint;

                if (doWireUp)
                {
                    this.Wireup();
                }
            }
                public OutboundPipe(SnsAdapter ep, object obj, EventInfo evt, string topicArn)
                {
                    _Ep       = ep;
                    _Evt      = evt;
                    _Obj      = obj;
                    _TopicArn = topicArn;
                    var method = this.GetType().GetMethod(nameof(OnOutgoingMessage), BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod);

                    _Handler = Delegate.CreateDelegate(evt.EventHandlerType, this, method);
                    _Evt.AddEventHandler(_Obj, _Handler);
                }