本文整理汇总了Java中com.github.czyzby.autumn.processor.event.EventDispatcher类的典型用法代码示例。如果您正苦于以下问题:Java EventDispatcher类的具体用法?Java EventDispatcher怎么用?Java EventDispatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EventDispatcher类属于com.github.czyzby.autumn.processor.event包,在下文中一共展示了EventDispatcher类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ContextInitializer
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
/** Creates a new context initializer with default annotation processors. */
public ContextInitializer() {
// Default annotations:
scannedMetaAnnotations.add(Processor.class);
scannedMetaAnnotations.add(Provider.class);
scannedAnnotations.add(Component.class);
scannedAnnotations.add(Dispose.class);
scannedAnnotations.add(OnEvent.class);
scannedAnnotations.add(OnMessage.class);
// Default processors:
addProcessor(new MetaAnnotationProcessor()); // Registers annotation processors.
addProcessor(new ProviderAnnotationProcessor()); // Registers dependency providers.
addProcessor(new InjectAnnotationProcessor()); // Injects field dependencies.
addProcessor(new InitiateAnnotationProcessor()); // Invokes initiation methods.
addProcessor(new DestroyAnnotationProcessor()); // Schedules destruction methods upon disposing.
addProcessor(new DisposeAnnotationProcessor()); // Schedules disposing of fields and components.
addProcessor(new EventDispatcher()); // Registers event listeners. Allows to post events.
addProcessor(new MessageDispatcher()); // Registers message listeners. Allows to post messages.
}
示例2: ContextInitializer
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
/** Creates a new context initializer with default annotation processors. */
public ContextInitializer() {
// Default annotations:
scannedMetaAnnotations.add(Processor.class);
scannedMetaAnnotations.add(Provider.class);
scannedAnnotations.add(Component.class);
scannedAnnotations.add(Dispose.class);
scannedAnnotations.add(OnEvent.class);
scannedAnnotations.add(OnMessage.class);
// Default processors:
addProcessor(new ComponentAnnotationProcessor()); // Maps components by interfaces.
addProcessor(new MetaAnnotationProcessor()); // Registers annotation processors.
addProcessor(new ProviderAnnotationProcessor()); // Registers dependency providers.
addProcessor(new InjectAnnotationProcessor()); // Injects field dependencies.
addProcessor(new InitiateAnnotationProcessor()); // Invokes initiation methods.
addProcessor(new DestroyAnnotationProcessor()); // Schedules destruction methods upon disposing.
addProcessor(new DisposeAnnotationProcessor()); // Schedules disposing of fields and components.
addProcessor(new EventDispatcher()); // Registers event listeners. Allows to post events.
addProcessor(new MessageDispatcher()); // Registers message listeners. Allows to post messages.
}
示例3: setEventDispatcher
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
public void setEventDispatcher(EventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;
for (InputFile inputFile : inputFiles) {
inputFile.setEventDispatcher(eventDispatcher);
}
}
示例4: setEventDispatcher
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
public void setEventDispatcher(EventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;
fileType.setEventDispatcher(eventDispatcher);
for (PackModel pack : packs) {
pack.setEventDispatcher(eventDispatcher);
}
}
示例5: onMessage
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
/** Will be invoked any time "myMessage" is posted using {@link MessageDispatcher}. Note that annotated listener
* methods can contain any injectable parameters, using the same mechanism as {@link Inject} or {@link Initiate}
* annotations.
*
* @param eventDispatcher will be automatically injected. */
@OnMessage("myMessage")
public void onMessage(final EventDispatcher eventDispatcher) {
LOGGER.info("I detected 'myMessage'. Posting MyEvent.");
final MyEvent event = new MyEvent("MyHandler#onMessage");
eventDispatcher.postEvent(event);
}
示例6: setEventDispatcher
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
public void setEventDispatcher(EventDispatcher eventDispatcher) {
this.eventDispatcher = eventDispatcher;
}
示例7: extractComponents
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
@Initiate() void extractComponents(Context context, EventDispatcher eventDispatcher, MessageDispatcher messageDispatcher) {
App.this.context = context;
App.this.eventDispatcher = eventDispatcher;
App.this.messageDispatcher = messageDispatcher;
}
示例8: getEventDispatcher
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
/** @return {@link EventDispatcher} allowing to post events to notify event listeners. */
public EventDispatcher getEventDispatcher() {
return eventDispatcher;
}
示例9: getEventDispatcher
import com.github.czyzby.autumn.processor.event.EventDispatcher; //导入依赖的package包/类
public EventDispatcher getEventDispatcher() { return eventDispatcher; }