当前位置: 首页>>代码示例>>Java>>正文


Java MessageOutputStream类代码示例

本文整理汇总了Java中org.jboss.remoting3.MessageOutputStream的典型用法代码示例。如果您正苦于以下问题:Java MessageOutputStream类的具体用法?Java MessageOutputStream怎么用?Java MessageOutputStream使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MessageOutputStream类属于org.jboss.remoting3包,在下文中一共展示了MessageOutputStream类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleReport

import org.jboss.remoting3.MessageOutputStream; //导入依赖的package包/类
@Override
public void handleReport(final MessageSeverity severity, final String message) {
    if(true) {
        return;
    }
    try {
        // We don't expect any response, so just write the message
        final MessageOutputStream os = channelAssociation.getChannel().writeMessage();
        try {
            final FlushableDataOutput output = ProtocolUtils.wrapAsDataOutput(os);
            final ManagementRequestHeader header = new ManagementRequestHeader(ManagementProtocol.VERSION, -1, batchId, ModelControllerProtocol.HANDLE_REPORT_REQUEST);
            header.write(output);
            output.write(ModelControllerProtocol.PARAM_MESSAGE_SEVERITY);
            output.writeUTF(severity.toString());
            output.write(ModelControllerProtocol.PARAM_MESSAGE);
            output.writeUTF(message);
            output.writeByte(ManagementProtocol.REQUEST_END);
            output.close();
        } finally {
            StreamUtils.safeClose(os);
        }
    } catch (Exception e) {
        ControllerLogger.MGMT_OP_LOGGER.error(e.getLocalizedMessage(),e);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:OperationMessageHandlerProxy.java

示例2: handlePing

import org.jboss.remoting3.MessageOutputStream; //导入依赖的package包/类
/**
 * Handle a simple ping request.
 *
 * @param channel the channel
 * @param header the protocol header
 * @throws IOException for any error
 */
private static void handlePing(final Channel channel, final ManagementProtocolHeader header) throws IOException {
    final ManagementProtocolHeader response = new ManagementPongHeader(header.getVersion());
    final MessageOutputStream output = channel.writeMessage();
    try {
        writeHeader(response, output);
        output.close();
    } finally {
        StreamUtils.safeClose(output);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:18,代码来源:ManagementChannelReceiver.java

示例3: writeErrorResponse

import org.jboss.remoting3.MessageOutputStream; //导入依赖的package包/类
/**
 * Write an error response.
 *
 * @param channel the channel
 * @param header the request
 * @param error the error
 * @throws IOException
 */
protected static void writeErrorResponse(final Channel channel, final ManagementRequestHeader header, final Throwable error) throws IOException {
    final ManagementResponseHeader response = ManagementResponseHeader.create(header, error);
    final MessageOutputStream output = channel.writeMessage();
    try {
        writeHeader(response, output);
        output.close();
    } finally {
        StreamUtils.safeClose(output);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:19,代码来源:AbstractMessageHandler.java

示例4: writeResponse

import org.jboss.remoting3.MessageOutputStream; //导入依赖的package包/类
protected static void writeResponse(final Channel channel, final ManagementRequestHeader header, final Exception error) throws IOException {
    final ManagementResponseHeader response = ManagementResponseHeader.create(header, error);
    final MessageOutputStream output = channel.writeMessage();
    try {
        writeHeader(response, output);
        output.write(ManagementProtocol.RESPONSE_END);
        output.close();
    } finally {
        StreamUtils.safeClose(output);
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:12,代码来源:ServerToHostProtocolHandler.java

示例5: writeMessage

import org.jboss.remoting3.MessageOutputStream; //导入依赖的package包/类
@Override
public FlushableDataOutput writeMessage(final ManagementProtocolHeader header) throws IOException {
    final MessageOutputStream os = channel.writeMessage();
    return AbstractMessageHandler.writeHeader(header, os);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:6,代码来源:ManagementRequestContextImpl.java


注:本文中的org.jboss.remoting3.MessageOutputStream类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。