重构监控上报消息实体.

pull/28/head
chen.ma 3 years ago
parent 62828e0fac
commit 243610556b

@ -1,6 +1,7 @@
package cn.hippo4j.common.monitor; package cn.hippo4j.common.monitor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List; import java.util.List;
@ -11,6 +12,7 @@ import java.util.List;
* @date 2021/12/7 20:31 * @date 2021/12/7 20:31
*/ */
@Data @Data
@NoArgsConstructor
public abstract class AbstractMessage implements Message { public abstract class AbstractMessage implements Message {
/** /**
@ -21,7 +23,7 @@ public abstract class AbstractMessage implements Message {
/** /**
* messageTypeEnum * messageTypeEnum
*/ */
private MessageTypeEnum messageTypeEnum; private MessageTypeEnum messageType;
/** /**
* message * message

@ -1,12 +1,15 @@
package cn.hippo4j.common.monitor; package cn.hippo4j.common.monitor;
import java.io.Serializable;
import java.util.List;
/** /**
* Abstract message monitoring interface. * Abstract message monitoring interface.
* *
* @author chen.ma * @author chen.ma
* @date 2021/12/6 20:16 * @date 2021/12/6 20:16
*/ */
public interface Message { public interface Message extends Serializable {
/** /**
* Get groupKey. * Get groupKey.
@ -15,4 +18,18 @@ public interface Message {
*/ */
String getGroupKey(); String getGroupKey();
/**
* Get message type.
*
* @return
*/
MessageTypeEnum getMessageType();
/**
* Get messages.
*
* @return
*/
List<Message> getMessages();
} }

@ -0,0 +1,25 @@
package cn.hippo4j.common.monitor;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* Message wrapper.
*
* @author chen.ma
* @date 2021/12/7 22:42
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MessageWrapper extends AbstractMessage implements Serializable {
/**
* messageObj
*/
private Object messageObj;
}

@ -1,6 +1,7 @@
package cn.hippo4j.common.monitor; package cn.hippo4j.common.monitor;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor;
/** /**
* Dynamic thread pool runtime data. * Dynamic thread pool runtime data.
@ -9,6 +10,7 @@ import lombok.Data;
* @date 2021/12/6 18:18 * @date 2021/12/6 18:18
*/ */
@Data @Data
@NoArgsConstructor
public class RuntimeMessage extends AbstractMessage { public class RuntimeMessage extends AbstractMessage {
/** /**

Loading…
Cancel
Save