mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-18 01:06:03 +10:00
[김훈민] #37 memcached client 버전 체크
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@4010 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.nhn.pinpoint.profiler.modifier.arcus;
|
||||
|
||||
import com.nhn.pinpoint.profiler.interceptor.bci.InstrumentClass;
|
||||
|
||||
public enum SpyVersion {
|
||||
|
||||
SPYMEMCACHED_2_11,
|
||||
ARCUSCLIENT_1_6,
|
||||
ERROR
|
||||
;
|
||||
|
||||
public SpyVersion identifyWithMemcachedConnection(InstrumentClass aClass) {
|
||||
String className = aClass.getName();
|
||||
if (! "net/spy/memcached/MemcachedConnection".equals(className)) {
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
String[] createConnectionArgs = {"java.util.Collection"};
|
||||
boolean isSpy = aClass.hasDeclaredMethod("createConnection", createConnectionArgs);
|
||||
|
||||
if (isSpy) {
|
||||
return SPYMEMCACHED_2_11;
|
||||
} else {
|
||||
return ARCUSCLIENT_1_6;
|
||||
}
|
||||
}
|
||||
|
||||
public SpyVersion identifyWithMemcachedClient(InstrumentClass aClass) {
|
||||
String className = aClass.getName();
|
||||
if (! "net/spy/memcached/MemcachedClient".equals(className)) {
|
||||
return ERROR;
|
||||
}
|
||||
|
||||
String[] addOpArgs = {"java.lang.String", "net.spy.memcached.ops.Operation"};
|
||||
boolean isArcus = aClass.hasDeclaredMethod("addOp", addOpArgs);
|
||||
|
||||
return SPYMEMCACHED_2_11;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user