本文整理汇总了Java中org.apache.activemq.artemis.api.core.ActiveMQException.initCause方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQException.initCause方法的具体用法?Java ActiveMQException.initCause怎么用?Java ActiveMQException.initCause使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.artemis.api.core.ActiveMQException
的用法示例。
在下文中一共展示了ActiveMQException.initCause方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: exceptionCaught
import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) throws Exception {
if (!active) {
return;
}
// We don't want to log this - since it is normal for this to happen during failover/reconnect
// and we don't want to spew out stack traces in that event
// The user has access to this exeception anyway via the ActiveMQException initial cause
ActiveMQException me = ActiveMQClientMessageBundle.BUNDLE.nettyError();
me.initCause(cause);
synchronized (listener) {
try {
listener.connectionException(channelId(ctx.channel()), me);
active = false;
} catch (Exception ex) {
ActiveMQClientLogger.LOGGER.errorCallingLifeCycleListener(ex);
}
}
}
示例2: onCatchThrowableWhileHandlePacket
import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
private static Packet onCatchThrowableWhileHandlePacket(Throwable t,
boolean requiresResponse,
Packet response,
ServerSession session) {
session.markTXFailed(t);
if (requiresResponse) {
ActiveMQServerLogger.LOGGER.sendingUnexpectedExceptionToClient(t);
ActiveMQException activeMQInternalErrorException = new ActiveMQInternalErrorException();
activeMQInternalErrorException.initCause(t);
response = new ActiveMQExceptionMessage(activeMQInternalErrorException);
} else {
ActiveMQServerLogger.LOGGER.caughtException(t);
}
return response;
}
示例3: markTXFailed
import org.apache.activemq.artemis.api.core.ActiveMQException; //导入方法依赖的package包/类
@Override
public void markTXFailed(Throwable e) {
Transaction currentTX = this.tx;
if (currentTX != null) {
if (e instanceof ActiveMQException) {
currentTX.markAsRollbackOnly((ActiveMQException) e);
} else {
ActiveMQException exception = new ActiveMQException(e.getMessage());
exception.initCause(e);
currentTX.markAsRollbackOnly(exception);
}
}
}