CommonEvent.java
772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package com.yoho.error.event;
import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.springframework.context.ApplicationEvent;
/**
*
* 通用的事件
*
* Created by chunhua.zhang@yoho.cn on 2016/2/3.
*/
public class CommonEvent extends ApplicationEvent {
/**
* @Fields serialVersionUID
*/
private static final long serialVersionUID = 2840308379764797160L;
// 事件名称,线程名称
protected final String name;
/**
* Create a new ApplicationEvent.
*
* @param name
* : 事件的名称
*/
public CommonEvent(String name) {
super(name);
this.name = name;
}
@Override
public String toString() {
return ReflectionToStringBuilder.toString(this);
}
public String getName() {
return name;
}
}