コード例 #1
0
        public MatchMakingMonitor(EPServiceProvider epService, MatchAlertListener matchAlertListener)
        {
            _matchAlertListener = matchAlertListener;
            _epService          = epService;

            // Get called for any user showing up
            var factory = _epService.EPAdministrator.CreatePattern("every user=" + typeof(MobileUserBean).FullName);

            factory.Events += HandleFactoryEvents;
        }
コード例 #2
0
        public MatchMakingMonitor(EPRuntime runtime, MatchAlertListener matchAlertListener)
        {
            _matchAlertListener = matchAlertListener;
            _runtime            = runtime;

            // Get called for any user showing up
            var factory = CompileDeploy("every user=" + typeof(MobileUserBean).FullName);

            factory.Events += HandleFactoryEvents;
        }
コード例 #3
0
        public MatchMakingMonitor(EPServiceProvider epService, MobileUserBean mobileUser, MatchAlertListener matchAlertListener)
        {
            _epService          = epService;
            _matchAlertListener = matchAlertListener;
            _mobileUserId       = mobileUser.UserId;

            // Create patterns that listen to other users
            SetupPatterns(mobileUser);

            // Listen to my own location changes so my data is up-to-date
            EPStatement locationChange = _epService.EPAdministrator.CreatePattern(
                "every myself=" + typeof(MobileUserBean).FullName +
                "(UserId=" + mobileUser.UserId + ")");

            locationChange.Events +=
                delegate(Object sender, UpdateEventArgs e) {
                // When my location changed, re-establish pattern
                _locateOther.RemoveAllEventHandlers();
                var myself = (MobileUserBean)e.NewEvents[0]["myself"];
                SetupPatterns(myself);
            };
        }