public RecursiveReflectionToStringStyle(int maxDepth) { setUseShortClassName(true); setUseIdentityHashCode(true); this.maxDepth = maxDepth > MAX_DEPTH ? MAX_DEPTH : (maxDepth < 0 ? 0 : maxDepth); }
@SuppressWarnings("unused") @TraceeContextProviderMethod(displayName = "parameters", order = 40) public final List<String> getParameters() { if (proceedingJoinPoint != null && proceedingJoinPoint.getArgs() != null) { // output parameters final List<String> parameters = new ArrayList<String>(); for (final Object attr : proceedingJoinPoint.getArgs()) { if (attr != null && TraceeContextLoggerConstants.IGNORED_AT_DESERIALIZATION.contains(attr.getClass())) { parameters.add(attr.toString()); } else { parameters.add(attr == null ? null : ReflectionToStringBuilder.reflectionToString(attr, new RecursiveReflectionToStringStyle())); } } return parameters; } return null; }
@SuppressWarnings("unused") @TraceeContextLogProviderMethod( displayName = "parameters", propertyName = ProfilePropertyNames.ASPECTJ_PROCEEDING_JOIN_POINT_PARAMETERS, order = 40) public final List<String> getParameters() { if (proceedingJoinPoint != null && proceedingJoinPoint.getArgs() != null) { // output parameters final List<String> parameters = new ArrayList<String>(); for (final Object attr : proceedingJoinPoint.getArgs()) { if (TraceeContextLoggerConstants.IGNORED_AT_DESERIALIZATION.contains(attr.getClass())) { parameters.add(attr == null ? null : attr.toString()); } else { parameters.add(attr == null ? null : ReflectionToStringBuilder.reflectionToString(attr, new RecursiveReflectionToStringStyle())); } } return parameters; } return null; }
@SuppressWarnings("unused") @TraceeContextProviderMethod(displayName = "serialized-target-instance", order = 50) public final String getSerializedTargetInstance() { if (proceedingJoinPoint != null) { // output invoked instance String deSerializedInstance; Object targetInstance = proceedingJoinPoint.getTarget(); if (targetInstance != null) { deSerializedInstance = ReflectionToStringBuilder.reflectionToString(targetInstance, new RecursiveReflectionToStringStyle()); } else { deSerializedInstance = null; } return deSerializedInstance; } return null; }
public RecursiveReflectionToStringStyle(int maxDepth) { setUseShortClassName(true); setUseIdentityHashCode(true); this.maxDepth = maxDepth > MAX_DEPTH ? MAX_DEPTH : (maxDepth < 0 ? 0 : maxDepth); }
@SuppressWarnings("unused") @TraceeContextLogProviderMethod( displayName = "deserialized-instance", propertyName = ProfilePropertyNames.ASPECTJ_PROCEEDING_JOIN_POINT_DESERIALIZED_INSTANCE, order = 50) public final String getDeserializedInstance() { if (proceedingJoinPoint != null) { // output invoked instance String deSerializedInstance; Object targetInstance = proceedingJoinPoint.getTarget(); if (targetInstance != null) { deSerializedInstance = ReflectionToStringBuilder.reflectionToString(targetInstance, new RecursiveReflectionToStringStyle()); } else { deSerializedInstance = null; } return deSerializedInstance; } return null; }
@TraceeContextProviderMethod(displayName = "deserialized.contextData", order = 40) public final List<NameStringValuePair> getContextData() { List<NameStringValuePair> result = new ArrayList<NameStringValuePair>(); if (this.invocationContext != null) { for (Map.Entry<String, Object> entry : this.invocationContext.getContextData().entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); final String deSerializedValue; if (value != null) { deSerializedValue = ReflectionToStringBuilder.reflectionToString(value, new RecursiveReflectionToStringStyle()); } else { deSerializedValue = null; } result.add(new NameStringValuePair(key, deSerializedValue)); } } return result.size() > 0 ? result : null; }
@TraceeContextLogProviderMethod(displayName = "deserialized.contextData", propertyName = ProfilePropertyNames.EJB_INVOCATION_CONTEXT_DATA, order = 40) public final List<NameStringValuePair> getContextData() { List<NameStringValuePair> result = new ArrayList<NameStringValuePair>(); if (this.invocationContext != null) { for (Map.Entry<String, Object> entry : this.invocationContext.getContextData().entrySet()) { String key = entry.getKey(); Object value = entry.getValue(); final String deSerializedValue; if (value != null) { deSerializedValue = ReflectionToStringBuilder.reflectionToString(value, new RecursiveReflectionToStringStyle()); } else { deSerializedValue = null; } result.add(new NameStringValuePair(key, deSerializedValue)); } } return result.size() > 0 ? result : null; }
@TraceeContextLogProviderMethod(displayName = "deserialized.targetInstance", propertyName = ProfilePropertyNames.EJB_INVOCATION_CONTEXT_TARGET_INSTANCE, order = 30) public final String getTargetInstance() { String result = null; if (this.invocationContext != null) { Object targetInstance = this.invocationContext.getTarget(); if (targetInstance != null) { result = ReflectionToStringBuilder.reflectionToString(targetInstance, new RecursiveReflectionToStringStyle()); } else { result = null; } } return result; }
@TraceeContextProviderMethod(displayName = "serialized-target-instance", order = 30) public final String getSerializedTargetInstance() { String result = null; if (this.invocationContext != null) { Object targetInstance = this.invocationContext.getTarget(); if (targetInstance != null) { result = ReflectionToStringBuilder.reflectionToString(targetInstance, new RecursiveReflectionToStringStyle()); } else { result = null; } } return result; }
/** * selects the best macthing serialization depending on value type. * * @param nameObjectValuePair * @return */ private Object getValueOfNameObjectValuePair(final NameObjectValuePair nameObjectValuePair) { if (nameObjectValuePair != null && nameObjectValuePair.getValue() != null) { if (TraceeContextLogAnnotationUtilities.getAnnotationFromType(nameObjectValuePair.getValue()) != null) { return nameObjectValuePair.getValue(); } else if (!shouldBeIgnoreAtDeSerialization(nameObjectValuePair.getValue())) { return ReflectionToStringBuilder.reflectionToString(nameObjectValuePair.getValue(), new RecursiveReflectionToStringStyle()); } else { // not null value - but type is in IGNORED_AT_DESERIALIZATION set return nameObjectValuePair.getValue().toString(); } } else { return null; } }
/** * selects the best macthing serialization depending on value type. * * @param nameObjectValuePair * @return */ private Object getValueOfNameObjectValuePair(final NameObjectValuePair nameObjectValuePair) { if (nameObjectValuePair != null && nameObjectValuePair.getValue() != null) { if (TraceeContextLogAnnotationUtilities.getAnnotationFromType(nameObjectValuePair.getValue()) != null) { return nameObjectValuePair.getValue(); } else if (!shouldBeIgnoreAtDeSerialization(nameObjectValuePair.getValue())) { return ReflectionToStringBuilder.reflectionToString(nameObjectValuePair.getValue(), new RecursiveReflectionToStringStyle()); } else { // not null value - but type is in IGNORED_AT_DESERIALIZATION set return nameObjectValuePair.getValue().toString(); } } else { return null; } }