0
在下面的代碼的意思是:什麼是關於btrace代碼
import static com.sun.btrace.BTraceUtils.*;
import com.sun.btrace.annotations.*;
import org.jboss.deployment.DeploymentInfo;
@BTrace public class Trace{
@OnMethod(
clazz="org.jboss.deployment.SARDeployer",
method="parseDocument"
)
public static void traceExecute(DeploymentInfo di){
printFields(di);
}
@OnMethod(
clazz="java.net.URL",
method="openConnection",
[email protected](Kind.RETURN)
)
public static void resolveEntity(@Self Object instance){
String protocol = str(get(field("java.net.URL", "protocol"),instance));
String file = str(get(field("java.net.URL", "file"),instance));
if(startsWith(protocol,"http") && (endsWith(file,".xsd") || endsWith(file,".dtd"))){
String authority = str(get(field("java.net.URL", "authority"),instance));
String path = str(get(field("java.net.URL", "path"),instance));
println("=====================================");
print(protocol);
print("://");
print(authority);
print(path);
println(" not found!");
println("who call:");
jstack();
}
}
}
這是什麼意思:get(field("java.net.URL", "authority"),instance)
?
請參閱我的文檔。