You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.5 KiB
67 lines
1.5 KiB
package com.sinosoft.event;
|
|
|
|
import com.sinosoft.event.Event;
|
|
import com.sinosoft.event.EventAction;
|
|
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
|
|
public abstract class BaseEvent implements Event {
|
|
|
|
private static final long serialVersionUID = 4911719935676456727L;
|
|
private String eventCode;
|
|
private String eventName;
|
|
private String eventAction;
|
|
private Map<String,Object> eventParam = new HashMap<String,Object>();
|
|
|
|
|
|
|
|
|
|
public BaseEvent(String eventCode, String eventName, String eventAction, Map<String, Object> eventParam) {
|
|
super();
|
|
this.eventCode = eventCode;
|
|
this.eventName = eventName;
|
|
this.eventAction = eventAction;
|
|
this.eventParam = eventParam;
|
|
}
|
|
|
|
public String getEventCode() {
|
|
return eventCode;
|
|
}
|
|
|
|
public void setEventCode(String eventCode) {
|
|
this.eventCode = eventCode;
|
|
}
|
|
|
|
public String getEventName() {
|
|
return eventName;
|
|
}
|
|
|
|
public void setEventName(String eventName) {
|
|
this.eventName = eventName;
|
|
}
|
|
|
|
|
|
public String getEventAction() {
|
|
return eventAction;
|
|
}
|
|
|
|
public void setEventAction(String eventAction) {
|
|
this.eventAction = eventAction;
|
|
}
|
|
|
|
public Map<String, Object> getEventParam() {
|
|
return eventParam;
|
|
}
|
|
|
|
public void setEventParam(Map<String, Object> eventParam) {
|
|
this.eventParam = eventParam;
|
|
}
|
|
|
|
public EventAction buildAction() throws Exception {
|
|
EventAction action = null;
|
|
String actionClass = "com.sinosoft.lis.event.action."+eventAction;
|
|
action = (EventAction) Class.forName(actionClass).newInstance();
|
|
return action;
|
|
}
|
|
}
|
|
|