public abstract class AbstractMessageChannelPlugin extends Object implements MessageChannelPlugin
MessageChannelPlugin.ChannelType| Modifier and Type | Field and Description |
|---|---|
protected MessageChannelConfig |
config |
protected boolean |
healthy |
protected boolean |
initialized |
| Constructor and Description |
|---|
AbstractMessageChannelPlugin() |
| Modifier and Type | Method and Description |
|---|---|
protected MessageResult |
createFailureResult(MessageContext context,
String errorCode,
String errorMsg)
创建失败的消息结果
|
protected MessageResult |
createSuccessResult(MessageContext context,
Object responseData)
创建成功的消息结果
|
void |
destroy() |
protected abstract void |
doDestroy()
具体的销毁逻辑,子类实现
|
protected abstract void |
doInitialize(MessageChannelConfig config)
具体的初始化逻辑,子类实现
|
protected abstract MessageResult |
doSend(MessageContext context)
具体的发送逻辑,子类实现
|
protected abstract boolean |
doValidate(MessageContext context)
具体的验证逻辑,子类实现
|
void |
initialize(MessageChannelConfig config) |
boolean |
isHealthy() |
MessageResult |
send(MessageContext context) |
List<MessageResult> |
sendBatch(List<MessageContext> contexts) |
boolean |
validate(MessageContext context) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChannelCode, getChannelName, getChannelTypeprotected MessageChannelConfig config
protected volatile boolean initialized
protected volatile boolean healthy
public void initialize(MessageChannelConfig config) throws MessageException
initialize in interface MessageChannelPluginMessageExceptionpublic MessageResult send(MessageContext context) throws MessageException
send in interface MessageChannelPluginMessageExceptionpublic List<MessageResult> sendBatch(List<MessageContext> contexts) throws MessageException
sendBatch in interface MessageChannelPluginMessageExceptionpublic boolean validate(MessageContext context)
validate in interface MessageChannelPluginpublic boolean isHealthy()
isHealthy in interface MessageChannelPluginpublic void destroy()
destroy in interface MessageChannelPluginprotected abstract void doInitialize(MessageChannelConfig config) throws Exception
Exceptionprotected abstract MessageResult doSend(MessageContext context) throws Exception
Exceptionprotected abstract boolean doValidate(MessageContext context)
protected MessageResult createSuccessResult(MessageContext context, Object responseData)
protected MessageResult createFailureResult(MessageContext context, String errorCode, String errorMsg)
Copyright © 2021–2026 structure. All rights reserved.