当前位置: 首页>>代码示例>>Java>>正文


Java Introspector.flushCaches方法代码示例

本文整理汇总了Java中java.beans.Introspector.flushCaches方法的典型用法代码示例。如果您正苦于以下问题:Java Introspector.flushCaches方法的具体用法?Java Introspector.flushCaches怎么用?Java Introspector.flushCaches使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.beans.Introspector的用法示例。


在下文中一共展示了Introspector.flushCaches方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import java.beans.Introspector; //导入方法依赖的package包/类
public void run() {
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, null);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);

    Introspector.setBeanInfoSearchPath(SEARCH_PATH);
    Introspector.flushCaches();

    test(FirstBean.class, FirstBeanBeanInfo.class);
    test(SecondBean.class, SecondBeanBeanInfo.class);
    test(ThirdBean.class, null);
    test(ThirdBeanBeanInfo.class, ThirdBeanBeanInfo.class);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:17,代码来源:TestBeanInfo.java

示例2: forgetClassLoader

import java.beans.Introspector; //导入方法依赖的package包/类
/**
 * Causes the specified classloader to be forgotten, making it and all
 * the class definitions loaded by it available for garbage collection
 * 
 * @param id the id of the classloader to forget
 */
public void forgetClassLoader(String id) {
  
  GateClassLoader gcl;
  
  synchronized(childClassLoaders) {
     gcl = childClassLoaders.remove(id);
  }

  if(gcl != null && !gcl.isIsolated()) {
    // in theory this shouldn't be needed as the Introspector uses
    // soft references if we move to requiring Java 8 it should be
    // safe to drop this call
    Introspector.flushCaches();

    AbstractResource.flushBeanInfoCache();
  }
}
 
开发者ID:GateNLP,项目名称:gate-core,代码行数:24,代码来源:GateClassLoader.java

示例3: main

import java.beans.Introspector; //导入方法依赖的package包/类
public static void main(String[] args) throws IntrospectionException {
    StringBuilder sb = null;
    if (args.length > 0) {
        if (args[0].equals("show")) {
            sb = new StringBuilder(65536);
        }
    }
    Introspector.flushCaches();
    int count = (sb != null) ? 10 : 100;
    long time = -System.currentTimeMillis();
    for (int i = 0; i < count; i++) {
        test(sb);
        test(sb);
        Introspector.flushCaches();
    }
    time += System.currentTimeMillis();
    System.out.println("Time (average): " + time / count);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:19,代码来源:TestIntrospector.java

示例4: test

import java.beans.Introspector; //导入方法依赖的package包/类
private static void test() {
    test("Bean", "Bean2", "Bean3", "Bean4");
    test("Bean4", "Bean", "Bean2", "Bean3");
    test("Bean3", "Bean4", "Bean", "Bean2");
    test("Bean2", "Bean3", "Bean4", "Bean");
    Introspector.flushCaches();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:8,代码来源:Test4508780.java

示例5: test

import java.beans.Introspector; //导入方法依赖的package包/类
private static void test(Boolean mark, Class... types) {
    for (Class type : types) {
        BeanInfo info = getBeanInfo(mark, type);
        if (info == null) {
            throw new Error("could not find BeanInfo for " + type);
        }
        if (mark != info.getBeanDescriptor().getValue("test")) {
            throw new Error("could not find marked BeanInfo for " + type);
        }
    }
    Introspector.flushCaches();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:Test4520754.java

示例6: test4168475

import java.beans.Introspector; //导入方法依赖的package包/类
/**
 * This is a regression test to ensure that 4168475 does not regress.
 */
private static void test4168475(Class type) {
    String[] newPath = {"infos"};
    String[] oldPath = Introspector.getBeanInfoSearchPath();

    Introspector.setBeanInfoSearchPath(newPath);
    BeanInfo info = getBeanInfo(Boolean.TRUE, type);
    Introspector.setBeanInfoSearchPath(oldPath);

    PropertyDescriptor[] pds = info.getPropertyDescriptors();
    if (pds.length != 1) {
        throw new Error("could not find custom BeanInfo for " + type);
    }
    Introspector.flushCaches();
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:Test4520754.java

示例7: contextDestroyed

import java.beans.Introspector; //导入方法依赖的package包/类
@Override
public void contextDestroyed(ServletContextEvent event) {
	CachedIntrospectionResults.clearClassLoader(Thread.currentThread().getContextClassLoader());
	Introspector.flushCaches();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:6,代码来源:IntrospectorCleanupListener.java


注:本文中的java.beans.Introspector.flushCaches方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。