예제 #1
0
        public static void Main(string[] args)
        {
            INode node = SmartRoute.NodeFactory.Default;

            node.Loger.Type = LogType.ALL;
            node.AddLogHandler(new SmartRoute.ConsoleLogHandler(LogType.ALL));
            node.Open();
            SwitchSubscriber rmiserver = new SwitchSubscriber(node);

            rmiserver.Register <IUserService>(new Program());
            System.Threading.Thread.Sleep(-1);
        }
예제 #2
0
        public static void Main(string[] args)
        {
            INode node = NodeFactory.Default;

            node.Loger.Type = LogType.ALL;
            node.AddLogHandler(new SmartRoute.ConsoleLogHandler(LogType.ALL));
            node.Open();
            SwitchSubscriber switchSubscriber = new SwitchSubscriber(node);
            EventSubscriber  henry            = switchSubscriber.GetService("henry");

            henry.Register <User>(OnUser);
            henry.Register <Employee>(OnEmployees);
            while (true)
            {
                Console.WriteLine("{0}/秒|{1}", mCount - mLastCount, mCount);
                mLastCount = mCount;
                System.Threading.Thread.Sleep(1000);
            }
            Console.Read();
        }
예제 #3
0
        public static void Main(string[] args)
        {
            INode node = NodeFactory.Default;

            node.Loger.Type = LogType.ALL;
            node.AddLogHandler(new ConsoleLogHandler(LogType.ALL));
            node.Open();
            SwitchSubscriber rmiserver = new SwitchSubscriber(node);

            mUserService = new UserService(rmiserver);
            rmiserver.ServiceRegisted = (s, m) =>
            {
                if (m.ServiceName == "IUserService")
                {
                    Console.WriteLine("find interface {0}", m.ServiceName);
                    System.Threading.ThreadPool.QueueUserWorkItem(Test_Register);
                    System.Threading.ThreadPool.QueueUserWorkItem(Test_ChangePWD);
                }
            };
            System.Threading.Thread.Sleep(-1);
        }
예제 #4
0
        public static void Main(string[] args)
        {
            INode node = NodeFactory.Default;

            node.Loger.Type = LogType.ALL;
            node.AddLogHandler(new SmartRoute.ConsoleLogHandler(LogType.ALL));
            node.Open();
            mSwitchSubscriber = new SwitchSubscriber(node);
            mSwitchSubscriber.ServiceRegisted = (o, e) =>
            {
                if (e.ServiceName == "henry")
                {
                }
            };
            System.Threading.ThreadPool.QueueUserWorkItem(Test);
            while (true)
            {
                Console.WriteLine("{0}/秒|{1}", mCount - mLastCount, mCount);
                mLastCount = mCount;
                System.Threading.Thread.Sleep(1000);
            }
            Console.Read();
        }
예제 #5
0
 public UserService(SwitchSubscriber context)
 {
     this.Context = context;
 }