Java 类org.springframework.beans.CachedIntrospectionResults 实例源码

项目:camunda-bpm-platform    文件:SpringProcessEngineTestCase.java   
@Override
public void runBare() throws Throwable {
  testContextManager.prepareTestInstance(this); // this will initialize all dependencies
  try {
    super.runBare();
  }
  finally {
    testContextManager.afterTestClass();
    applicationContext.close();
    clearTestContextCache(testContextManager);
    applicationContext = null;
    processEngine = null;
    testContextManager = null;
    CachedIntrospectionResults.clearClassLoader(getClass().getClassLoader());
  }
}
项目:gemini.blueprint    文件:JavaBeansCacheActivator.java   
private void initJavaBeansCache() {
    Class<?>[] classes =
            new Class<?>[] { OsgiServiceFactoryBean.class, OsgiServiceProxyFactoryBean.class,
                    OsgiServiceCollectionProxyFactoryBean.class };

    CachedIntrospectionResults.acceptClassLoader(OsgiStringUtils.class.getClassLoader());

    for (Class<?> clazz : classes) {
        BeanUtils.getPropertyDescriptors(clazz);
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConfigFileApplicationListener.java   
private void configureIgnoreBeanInfo(ConfigurableEnvironment environment) {
    if (System.getProperty(
            CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME) == null) {
        RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(environment,
                "spring.beaninfo.");
        Boolean ignore = resolver.getProperty("ignore", Boolean.class, Boolean.TRUE);
        System.setProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME,
                ignore.toString());
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConfigFileApplicationListenerTests.java   
@After
public void cleanup() {
    if (this.context != null) {
        this.context.close();
    }
    System.clearProperty("the.property");
    System.clearProperty("spring.config.location");
    System.clearProperty("spring.main.banner-mode");
    System.clearProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConfigFileApplicationListenerTests.java   
@Test
public void setIgnoreBeanInfoPropertyByDefault() throws Exception {
    this.initializer.setSearchNames("testproperties");
    this.initializer.postProcessEnvironment(this.environment, this.application);
    String property = System
            .getProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME);
    assertThat(property).isEqualTo("true");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ConfigFileApplicationListenerTests.java   
@Test
public void disableIgnoreBeanInfoProperty() throws Exception {
    this.initializer.setSearchNames("testproperties");
    TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment,
            "spring.beaninfo.ignore=false");
    this.initializer.postProcessEnvironment(this.environment, this.application);
    String property = System
            .getProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME);
    assertThat(property).isEqualTo("false");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:Restarter.java   
private void cleanupKnownCaches() throws Exception {
    // Whilst not strictly necessary it helps to cleanup soft reference caches
    // early rather than waiting for memory limits to be reached
    clear(ResolvableType.class, "cache");
    clear("org.springframework.core.SerializableTypeWrapper", "cache");
    clear(CachedIntrospectionResults.class, "acceptedClassLoaders");
    clear(CachedIntrospectionResults.class, "strongClassCache");
    clear(CachedIntrospectionResults.class, "softClassCache");
    clear(ReflectionUtils.class, "declaredFieldsCache");
    clear(ReflectionUtils.class, "declaredMethodsCache");
    clear(AnnotationUtils.class, "findAnnotationCache");
    clear(AnnotationUtils.class, "annotatedInterfaceCache");
    clear("com.sun.naming.internal.ResourceManager", "propertiesCache");
}
项目:spring-boot-concourse    文件:ConfigFileApplicationListener.java   
private void configureIgnoreBeanInfo(ConfigurableEnvironment environment) {
    if (System.getProperty(
            CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME) == null) {
        RelaxedPropertyResolver resolver = new RelaxedPropertyResolver(environment,
                "spring.beaninfo.");
        Boolean ignore = resolver.getProperty("ignore", Boolean.class, Boolean.TRUE);
        System.setProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME,
                ignore.toString());
    }
}
项目:spring-boot-concourse    文件:ConfigFileApplicationListenerTests.java   
@After
public void cleanup() {
    if (this.context != null) {
        this.context.close();
    }
    System.clearProperty("the.property");
    System.clearProperty("spring.config.location");
    System.clearProperty("spring.main.banner-mode");
    System.clearProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME);
}
项目:spring-boot-concourse    文件:ConfigFileApplicationListenerTests.java   
@Test
public void setIgnoreBeanInfoPropertyByDefault() throws Exception {
    this.initializer.setSearchNames("testproperties");
    this.initializer.postProcessEnvironment(this.environment, this.application);
    String property = System
            .getProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME);
    assertThat(property).isEqualTo("true");
}
项目:spring-boot-concourse    文件:ConfigFileApplicationListenerTests.java   
@Test
public void disableIgnoreBeanInfoProperty() throws Exception {
    this.initializer.setSearchNames("testproperties");
    TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment,
            "spring.beaninfo.ignore=false");
    this.initializer.postProcessEnvironment(this.environment, this.application);
    String property = System
            .getProperty(CachedIntrospectionResults.IGNORE_BEANINFO_PROPERTY_NAME);
    assertThat(property).isEqualTo("false");
}
项目:spring-boot-concourse    文件:Restarter.java   
private void cleanupKnownCaches() throws Exception {
    // Whilst not strictly necessary it helps to cleanup soft reference caches
    // early rather than waiting for memory limits to be reached
    clear(ResolvableType.class, "cache");
    clear("org.springframework.core.SerializableTypeWrapper", "cache");
    clear(CachedIntrospectionResults.class, "acceptedClassLoaders");
    clear(CachedIntrospectionResults.class, "strongClassCache");
    clear(CachedIntrospectionResults.class, "softClassCache");
    clear(ReflectionUtils.class, "declaredFieldsCache");
    clear(ReflectionUtils.class, "declaredMethodsCache");
    clear(AnnotationUtils.class, "findAnnotationCache");
    clear(AnnotationUtils.class, "annotatedInterfaceCache");
    clear("com.sun.naming.internal.ResourceManager", "propertiesCache");
}
项目:contestparser    文件:Restarter.java   
private void cleanupKnownCaches() throws Exception {
    // Whilst not strictly necessary it helps to cleanup soft reference caches
    // early rather than waiting for memory limits to be reached
    clear(ResolvableType.class, "cache");
    clear("org.springframework.core.SerializableTypeWrapper", "cache");
    clear(CachedIntrospectionResults.class, "acceptedClassLoaders");
    clear(CachedIntrospectionResults.class, "strongClassCache");
    clear(CachedIntrospectionResults.class, "softClassCache");
    clear(ReflectionUtils.class, "declaredFieldsCache");
    clear(ReflectionUtils.class, "declaredMethodsCache");
    clear(AnnotationUtils.class, "findAnnotationCache");
    clear(AnnotationUtils.class, "annotatedInterfaceCache");
    clear("com.sun.naming.internal.ResourceManager", "propertiesCache");
}
项目:HotswapAgent    文件:ResetSpringStaticCaches.java   
/**
 * Reset all caches.
 */
