mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-10 17:00:30 +08:00
Initial commit: five Maven reactors and docs only
Track maven-cloudwalk-cloud, maven-cw-elevator-application, maven-intelligent-cwoscomponent, maven-ninca-crk, maven-ninca-qk-alarm, and docs/. Other workspace paths ignored via .gitignore. Made-with: Cursor
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
package cn.cloudwalk.event.task;
|
||||
|
||||
import cn.cloudwalk.cwos.client.event.event.BaseEvent;
|
||||
import cn.cloudwalk.event.handler.EventHandler;
|
||||
|
||||
public class EventHandleTask<E extends BaseEvent> {
|
||||
private E event;
|
||||
private EventHandler<E> handler;
|
||||
|
||||
public EventHandleTask(E event, EventHandler<E> handler) {
|
||||
this.event = event;
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public String start() {
|
||||
this.handler.onEvent(this.event);
|
||||
return this.event.getMessageId();
|
||||
}
|
||||
|
||||
public E getEvent() {
|
||||
return this.event;
|
||||
}
|
||||
|
||||
public void setEvent(E event) {
|
||||
this.event = event;
|
||||
}
|
||||
|
||||
public EventHandler<E> getHandler() {
|
||||
return this.handler;
|
||||
}
|
||||
|
||||
public void setHandler(EventHandler<E> handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user