java.lang.instrument.Instrumentation.getInitiatedClasses()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中java.lang.instrument.Instrumentation.getInitiatedClasses()方法的一些代码示例,展示了Instrumentation.getInitiatedClasses()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Instrumentation.getInitiatedClasses()方法的具体详情如下:
包路径:java.lang.instrument.Instrumentation
类名称:Instrumentation
方法名:getInitiatedClasses

Instrumentation.getInitiatedClasses介绍

暂无

代码示例

代码示例来源:origin: redisson/redisson

for (Class<?> type : instrumentation.getInitiatedClasses(classLoader)) {
  availableTypes.put(TypeDescription.ForLoadedType.getName(type), type);

代码示例来源:origin: org.dspace.dependencies.jmockit/dspace-jmockit

public ExpectationsTransformer(Instrumentation instrumentation)
{
 baseSubclasses = new ArrayList<String>();
 baseSubclasses.add("mockit/Expectations");
 baseSubclasses.add("mockit/NonStrictExpectations");
 baseSubclasses.add("mockit/Verifications");
 baseSubclasses.add("mockit/FullVerifications");
 baseSubclasses.add("mockit/VerificationsInOrder");
 baseSubclasses.add("mockit/FullVerificationsInOrder");
 Class<?>[] alreadyLoaded = instrumentation.getInitiatedClasses(getClass().getClassLoader());
 findOtherBaseSubclasses(alreadyLoaded);
 modifyFinalSubclasses(alreadyLoaded);
}

代码示例来源:origin: net.sf.tsl2nano/tsl2.nano.incubation

/**
  * check, if given agent is loaded
  * 
  * @param agentClass class name of agent
  * @param agentMethod optional method to be called on agent
  * @return true, if agent class is available and optional if method could be started (will log some agent infos)
  */
 public static boolean isAgentLoaded(String agentClass, String agentMethod) {
  try {
   Class<?> cls = Class.forName(agentClass); // "org.aspectj.weaver.loadtime.Agent"
   if (agentMethod != null) {
    Method method = cls.getMethod(agentMethod); // "getInstrumentation"
    Object instrumentation = method.invoke(null);
    if (instrumentation instanceof Instrumentation)
     log(instrumentation + ", initiated classes: " + ((Instrumentation)instrumentation).getInitiatedClasses(null).length);
    else
     log(instrumentation);
   }
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
  return true;
 }

代码示例来源:origin: com.fitbur.external/external-bytebuddy

@Override
public Map<TypeDescription, Class<?>> load(ClassLoader classLoader, Map<TypeDescription, byte[]> types) {
  Map<String, Class<?>> availableTypes = new HashMap<String, Class<?>>(preregisteredTypes);
  for (Class<?> type : instrumentation.getInitiatedClasses(classLoader)) {
    int anonymousLoaderIndex = type.getName().indexOf('/');
    availableTypes.put(anonymousLoaderIndex == -1

代码示例来源:origin: org.testifyproject.external/external-bytebuddy

@Override
public Map<TypeDescription, Class<?>> load(ClassLoader classLoader, Map<TypeDescription, byte[]> types) {
  Map<String, Class<?>> availableTypes = new HashMap<String, Class<?>>(preregisteredTypes);
  for (Class<?> type : instrumentation.getInitiatedClasses(classLoader)) {
    availableTypes.put(TypeDescription.ForLoadedType.getName(type), type);

代码示例来源:origin: houqianming/jvm-inspector

Class<?>[] bootstrapClasses = inst.getInitiatedClasses(null);
logger.info("[InspectAgent] total loaded classes: " + allLoadedClasses.length);
logger.info("[InspectAgent] total bootstrap loaded class: " + bootstrapClasses.length);

相关文章