Isaku Yamahata 1ed59505a8 base/app_manager: teach event dispatcher state
When independent methods for different dispatchers defined, all methods
are called independent of state. This patch teach event dispatcher state.

The following class

class PacketTesting(app_manager.RyuApp):
@set_ev_cls(ofp_event.EventOFPEchoRequest, MAIN_DISPATCHER)
def _echo_rep_main(self, ev):
    print "DEBUG: In Handler for Echo Request (Main)"

@set_ev_cls(ofp_event.EventOFPEchoRequest, CONFIG_DISPATCHER)
def _echo_rep_conf(self, ev):
    print "DEBUG: In Handler for Echo Request (Config)"

@set_ev_cls(ofp_event.EventOFPEchoRequest, HANDSHAKE_DISPATCHER)
def _echo_rep_hand(self, ev):
    print "DEBUG: In Handler for Echo Request (Handshake)"

output
> EVENT ofp_event->PacketTesting EventOFPEchoRequest
> DEBUG: In Handler for Echo Request (Config)
> DEBUG: In Handler for Echo Request (Dead)
> DEBUG: In Handler for Echo Request (Handshake)
> DEBUG: In Handler for Echo Request (Main)

Reported-by: Alan Barr <alanbarr2002@gmail.com>
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
2013-07-09 14:13:30 +09:00
..
2011-12-09 15:56:05 +09:00