本文整理了Java中io.tracee.Utilities.generateInvocationIdIfNecessary()
方法的一些代码示例,展示了Utilities.generateInvocationIdIfNecessary()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.generateInvocationIdIfNecessary()
方法的具体详情如下:
包路径:io.tracee.Utilities
类名称:Utilities
方法名:generateInvocationIdIfNecessary
[英]Generate invocation id if it doesn't exist in TraceeBackend and configuration asks for one
[中]如果TraceeBackend中不存在调用id,并且配置要求生成调用id,则生成调用id
代码示例来源:origin: tracee/tracee
@Override
public boolean handleRequest(MessageContext messageContext, Object o) {
parseContextFromSoapHeader(messageContext.getRequest(), IncomingRequest);
Utilities.generateInvocationIdIfNecessary(backend);
return true;
}
代码示例来源:origin: tracee/tracee
@Override
public void handleMessage(Message message) {
super.handleMessage(message);
if (shouldHandleMessage(message)) {
Utilities.generateInvocationIdIfNecessary(backend);
}
}
代码示例来源:origin: tracee/tracee
@Override
public void jobToBeExecuted(JobExecutionContext context) {
final TraceeFilterConfiguration configuration = backend.getConfiguration(profile);
if (configuration.shouldProcessContext(AsyncProcess)) {
@SuppressWarnings("unchecked")
final Map<String, String> traceeContext = (Map<String, String>) context.getMergedJobDataMap().get(TraceeConstants.TPIC_HEADER);
if (traceeContext != null && !traceeContext.isEmpty()) {
final Map<String, String> filteredContext = configuration.filterDeniedParams(traceeContext, AsyncProcess);
backend.putAll(filteredContext);
}
}
Utilities.generateInvocationIdIfNecessary(backend);
}
代码示例来源:origin: tracee/tracee
private void httpRequestInitialized(final HttpServletRequest request) {
final TraceeFilterConfiguration configuration = backend.getConfiguration();
if (configuration.shouldProcessContext(IncomingRequest)) {
final Enumeration<String> headers = request.getHeaders(HTTP_HEADER_NAME);
if (headers != null && headers.hasMoreElements()) {
final Map<String, String> contextMap = transportSerialization.parse(Collections.list(headers));
backend.putAll(backend.getConfiguration().filterDeniedParams(contextMap, IncomingRequest));
}
}
Utilities.generateInvocationIdIfNecessary(backend);
final HttpSession session = request.getSession(false);
if (session != null) {
Utilities.generateSessionIdIfNecessary(backend, session.getId());
}
}
}
代码示例来源:origin: tracee/tracee
@Override
public boolean preHandle(final HttpServletRequest request, final HttpServletResponse response, final Object o) {
final TraceeFilterConfiguration configuration = backend.getConfiguration(profileName);
if (configuration.shouldProcessContext(IncomingRequest)) {
@SuppressWarnings("unchecked")
final Enumeration<String> headers = request.getHeaders(incomingHeaderName);
if (headers != null && headers.hasMoreElements()) {
final Map<String, String> parsedContext = httpHeaderSerialization.parse(Collections.list(headers));
backend.putAll(configuration.filterDeniedParams(parsedContext, IncomingResponse));
}
}
Utilities.generateInvocationIdIfNecessary(backend);
final HttpSession session = request.getSession(false);
if (session != null) {
Utilities.generateSessionIdIfNecessary(backend, session.getId());
}
// We add the current TPIC to the response. If the response is commited before we can replace the values with the current state
// the current state is on the wire. -- better than nothing :-) (See #96)
writeHeaderIfUncommitted(response);
return true;
}
代码示例来源:origin: tracee/tracee
/**
* This method handles the incoming request
*/
@Override
public void filter(final ContainerRequestContext containerRequestContext) {
if (backend.getConfiguration().shouldProcessContext(IncomingRequest)) {
final List<String> serializedTraceeHeaders = containerRequestContext.getHeaders().get(TraceeConstants.TPIC_HEADER);
if (serializedTraceeHeaders != null && !serializedTraceeHeaders.isEmpty()) {
final Map<String, String> parsed = transportSerialization.parse(serializedTraceeHeaders);
backend.putAll(backend.getConfiguration().filterDeniedParams(parsed, IncomingRequest));
}
}
Utilities.generateInvocationIdIfNecessary(backend);
}
代码示例来源:origin: tracee/tracee
@SuppressWarnings("unchecked")
public void beforeProcessing(final Message message) throws JMSException {
if (backend.getConfiguration().shouldProcessContext(AsyncProcess)) {
final String encodedTraceeContext = message.getStringProperty(TraceeConstants.TPIC_HEADER);
if (encodedTraceeContext != null) {
final Map<String, String> contextFromMessage = httpHeaderSerialization.parse(singletonList(encodedTraceeContext));
backend.putAll(backend.getConfiguration().filterDeniedParams(contextFromMessage, AsyncProcess));
}
}
Utilities.generateInvocationIdIfNecessary(backend);
}
代码示例来源:origin: tracee/tracee
/**
* Incoming messages
*/
@Override
public MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset) {
final MessageProperties messageProperties = super.toMessageProperties(source, envelope, charset);
final TraceeFilterConfiguration filterConfiguration = backend.getConfiguration(profile);
if (filterConfiguration.shouldProcessContext(AsyncProcess)) {
// Values are stored as type of LongStringHelper.ByteArrayLongString - but it's private
final Map<String, String> traceeContextMap = transformToTraceeContextMap(
(Map<String, ?>) messageProperties.getHeaders().get(TPIC_HEADER));
if (traceeContextMap != null && !traceeContextMap.isEmpty()) {
backend.putAll(filterConfiguration.filterDeniedParams(traceeContextMap, AsyncProcess));
}
}
Utilities.generateInvocationIdIfNecessary(backend);
return messageProperties;
}
代码示例来源:origin: io.tracee.binding/tracee-jaxws
protected final void handleIncoming(SOAPMessageContext context) {
final SOAPMessage soapMessage = context.getMessage();
try {
final SOAPHeader header = soapMessage.getSOAPHeader();
if (header != null && traceeBackend.getConfiguration().shouldProcessContext(IncomingRequest)) {
final Map<String, String> parsedContext = transportSerialization.parseSoapHeader(header);
final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(parsedContext, IncomingRequest);
traceeBackend.putAll(filteredContext);
}
} catch (final SOAPException e) {
logger.warn("Error during precessing of inbound soap header: {}", e.getMessage());
logger.debug("Detailed: Error during precessing of inbound soap header: {}", e.getMessage(), e);
}
Utilities.generateInvocationIdIfNecessary(traceeBackend);
}
代码示例来源:origin: tracee/tracee
protected final void handleIncoming(SOAPMessageContext context) {
final SOAPMessage soapMessage = context.getMessage();
try {
final SOAPHeader header = soapMessage.getSOAPHeader();
if (header != null && traceeBackend.getConfiguration().shouldProcessContext(IncomingRequest)) {
final Map<String, String> parsedContext = transportSerialization.parseSoapHeader(header);
final Map<String, String> filteredContext = traceeBackend.getConfiguration().filterDeniedParams(parsedContext, IncomingRequest);
traceeBackend.putAll(filteredContext);
}
} catch (final SOAPException e) {
logger.warn("Error during precessing of inbound soap header: {}", e.getMessage());
logger.debug("Detailed: Error during precessing of inbound soap header: {}", e.getMessage(), e);
}
Utilities.generateInvocationIdIfNecessary(traceeBackend);
}
内容来源于网络,如有侵权,请联系作者删除!