code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
@Override
public void write(byte[] b, int off, int len) throws IOException {
content.write(b, off, len);
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | Apache-2.0 |
@Override
public boolean isReady() {
return this.os.isReady();
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | isReady | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | Apache-2.0 |
@Override
public void setWriteListener(WriteListener writeListener) {
this.os.setWriteListener(writeListener);
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | setWriteListener | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | Apache-2.0 |
@Override
public void write(char[] buf, int off, int len) {
super.write(buf, off, len);
super.flush();
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | Apache-2.0 |
@Override
public void write(String s, int off, int len) {
super.write(s, off, len);
super.flush();
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | Apache-2.0 |
@Override
public void write(int c) {
super.write(c);
super.flush();
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV3.java | Apache-2.0 |
@Override
public void sendError(int sc) throws IOException {
copyBodyToResponse(false);
try {
super.sendError(sc);
} catch (IllegalStateException ex) {
// Possibly on Tomcat when called too late: fall back to silent setStatus
super.setStatus(sc);
}... | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | sendError | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
@SuppressWarnings("deprecation")
public void sendError(int sc, String msg) throws IOException {
copyBodyToResponse(false);
try {
super.sendError(sc, msg);
} catch (IllegalStateException ex) {
// Possibly on Tomcat when called too late: fall back to silen... | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | sendError | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void sendRedirect(String location) throws IOException {
ArexContext context = ContextManager.currentContext();
if (context != null) {
location = ServletUtil.appendUri(location, ArexConstants.RECORD_ID, context.getCaseId());
}
copyBodyToResponse(false);
... | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | sendRedirect | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public ServletOutputStream getOutputStream() throws IOException {
if (this.outputStream == null) {
this.outputStream = new ResponseServletOutputStream(getResponse().getOutputStream());
}
return this.outputStream;
} | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | getOutputStream | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public PrintWriter getWriter() throws IOException {
if (this.writer == null) {
String characterEncoding = getCharacterEncoding();
this.writer = (characterEncoding != null ?
new ResponsePrintWriter(characterEncoding) :
new ResponsePrintWriter(... | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | getWriter | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void flushBuffer() throws IOException {
// do not flush the underlying response as the content has not been copied to it yet
} | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | flushBuffer | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void setContentLength(int len) {
if (len > this.content.size()) {
this.content.resize(len);
}
this.contentLength = len;
} | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | setContentLength | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void setContentLengthLong(long len) {
if (len > Integer.MAX_VALUE) {
throw new IllegalArgumentException(
"Content-Length exceeds CachedBodyResponseWrapper's maximum (" + Integer.MAX_VALUE + "): " + len);
}
int lenInt = (int) len;
if (lenIn... | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | setContentLengthLong | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void setBufferSize(int size) {
if (size > this.content.size()) {
this.content.resize(size);
}
} | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | setBufferSize | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void resetBuffer() {
this.content.reset();
} | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | resetBuffer | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void reset() {
super.reset();
this.content.reset();
} | Create a new CachedBodyResponseWrapper for the given servlet response.
@param response the original servlet response | reset | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Deprecated
public int getStatusCode() {
return getStatus();
} | Return the status code as specified on the response.
@deprecated as of 5.2 in favor of {@link javax.servlet.http.HttpServletResponse#getStatus()} | getStatusCode | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
public byte[] getContentAsByteArray() {
return this.content.toByteArray();
} | Return the cached response content as a byte array. | getContentAsByteArray | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
public InputStream getContentInputStream() {
return this.content.getInputStream();
} | Return an {@link InputStream} to the cached content.
@since 4.2 | getContentInputStream | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
public int getContentSize() {
return this.content.size();
} | Return the current size of the cached content.
@since 4.2 | getContentSize | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
protected void copyBodyToResponse(boolean complete) throws IOException {
if (this.content.size() > 0) {
HttpServletResponse rawResponse = (HttpServletResponse) getResponse();
if ((complete || this.contentLength != null) && !rawResponse.isCommitted()) {
if (rawResponse.get... | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | copyBodyToResponse | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void write(int b) throws IOException {
content.write(b);
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void write(byte[] b, int off, int len) throws IOException {
content.write(b, off, len);
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public boolean isReady() {
return this.os.isReady();
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | isReady | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void setWriteListener(WriteListener writeListener) {
this.os.setWriteListener(writeListener);
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | setWriteListener | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void write(char[] buf, int off, int len) {
super.write(buf, off, len);
super.flush();
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void write(String s, int off, int len) {
super.write(s, off, len);
super.flush();
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public void write(int c) {
super.write(c);
super.flush();
} | Copy the cached body content to the response.
@param complete whether to set a corresponding content length
for the complete cached body content
@since 4.2 | write | java | arextest/arex-agent-java | arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation/servlet/arex-httpservlet/src/main/java/io/arex/inst/httpservlet/wrapper/CachedBodyResponseWrapperV5.java | Apache-2.0 |
@Override
public boolean matches(ClassLoader cl) {
if (cl == null) {
return false;
}
return cache.computeIfAbsent(cl, this::hasResources);
} | Don't use static final, because each matcher instance has a copy of CACHE | matches | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/extension/matcher/HasClassNameMatcher.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/extension/matcher/HasClassNameMatcher.java | Apache-2.0 |
private boolean hasResources(ClassLoader cl) {
return cl.getResource(className) != null;
} | Don't use static final, because each matcher instance has a copy of CACHE | hasResources | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/extension/matcher/HasClassNameMatcher.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/extension/matcher/HasClassNameMatcher.java | Apache-2.0 |
@Override
public boolean matches(ClassLoader cl) {
if (cl == null) {
return false;
}
return description == null || cache.computeIfAbsent(cl, this::versionMatches);
} | Don't use static final, because each matcher instance has a copy of CACHE | matches | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/extension/matcher/ModuleVersionMatcher.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/extension/matcher/ModuleVersionMatcher.java | Apache-2.0 |
private boolean versionMatches(ClassLoader loader) {
ResourceManager.registerResources(loader);
String version;
for (String moduleName : description.getModuleNames()) {
version = LoadedModuleCache.get(moduleName);
if (version != null) {
return description.... | Don't use static final, because each matcher instance has a copy of CACHE | versionMatches | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/extension/matcher/ModuleVersionMatcher.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/extension/matcher/ModuleVersionMatcher.java | Apache-2.0 |
private void buildCoveragePackages(Map<String, String> properties) {
String configCoveragePackages = properties.get(ConfigConstants.COVERAGE_PACKAGES);
if (StringUtil.isNotEmpty(configCoveragePackages)) {
this.coveragePackages.addAll(StringUtil.splitToSet(configCoveragePackages, SEPARATOR));... | only no config coverage package, the coverage package is set to spring scan base packages | buildCoveragePackages | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
private Set<String> buildExcludeServiceOperations(Set<String> excludeServiceOperations) {
if (excludeServiceOperations == null) {
return Collections.emptySet();
}
Set<String> excludeServiceOperationSet = new ConcurrentHashSet<>();
excludeServiceOperationSet.addAll(excludeServ... | only no config coverage package, the coverage package is set to spring scan base packages | buildExcludeServiceOperations | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
private void buildDynamicClassInfo() {
if (dynamicClassList == null) {
this.dynamicClassSignatureMap = Collections.emptyMap();
this.dynamicAbstractClassList = StringUtil.EMPTY_STRING_ARRAY;
return;
}
Map<String, DynamicClassEntity> map = new HashMap<>(dynamic... | only no config coverage package, the coverage package is set to spring scan base packages | buildDynamicClassInfo | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public Map<String, String> getMockerTags() {
return mockerTags;
} | only no config coverage package, the coverage package is set to spring scan base packages | getMockerTags | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public Set<String> getCoveragePackages() {
return coveragePackages;
} | only no config coverage package, the coverage package is set to spring scan base packages | getCoveragePackages | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public String getRecordVersion() {
return recordVersion;
} | only no config coverage package, the coverage package is set to spring scan base packages | getRecordVersion | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public DynamicClassEntity getDynamicEntity(String methodSignature) {
return dynamicClassSignatureMap.get(methodSignature);
} | only no config coverage package, the coverage package is set to spring scan base packages | getDynamicEntity | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public Map<String, DynamicClassEntity> getDynamicClassSignatureMap() {
return dynamicClassSignatureMap;
} | only no config coverage package, the coverage package is set to spring scan base packages | getDynamicClassSignatureMap | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public String[] getDynamicAbstractClassList() {
return dynamicAbstractClassList;
} | only no config coverage package, the coverage package is set to spring scan base packages | getDynamicAbstractClassList | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public boolean isEnableDebug() {
return this.enableDebug;
} | only no config coverage package, the coverage package is set to spring scan base packages | isEnableDebug | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public List<DynamicClassEntity> getDynamicClassList() {
return this.dynamicClassList;
} | only no config coverage package, the coverage package is set to spring scan base packages | getDynamicClassList | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public Set<String> excludeServiceOperations() {
return this.excludeServiceOperations;
} | only no config coverage package, the coverage package is set to spring scan base packages | excludeServiceOperations | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public String getServiceName() {
return this.serviceName;
} | only no config coverage package, the coverage package is set to spring scan base packages | getServiceName | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public String getString(String name) {
return getString(name, null);
} | only no config coverage package, the coverage package is set to spring scan base packages | getString | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public String getString(String name, String defaultValue) {
return getRawProperty(name, defaultValue);
} | only no config coverage package, the coverage package is set to spring scan base packages | getString | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public boolean getBoolean(String name, boolean defaultValue) {
return safeGetTypedProperty(name, Boolean::parseBoolean, defaultValue);
} | only no config coverage package, the coverage package is set to spring scan base packages | getBoolean | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public int getInt(String name, int defaultValue) {
return safeGetTypedProperty(name, Integer::parseInt, defaultValue);
} | only no config coverage package, the coverage package is set to spring scan base packages | getInt | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public long getLong(String name, long defaultValue) {
return safeGetTypedProperty(name, Long::parseLong, defaultValue);
} | only no config coverage package, the coverage package is set to spring scan base packages | getLong | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public double getDouble(String name, double defaultValue) {
return safeGetTypedProperty(name, Double::parseDouble, defaultValue);
} | only no config coverage package, the coverage package is set to spring scan base packages | getDouble | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
private <T> T safeGetTypedProperty(String name, Function<String, T> parser, T defaultValue) {
try {
T value = getTypedProperty(name, parser);
return value == null ? defaultValue : value;
} catch (RuntimeException t) {
return defaultValue;
}
} | only no config coverage package, the coverage package is set to spring scan base packages | safeGetTypedProperty | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
private <T> T getTypedProperty(String name, Function<String, T> parser) {
String value = getRawProperty(name, null);
if (value == null || value.trim().isEmpty()) {
return null;
}
return parser.apply(value);
} | only no config coverage package, the coverage package is set to spring scan base packages | getTypedProperty | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
private String getRawProperty(String name, String defaultValue) {
return this.properties.getOrDefault(name, defaultValue);
} | only no config coverage package, the coverage package is set to spring scan base packages | getRawProperty | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public int getDubboStreamReplayThreshold() {
return dubboStreamReplayThreshold;
} | only no config coverage package, the coverage package is set to spring scan base packages | getDubboStreamReplayThreshold | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public int getRecordRate() {
return recordRate;
} | only no config coverage package, the coverage package is set to spring scan base packages | getRecordRate | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public Set<String> getIncludeServiceOperations() {
return includeServiceOperations;
} | only no config coverage package, the coverage package is set to spring scan base packages | getIncludeServiceOperations | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
public boolean isLocalStorage() {
return STORAGE_MODE.equalsIgnoreCase(getString(STORAGE_SERVICE_MODE));
} | only no config coverage package, the coverage package is set to spring scan base packages | isLocalStorage | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/Config.java | Apache-2.0 |
private void buildSkipInfos(String configSkipInfo) {
if (StringUtil.isEmpty(configSkipInfo) || !StringUtil.containsIgnoreCase(configSkipInfo, "{")) {
return;
}
configSkipInfo = configSkipInfo.substring(1, configSkipInfo.length() - 1);
// Split the string into individual obje... | @param configSkipInfo ex: [{"fullClassName":"testClassName","fieldName":"testFieldName"}] | buildSkipInfos | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/listener/SerializeSkipInfoListener.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/listener/SerializeSkipInfoListener.java | Apache-2.0 |
public static boolean isSkipField(String className, String fieldName) {
String fieldNames = SKIP_INFO_MAP.get(className);
if (fieldNames == null) {
return false;
}
if (fieldNames.isEmpty()) {
return true;
}
return fieldNames.contains(fieldName);
... | @param configSkipInfo ex: [{"fullClassName":"testClassName","fieldName":"testFieldName"}] | isSkipField | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/listener/SerializeSkipInfoListener.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/config/listener/SerializeSkipInfoListener.java | Apache-2.0 |
public static ArexContext currentContext(boolean createIfAbsent, String recordId) {
String traceId = TraceContextManager.get(createIfAbsent);
if (StringUtil.isEmpty(traceId)) {
return null;
}
if (createIfAbsent) {
final ArexContext arexContext = createContext(reco... | agent will call this method
record scene: recordId is map key
replay scene: replayId is map key | currentContext | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/ContextManager.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/ContextManager.java | Apache-2.0 |
@Override
public ArexContext get(Object key) {
if (key == null) {
return null;
}
return super.get(key);
} | Only used for ContextManager <br/>
delayed clean context in asynchronous situations,
the purpose is to ensure that the context can also be obtained during recording in async threads | get | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/LatencyContextHashMap.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/LatencyContextHashMap.java | Apache-2.0 |
@Override
public ArexContext remove(Object key) {
if (key == null) {
return null;
}
overdueCleanUp();
return super.get(key);
} | Only used for ContextManager <br/>
delayed clean context in asynchronous situations,
the purpose is to ensure that the context can also be obtained during recording in async threads | remove | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/LatencyContextHashMap.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/LatencyContextHashMap.java | Apache-2.0 |
private void overdueCleanUp() {
if (CLEANUP_LOCK.tryLock()) {
try {
long now = System.currentTimeMillis();
for (Map.Entry<String, ArexContext> entry: super.entrySet()) {
if (isExpired(entry.getValue().getCreateTime(), now)) {
... | Only used for ContextManager <br/>
delayed clean context in asynchronous situations,
the purpose is to ensure that the context can also be obtained during recording in async threads | overdueCleanUp | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/LatencyContextHashMap.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/LatencyContextHashMap.java | Apache-2.0 |
private static boolean isExpired(long createTime, long now) {
return now - createTime >= RECORD_TTL_MILLIS;
} | Only used for ContextManager <br/>
delayed clean context in asynchronous situations,
the purpose is to ensure that the context can also be obtained during recording in async threads | isExpired | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/LatencyContextHashMap.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/LatencyContextHashMap.java | Apache-2.0 |
public static void enter() {
CallDepth callDepth = Context.get(true);
if (callDepth != null) {
callDepth.getAndIncrement();
}
} | Avoid collecting data multiple times on the call chain | enter | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | Apache-2.0 |
public static boolean validate() {
return Context.get() == null;
} | Only used in advice asynchronous callback code | validate | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | Apache-2.0 |
public static boolean exitAndValidate() {
CallDepth callDepth = Context.get();
if (callDepth == null) {
return true;
}
if (callDepth.decrementAndGet() <= 0) {
Context.remove();
return true;
}
return false;
} | Only used in advice asynchronous callback code | exitAndValidate | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | Apache-2.0 |
private static CallDepth get() {
return get(false);
} | Only used in advice asynchronous callback code | get | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | Apache-2.0 |
public static CallDepth get(boolean createIfAbsent) {
CallDepth depth = SCOPE_TL.get();
if (depth == null && createIfAbsent && ContextManager.needRecord()) {
depth = CallDepth.simple();
SCOPE_TL.set(depth);
}
return depth;
} | Only used in advice asynchronous callback code | get | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/RepeatedCollectManager.java | Apache-2.0 |
private static void classLoaderInitResources(ClassLoader classLoader) {
try {
Enumeration<URL> files = classLoader.getResources("META-INF/MANIFEST.MF");
while (files.hasMoreElements()) {
URL url = files.nextElement();
try (InputStream stream = url.openStre... | Register a package that allows instrumentation
<p>package name in manifest file, with key: Bundle-Name / Automatic-Module-Name / Implementation-Title
<p>package version in manifest file, with key: Bundle-Version or Implementation-Version | classLoaderInitResources | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/ResourceManager.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/ResourceManager.java | Apache-2.0 |
private static String getManifestAttr(Manifest manifest, String... keys) {
for (String key : keys) {
String value = manifest.getMainAttributes().getValue(key);
if (StringUtil.isNotEmpty(value)) {
return value;
}
}
return null;
} | Register a package that allows instrumentation
<p>package name in manifest file, with key: Bundle-Name / Automatic-Module-Name / Implementation-Title
<p>package version in manifest file, with key: Bundle-Version or Implementation-Version | getManifestAttr | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/ResourceManager.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/context/ResourceManager.java | Apache-2.0 |
public static void onCreate(EventSource source){
if (!dependencyInitComplete()) {
return;
}
initContext(source);
loadReplayData();
initClock();
addEnterLog();
} | the onRequest method must be called before calling the onCreate method | onCreate | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
private static void addEnterLog() {
final ArexContext context = ContextManager.currentContext();
if (context == null) {
return;
}
final String recordId = context.getCaseId();
final String replayId = context.getReplayId();
if (StringUtil.isNotEmpty(replayId)) {... | the onRequest method must be called before calling the onCreate method | addEnterLog | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
private static void initSerializer(ClassLoader contextClassLoader) {
if (!existJacksonDependency) {
AdviceClassesCollector.INSTANCE.appendToClassLoaderSearch("jackson",
contextClassLoader);
}
final List<StringSerializable> serializableList = ServiceLoader.load(Str... | user loader to load serializer, ex: ParallelWebappClassLoader | initSerializer | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
public static void initContext(EventSource source){
ArexContext context = ContextManager.currentContext(true, source.getCaseId());
if (context != null) {
context.setExcludeMockTemplate(Serializer.deserialize(source.getExcludeMockTemplate(), EXCLUDE_MOCK_TYPE));
}
} | user loader to load serializer, ex: ParallelWebappClassLoader | initContext | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
private static void initClock(){
try {
if (ContextManager.needReplay()) {
Mocker mocker = MockUtils.createDynamicClass(CLOCK_CLASS, CLOCK_METHOD);
long millis = NumberUtil.parseLong(MockUtils.replayBody(mocker));
if (millis > 0) {
T... | user loader to load serializer, ex: ParallelWebappClassLoader | initClock | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
private static void initClass(ClassLoader contextClassLoader) {
boolean disableReplay = Config.get().getBoolean(ConfigConstants.DISABLE_REPLAY, false);
if (disableReplay) {
return;
}
String arexStaticClassInit = Config.get().getString(ConfigConstants.AREX_STATIC_CLASS_INIT);
... | To prevent class initialization failure during request replay,
it is advisable to perform early initialization of classes that rely on external dependencies.
This helps to avoid triggering the class initialization logic when replaying requests. | initClass | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
private static boolean isClassLoaded(String className, ClassLoader classLoader) {
return FIND_LOADED_METHOD == null || ReflectUtil.invoke(FIND_LOADED_METHOD, classLoader, className) != null;
} | To prevent class initialization failure during request replay,
it is advisable to perform early initialization of classes that rely on external dependencies.
This helps to avoid triggering the class initialization logic when replaying requests. | isClassLoaded | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
private static void initLog(ClassLoader contextClassLoader) {
List<Logger> extensionLoggerList = ServiceLoader.load(Logger.class, contextClassLoader);
LogManager.build(extensionLoggerList);
} | To prevent class initialization failure during request replay,
it is advisable to perform early initialization of classes that rely on external dependencies.
This helps to avoid triggering the class initialization logic when replaying requests. | initLog | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
public static boolean dependencyInitComplete() {
return InitializeEnum.COMPLETE.equals(INIT_DEPENDENCY.get());
} | To prevent class initialization failure during request replay,
it is advisable to perform early initialization of classes that rely on external dependencies.
This helps to avoid triggering the class initialization logic when replaying requests. | dependencyInitComplete | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/listener/EventProcessor.java | Apache-2.0 |
@Override
boolean internalCheck(MatchStrategyContext context) {
// if no request params, do next fuzzy match directly
return StringUtil.isNotEmpty(context.getRequestMocker().getTargetRequest().getBody());
} | search by operationName + requestBody
priority:
1. if matching and not matched before return directly
2. if matched before and find-last mode, return matched one
3. if matched multiple result, give next fuzzy match
4. if strict match mode and not matched, interrupt | internalCheck | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/AccurateMatchStrategy.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/AccurateMatchStrategy.java | Apache-2.0 |
void process(MatchStrategyContext context) {
context.setMatchStrategy(MatchStrategyEnum.EIGEN);
// to be implemented after database merge replay support
} | search by eigen value of request | process | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/EigenMatchStrategy.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/EigenMatchStrategy.java | Apache-2.0 |
void process(MatchStrategyContext context) {
context.setMatchStrategy(MatchStrategyEnum.FUZZY);
List<Mocker> replayList = context.getReplayList();
Mocker mocker = null;
int size = replayList.size();
for (int i = 0; i < size; i++) {
Mocker mockerDTO = replayList.get(i)... | search under the same method signature
replayList is arranged in ascending order by creationTime
@return not matched before or last one | process | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/FuzzyMatchStrategy.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/FuzzyMatchStrategy.java | Apache-2.0 |
@Override
boolean internalCheck(MatchStrategyContext context) {
return CollectionUtil.isNotEmpty(context.getReplayList());
} | search under the same method signature
replayList is arranged in ascending order by creationTime
@return not matched before or last one | internalCheck | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/FuzzyMatchStrategy.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/FuzzyMatchStrategy.java | Apache-2.0 |
public static Mocker match(Mocker requestMocker, MockStrategyEnum mockStrategy) {
Map<Integer, List<Mocker>> cachedReplayResultMap = ContextManager.currentContext().getCachedReplayResultMap();
// first match methodRequestTypeHash: category + operationName + requestType, ensure the same method
Li... | match rule:
1. methodRequestTypeHash: categoryType + operationName + requestType
2. accurate match: operationName + requestBody
3. fuzzy match/eigen match | match | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/ReplayMatcher.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/ReplayMatcher.java | Apache-2.0 |
private static void logMatchResult(MatchStrategyContext context) {
Mocker matchedMocker = context.getMatchMocker();
Mocker requestMocker = context.getRequestMocker();
StringBuilder matchResult = new StringBuilder(requestMocker.getCategoryType().getName());
matchResult.append(":").append... | match rule:
1. methodRequestTypeHash: categoryType + operationName + requestType
2. accurate match: operationName + requestBody
3. fuzzy match/eigen match | logMatchResult | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/ReplayMatcher.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/match/ReplayMatcher.java | Apache-2.0 |
public int getCode() {
return code;
} | Reset, if all dynamic class status of a Class is RESET status, the Class need to reset to original bytecode | getCode | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/model/DynamicClassStatusEnum.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/model/DynamicClassStatusEnum.java | Apache-2.0 |
public static String serializeWithType(Object object) {
if (object == null || INSTANCE == null) {
return null;
}
try {
return INSTANCE.getSerializer(ArexConstants.JACKSON_SERIALIZER_WITH_TYPE).serialize(object);
} catch (Throwable ex) {
LogManager.warn... | The serialize method cannot be reused because there is serializeNestedCollection logic in it, which will cause deserialization errors.
ex: List<List<Object>> serializeNestedCollection -> [["java.util.ArrayList",[["java.util.HashMap",{"bigDecimal":["java.math.BigDecimal",10]}]]]]
correct format: ["java.util.ArrayList",... | serializeWithType | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
public static Object deserializeWithType(String value) {
return deserialize(value, Object.class, ArexConstants.JACKSON_SERIALIZER_WITH_TYPE);
} | The serialize method cannot be reused because there is serializeNestedCollection logic in it, which will cause deserialization errors.
ex: List<List<Object>> serializeNestedCollection -> [["java.util.ArrayList",[["java.util.HashMap",{"bigDecimal":["java.math.BigDecimal",10]}]]]]
correct format: ["java.util.ArrayList",... | deserializeWithType | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
public static String serialize(Object object) {
return serialize(object, null);
} | Serialize to string
@param object object to be serialized
@return result string | serialize | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
public static String serialize(Object object, String serializer) {
try {
return serializeWithException(object, serializer);
} catch (Throwable ex) {
LogManager.warn("serializer-serialize",
StringUtil.format("can not serialize object: %s, serializer: %s, cause:... | Serialize to string
@param object object to be serialized
@return result string | serialize | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
public static <T> T deserialize(String value, Class<T> clazz) {
if (StringUtil.isEmpty(value) || clazz == null) {
return null;
}
try {
return INSTANCE.getSerializer().deserialize(value, clazz);
} catch (Throwable ex) {
LogManager.warn("serializer-dese... | Deserialize by Class
@param value String to be deserialized
@param clazz class to deserialize, example: com.xxx.xxxClass
@return T | deserialize | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
public static <T> T deserialize(String value, Type type, String serializer) {
if (StringUtil.isEmpty(value) || type == null) {
return null;
}
try {
if (Throwable.class.isAssignableFrom(TypeUtil.getRawClass(type))) {
serializer = ArexConstants.GSON_SERIALI... | Deserialize by parameterized type
@param value String to be deserialized
@param type Class type, example: {@code List<com.xxx.XXXType>}
@return T | deserialize | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
public static <T> T deserialize(String value, Type type) {
return deserialize(value, type, null);
} | Deserialize by parameterized type
@param value String to be deserialized
@param type Class type, example: {@code List<com.xxx.XXXType>}
@return T | deserialize | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
public static <T> T deserialize(String value, String typeName, String serializer) {
if (StringUtil.isEmpty(value) || StringUtil.isEmpty(typeName)) {
return null;
}
if (typeName.startsWith(HASH_MAP_VALUES_CLASS)) {
return (T) restoreHashMapValues(value, typeName, serializ... | Deserialization through type name mainly solves the two-level nesting of List {@code List<List<Object>>}
@param value String to be deserialized
@param typeName Complex type name, example: java.util.ArrayList-java.util.ArrayList,com.xxx.XXXType
@return T | deserialize | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
public static <T> T deserialize(String value, String typeName) {
return deserialize(value, typeName, null);
} | Deserialization through type name mainly solves the two-level nesting of List {@code List<List<Object>>}
@param value String to be deserialized
@param typeName Complex type name, example: java.util.ArrayList-java.util.ArrayList,com.xxx.XXXType
@return T | deserialize | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
private static <T> Collection<Collection<T>> deserializeNestedCollection(String json, String collectionType,
String[] innerCollectionType, String serializer) {
Collection<Collection<T>> collection = ReflectUtil.getCollectionInstance(collectionType);
if (collection == null) {
return n... | Deserialize nested collection
@param json json string
@param collectionType type name eg: java.util.HashSet-java.util.HashSet,java.lang.String,java.lang.String
@param serializer serializer | deserializeNestedCollection | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
private static Collection<?> restoreHashMapValues(String value, String typeName, String serializer) {
String replacedTypeName = StringUtil.replace(typeName, HASH_MAP_VALUES_CLASS, ARRAY_LIST_CLASS);
Collection<Object> collections = deserialize(value, TypeUtil.forName(replacedTypeName), serializer);
... | Deserialize nested collection
@param json json string
@param collectionType type name eg: java.util.HashSet-java.util.HashSet,java.lang.String,java.lang.String
@param serializer serializer | restoreHashMapValues | java | arextest/arex-agent-java | arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | https://github.com/arextest/arex-agent-java/blob/master/arex-instrumentation-api/src/main/java/io/arex/inst/runtime/serializer/Serializer.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.