本文整理了Java中org.apache.qpid.proton.engine.Transport.process()
方法的一些代码示例,展示了Transport.process()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Transport.process()
方法的具体详情如下:
包路径:org.apache.qpid.proton.engine.Transport
类名称:Transport
方法名:process
[英]Tell the transport to process the data written to the input buffer. If the returned result indicates failure, the transport will not accept any more input. Specifically, any subsequent #processInput() calls on this object will throw an exception.
[中]告诉传输处理写入输入缓冲区的数据。如果返回的结果表明失败,传输将不再接受任何输入。具体来说,对该对象的任何后续#processInput()调用都会引发异常。
代码示例来源:origin: org.apache.activemq/artemis-amqp-protocol
public void flush() {
lock.lock();
try {
transport.process();
} finally {
lock.unlock();
}
dispatch();
}
代码示例来源:origin: org.apache.activemq/artemis-proton-plug
@Override
public void flush() {
synchronized (lock) {
transport.process();
checkServerSASL();
}
dispatchExecutor.execute(dispatchRunnable);
}
代码示例来源:origin: apache/activemq-artemis
public void flush() {
if (workerExecutor.inEventLoop()) {
transport.process();
dispatch();
} else {
runLater(() -> {
transport.process();
dispatch();
});
}
}
代码示例来源:origin: com.ibm.mqlight/mqlight-api
@Override
public void run() {
final String methodName = "run";
logger.entry(this, methodName);
transport.process();
transport.tick(System.currentTimeMillis());
logger.exit(methodName);
}
};
代码示例来源:origin: io.vertx/vertx-proton
private void pumpInbound(Buffer buffer) {
if (failed) {
LOG.trace("Skipping processing of data following transport error: {0}", buffer);
return;
}
// Lets push bytes from vert.x to proton engine.
try {
ByteBuf data = buffer.getByteBuf();
do {
ByteBuffer transportBuffer = transport.tail();
int amount = Math.min(transportBuffer.remaining(), data.readableBytes());
transportBuffer.limit(transportBuffer.position() + amount);
data.readBytes(transportBuffer);
transport.process();
} while (data.isReadable());
} catch (Exception te) {
failed = true;
LOG.trace("Exception while processing transport input", te);
}
}
代码示例来源:origin: apache/qpid-jms
@Override
public void onData(final ByteBuf input) {
try {
if (isTraceBytes()) {
TRACE_BYTES.info("Received: {}", ByteBufUtil.hexDump(input));
}
do {
ByteBuffer buffer = protonTransport.tail();
int chunkSize = Math.min(buffer.remaining(), input.readableBytes());
buffer.limit(buffer.position() + chunkSize);
input.readBytes(buffer);
protonTransport.process();
} while (input.isReadable());
// Process the state changes from the latest data and then answer back
// any pending updates to the Broker.
processUpdates();
pumpToProtonTransport();
} catch (Throwable t) {
LOG.warn("Caught problem during data processing: {}", t.getMessage(), t);
fireProviderException(t);
}
}
代码示例来源:origin: org.apache.qpid/qpid-jms-client
@Override
public void onData(final ByteBuf input) {
try {
if (isTraceBytes()) {
TRACE_BYTES.info("Received: {}", ByteBufUtil.hexDump(input));
}
do {
ByteBuffer buffer = protonTransport.tail();
int chunkSize = Math.min(buffer.remaining(), input.readableBytes());
buffer.limit(buffer.position() + chunkSize);
input.readBytes(buffer);
protonTransport.process();
} while (input.isReadable());
// Process the state changes from the latest data and then answer back
// any pending updates to the Broker.
processUpdates();
pumpToProtonTransport();
} catch (Throwable t) {
LOG.warn("Caught problem during data processing: {}", t.getMessage(), t);
fireProviderException(t);
}
}
代码示例来源:origin: org.apache.qpid/proton-j-impl
_inputDone = true;
} else if (bytesRead > 0) {
_transport.process();
processed = true;
代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot
} else if (bytesRead > 0) {
try {
_transport.process();
} catch (TransportException e) {
_logger.log(Level.SEVERE, this + " error processing input", e);
代码示例来源:origin: org.apache.qpid/proton-j
@Override
public void run(Selectable selectable) {
Reactor reactor = selectable.getReactor();
Transport transport = ((SelectableImpl)selectable).getTransport();
int capacity = transport.capacity();
if (capacity > 0) {
SocketChannel socketChannel = (SocketChannel)selectable.getChannel();
try {
int n = socketChannel.read(transport.tail());
if (n == -1) {
transport.close_tail();
} else {
transport.process();
}
} catch (IOException | TransportException e) {
ErrorCondition condition = new ErrorCondition();
condition.setCondition(Symbol.getSymbol("proton:io"));
condition.setDescription(e.getMessage());
transport.setCondition(condition);
transport.close_tail();
}
}
// (Comment from C code:) occasionally transport events aren't
// generated when expected, so the following hack ensures we
// always update the selector
update(selectable);
reactor.update(selectable);
}
};
代码示例来源:origin: com.microsoft.azure.iot/proton-j-azure-iot
@Override
public void run(Selectable selectable) {
Reactor reactor = selectable.getReactor();
Transport transport = ((SelectableImpl)selectable).getTransport();
int capacity = transport.capacity();
if (capacity > 0) {
SocketChannel socketChannel = (SocketChannel)selectable.getChannel();
try {
int n = socketChannel.read(transport.tail());
if (n == -1) {
transport.close_tail();
} else {
transport.process();
}
} catch (IOException e) {
ErrorCondition condition = new ErrorCondition();
condition.setCondition(Symbol.getSymbol("proton:io"));
condition.setDescription(e.getMessage());
transport.setCondition(condition);
transport.close_tail();
}
}
// (Comment from C code:) occasionally transport events aren't
// generated when expected, so the following hack ensures we
// always update the selector
update(selectable);
reactor.update(selectable);
}
};
代码示例来源:origin: com.ibm.mqlight/mqlight-api
engineConnection.transport.process();
process(engineConnection.collector);
内容来源于网络,如有侵权,请联系作者删除!