总线可以承载任何类型的
要自定义事件名称,可以在自定义类上使用
如果不能或不想为自定义事件使用
例如,考虑以下称为 package com.acme; public class MyEvent extends RemoteApplicationEvent { ... } 你可以通过以下方式向反序列化程序注册该事件: package com.acme; @Configuration @RemoteApplicationEventScan public class BusConfiguration { ... }
如果不指定值,则注册使用
你还可以使用 package com.acme; @Configuration //@RemoteApplicationEventScan({"com.acme", "foo.bar"}) //@RemoteApplicationEventScan(basePackages = {"com.acme", "foo.bar", "fizz.buzz"}) @RemoteApplicationEventScan(basePackageClasses = BusConfiguration.class) public class BusConfiguration { ... }
|