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); }
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(); }
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); }
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(); }
public UserService(SwitchSubscriber context) { this.Context = context; }