本文整理匯總了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; }