public static void reset() {
    resetTypeVariableCache();
    resetAnnotationUtilsCache();
    resetReflectionUtilsCache();
    resetPropetyCache();
    CachedIntrospectionResults.clearClassLoader(ResetSpringStaticCaches.class.getClassLoader());
}
项目:gemini.blueprint    文件:JavaBeansCacheActivator.java   
private void destroyJavaBeansCache() {
    CachedIntrospectionResults.clearClassLoader(OsgiStringUtils.class.getClassLoader());
}
项目:lams    文件:IntrospectorCleanupListener.java   
@Override
public void contextInitialized(ServletContextEvent event) {
    CachedIntrospectionResults.acceptClassLoader(Thread.currentThread().getContextClassLoader());
}
项目:lams    文件:IntrospectorCleanupListener.java   
@Override
public void contextDestroyed(ServletContextEvent event) {
    CachedIntrospectionResults.clearClassLoader(Thread.currentThread().getContextClassLoader());
    Introspector.flushCaches();
}
项目:spring4-understanding    文件:IntrospectorCleanupListener.java   
@Override
public void contextInitialized(ServletContextEvent event) {
    CachedIntrospectionResults.acceptClassLoader(Thread.currentThread().getContextClassLoader());
}
项目:spring4-understanding    文件:IntrospectorCleanupListener.java   
@Override
public void contextDestroyed(ServletContextEvent event) {
    CachedIntrospectionResults.clearClassLoader(Thread.currentThread().getContextClassLoader());
    Introspector.flushCaches();
}
项目:daq-eclipse    文件:XBeanBrokerService.java   
@Override
public void stop() throws Exception {
    // must clear this Spring cache to avoid any memory leaks
    CachedIntrospectionResults.clearClassLoader(getClass().getClassLoader());
    super.stop();
}
项目:class-guard    文件:IntrospectorCleanupListener.java   
public void contextInitialized(ServletContextEvent event) {
    CachedIntrospectionResults.acceptClassLoader(Thread.currentThread().getContextClassLoader());
}
项目:class-guard    文件:IntrospectorCleanupListener.java   
public void contextDestroyed(ServletContextEvent event) {
    CachedIntrospectionResults.clearClassLoader(Thread.currentThread().getContextClassLoader());
    Introspector.flushCaches();
}
项目:dynamicbeanloader    文件:DynamicBeanController.java   
@RequestMapping(method = RequestMethod.GET, value = "/registerBean")
@ResponseBody
private String registerBean(
        @RequestParam(value = "beanName", required = true) String beanName,
        @RequestParam(value = "beanType", required = true) String beanType) {
    try {

        /* String demoMessage = getDemoMessage(); */

        Class<?> c;

        c = Class.forName(beanType);

        CachedIntrospectionResults.clearClassLoader(c.getClassLoader());

        beanFactory.registerBean(c, beanName, "prototype", false, true);

        Object myBean = beanFactory.getBean(beanName);

        String ret = PAGE_HEADER
                + SPRING_VERSION
                + BEAN_INFO_MSG
                + CLASSLOADER_DELAY
                + BEAN_INFO_HEADER
                + String.format(BEAN_INFO_FORMAT, beanName, myBean
                        .getClass().getName(), myBean.toString()) /*
                                                                 * +
                                                                 * DEMO_MESSAGE_HEADER
                                                                 * +
                                                                 * tagHTML(
                                                                 * "p",
                                                                 * demoMessage
                                                                 * )
                                                                 */;

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(beanType);
        }

        /* CachedIntrospectionResults cir; */
        /*
         * 
         * if (ClassUtils.isCacheSafe(beanClass,
         * CachedIntrospectionResults.class.getClassLoader()) ||
         * isClassLoaderAccepted(beanClass.getClassLoader())) {
         */
        // CachedIntrospectionResults.clearClassLoader(c.getClassLoader());

        /* tripsDemo.getMessage(); */

        return ret;
    } catch (Exception e) {
        return String
                .format("Unable to create bean of type %s with the following error:</br>%s!",
                        beanType, e.getMessage());
    }
}
项目:spring4-understanding    文件:AbstractApplicationContext.java   
/**
 * Reset Spring's common core caches, in particular the {@link ReflectionUtils},
 * {@link ResolvableType} and {@link CachedIntrospectionResults} caches.
 * @since 4.2
 * @see ReflectionUtils#clearCache()
 * @see ResolvableType#clearCache()
 * @see CachedIntrospectionResults#clearClassLoader(ClassLoader)
 */
protected void resetCommonCaches() {
    ReflectionUtils.clearCache();
    ResolvableType.clearCache();
    CachedIntrospectionResults.clearClassLoader(getClassLoader());
}
项目:spring    文件:AbstractApplicationContext.java   
/**
 * Reset Spring's common core caches, in particular the {@link ReflectionUtils},
 * {@link ResolvableType} and {@link CachedIntrospectionResults} caches.
 * @since 4.2
 * @see ReflectionUtils#clearCache()
 * @see ResolvableType#clearCache()
 * @see CachedIntrospectionResults#clearClassLoader(ClassLoader)
 */
protected void resetCommonCaches() {
    ReflectionUtils.clearCache();
    ResolvableType.clearCache();
    CachedIntrospectionResults.clearClassLoader(getClassLoader());
}