本文整理了Java中org.tinygroup.event.Event.getEventId()
方法的一些代码示例,展示了Event.getEventId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getEventId()
方法的具体详情如下:
包路径:org.tinygroup.event.Event
类名称:Event
方法名:getEventId
暂无
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcorenettysc
protected void processObject(Object message, ChannelHandlerContext ctx) {
Event event = (Event) message;
// 更新事件
String eventId = event.getEventId();
EventClient eventClient = (EventClient) client;
Event oldEvent = eventClient.getEvent(eventId);
if (oldEvent != null) {// 如果事件已经不再存在,则直接忽略
String oldEventId = oldEvent.getEventId();
synchronized (oldEventId) {
eventClient.updateEvent(oldEventId, event);
// 提醒事件完成
oldEventId.notify();
}
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
/**
* 向目标服务端发送Event
* @param event
* @return
*/
public Event sentEvent(Event event) {
writeEvent(event);
return ResponseManager.getResponse(event.getEventId());
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
/**
* 向目标服务端发送Event
* @param event
* @return
*/
public Event sentEvent(Event event) {
writeEvent(event);
return ResponseManager.getResponse(event.getEventId());
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
private void writeEvent(Event event) {
ResponseManager.putIfAbsent(event.getEventId());
write(event);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
private void writeEvent(Event event) {
ResponseManager.putIfAbsent(event.getEventId());
write(event);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcorebase
private void putThreadVariable(Event event) {
ServiceRequest request = event.getServiceRequest();
LoggerFactory.putThreadVariable(LoggerFactory.SERVICE_EVENTID, event.getEventId());
LoggerFactory.putThreadVariable(LoggerFactory.SERVICE_SERVICEID, request.getServiceId());
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
protected void processResult(Object response, ChannelHandlerContext ctx)
throws Exception {
Event event = (Event) response;
String eventId = event.getEventId();
logger.logMessage(LogLevel.INFO, "接收到Event:{0}的请求响应,请求id:{1}", eventId,
event.getServiceRequest().getServiceId());
ResponseManager.updateResponse(eventId, event);
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcorenettysc
private Event getAsynchronousResponseEvent(Event event) {
Event response = new Event();
response.setEventId(event.getEventId());
response.setMode(Event.EVENT_MODE_ASYNCHRONOUS);
response.setType(Event.EVENT_TYPE_RESPONSE);
return response;
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcorenettysc
public void run(Event event) {
ChannelHandlerContext channelHandlerContext = channelHandlerContextMap
.get(event.getEventId());
core.process(event);
channelHandlerContext = channelHandlerContextMap.get(event
.getEventId());
if (event.getMode() == Event.EVENT_MODE_SYNCHRONOUS) {
if (channelHandlerContext != null) {
clearRequest(event.getEventId());
代码示例来源:origin: org.tinygroup/org.tinygroup.nettyremote
public void write(Object o) {
if (o instanceof Event) {
Event event = (Event) o;
LOGGER.logMessage(LogLevel.DEBUG, "写出消息为:eventId:{},serviceId:{}", event.getEventId(),
event.getServiceRequest().getServiceId());
}
if (future == null || future.channel() == null) {
throw new RuntimeException("连接尚未就绪");
}
if (!future.channel().isActive()) {
throw new RuntimeException("连接未就绪或者已经被关闭");
}
ChannelFuture f = future.channel().writeAndFlush(o);
if (f instanceof ChannelPromise) {
ChannelPromise p = (ChannelPromise) f;
try {
p.await();
} catch (InterruptedException e) {
LOGGER.logMessage(LogLevel.WARN, "等待消息写出被中断");
} finally {
FastThreadLocal.removeAll();
}
if (p.isSuccess()) {
LOGGER.logMessage(LogLevel.DEBUG, "消息写出状态:{}", p.isSuccess());
} else {
LOGGER.logMessage(LogLevel.WARN, "消息写出状态:false");
throw new RuntimeException(p.cause());
}
}
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcorenettysc
String eventId = event.getEventId();
代码示例来源:origin: org.tinygroup/org.tinygroup.servicehttpchannel
public void process(Event event) {
if (serverPath == null) {
throw new RuntimeException("服务器地址路径未配置");
}
String serviceId = event.getServiceRequest().getServiceId();
String url = serverPath + serviceId + ".mockservice";
Event result = execute(event, url);
Throwable throwable = result.getThrowable();
if (throwable != null) {// 如果有异常发生,则抛出异常
LOGGER.errorMessage("服务执行发生异常,serviceId:{},eventId:{}", throwable,
result.getServiceRequest().getServiceId(),
result.getEventId());
if (throwable instanceof RuntimeException) {
throw (RuntimeException) throwable;
} else {
throw new RuntimeException(throwable);// 此处的RuntimeException类型需要调整
}
}
event.getServiceRequest()
.getContext()
.putSubContext(result.getEventId(),
result.getServiceRequest().getContext());
}
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
ResponseManager.updateResponse(event.getEventId(), event);
} else if (CEPCoreEventHandler.NODE_REG_TO_SC_REQUEST.equals(serviceId)
ResponseManager.updateResponse(event.getEventId(), event);
} else if (CEPCoreEventHandler.SC_REG_NODE_TO_NODE_REQUEST
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcorenettysc
protected void processObject(Object message, ChannelHandlerContext ctx) {
String eventId = event.getEventId();
eventMap.put(eventId, event);
channelHandlerContextMap.put(eventId, ctx);
clearRequest(event.getEventId());
event.setType(Event.EVENT_TYPE_RESPONSE);
ctx.getChannel().write(event);
clearRequest(event.getEventId());
event.setType(Event.EVENT_TYPE_RESPONSE);
ctx.getChannel().write(event);
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
String eventId = event.getEventId();
String serviceId = event.getServiceRequest().getServiceId();
if (event.getMode() == Event.EVENT_MODE_ASYNCHRONOUS) {
代码示例来源:origin: org.tinygroup/org.tinygroup.servicehttpchannel
Response r = p.execute();
String serviceId = event.getServiceRequest().getServiceId();
String eventId = event.getEventId();
try {
int iGetResultCode = r.getStatusLine().getStatusCode();
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcorenettysc
event.getServiceRequest()
.getContext()
.putSubContext(newEvent.getEventId(),
newEvent.getServiceRequest().getContext());
代码示例来源:origin: org.tinygroup/org.tinygroup.cepcoremutiremoteimpl
event.getServiceRequest()
.getContext()
.putSubContext(newEvent.getEventId(),
newEvent.getServiceRequest().getContext());
内容来源于网络,如有侵权,请联系作者删除!