當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。