@Test(expectedExceptions = IllegalStateException.class) public final void shouldThrowAnIllegalStateExceptionIfBothConfigurationPropertiesAndConfifurationPropertiesFileLocationAreSet() throws Exception { objectUnderTest = new SpringRemoteCacheManagerFactoryBean(); objectUnderTest.setConfigurationProperties(new Properties()); objectUnderTest.setConfigurationPropertiesFileLocation(new ClassPathResource("dummy", getClass())); objectUnderTest.afterPropertiesSet(); }
@Override public void afterPropertiesSet() throws Exception { assertCorrectlyConfigured(); this.logger.info("Creating new instance of RemoteCacheManager ..."); final Properties configurationPropertiesToUse = configurationProperties(); org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder.withProperties(configurationPropertiesToUse); long readTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)) readTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)); else readTimeout = 0; long writeTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)) writeTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)); else writeTimeout = 0; final RemoteCacheManager nativeRemoteCacheManager = new RemoteCacheManager( clientBuilder.build(), this.startAutomatically); this.springRemoteCacheManager = new SpringRemoteCacheManager(nativeRemoteCacheManager, readTimeout, writeTimeout); this.logger.info("Finished creating new instance of RemoteCacheManager"); }
SpringRemoteCacheManagerFactoryBean extends AbstractRemoteCacheManagerFactory implements FactoryBean<SpringRemoteCacheManager>, InitializingBean, DisposableBean { @Override public void afterPropertiesSet() throws Exception { assertCorrectlyConfigured(); this.logger.info("Creating new instance of RemoteCacheManager ..."); final Properties configurationPropertiesToUse = configurationProperties(); org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder.withProperties(configurationPropertiesToUse); long readTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)) readTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)); else readTimeout = 0; long writeTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)) writeTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)); else writeTimeout = 0; final RemoteCacheManager nativeRemoteCacheManager = new RemoteCacheManager( clientBuilder.build(), this.startAutomatically); this.springRemoteCacheManager = new SpringRemoteCacheManager(nativeRemoteCacheManager, readTimeout, writeTimeout); this.logger.info("Finished creating new instance of RemoteCacheManager"); } }
SpringRemoteCacheManagerFactoryBean extends AbstractRemoteCacheManagerFactory implements FactoryBean<SpringRemoteCacheManager>, InitializingBean, DisposableBean { @Override public void afterPropertiesSet() throws Exception { assertCorrectlyConfigured(); this.logger.info("Creating new instance of RemoteCacheManager ..."); final Properties configurationPropertiesToUse = configurationProperties(); org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder.withProperties(configurationPropertiesToUse); long readTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)) readTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)); else readTimeout = 0; long writeTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)) writeTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)); else writeTimeout = 0; final RemoteCacheManager nativeRemoteCacheManager = new RemoteCacheManager( clientBuilder.build(), this.startAutomatically); this.springRemoteCacheManager = new SpringRemoteCacheManager(nativeRemoteCacheManager, readTimeout, writeTimeout); this.logger.info("Finished creating new instance of RemoteCacheManager"); }  }
SpringRemoteCacheManagerFactoryBean extends AbstractRemoteCacheManagerFactory implements FactoryBean<SpringRemoteCacheManager>, InitializingBean, DisposableBean { @Override public void afterPropertiesSet() throws Exception { assertCorrectlyConfigured(); this.logger.info("Creating new instance of RemoteCacheManager ..."); final Properties configurationPropertiesToUse = configurationProperties(); org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder.withProperties(configurationPropertiesToUse); long readTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)) readTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)); else readTimeout = 0; long writeTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)) writeTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)); else writeTimeout = 0; final RemoteCacheManager nativeRemoteCacheManager = new RemoteCacheManager( clientBuilder.build(), this.startAutomatically); this.springRemoteCacheManager = new SpringRemoteCacheManager(nativeRemoteCacheManager, readTimeout, writeTimeout); this.logger.info("Finished creating new instance of RemoteCacheManager"); }  @Override void afterPropertiesSet(); @Override SpringRemoteCacheManager getObject(); @Override Class<? extends SpringRemoteCacheManager> getObjectType(); @Override boolean isSingleton(); @Override void destroy(); }
SpringRemoteCacheManagerFactoryBean extends AbstractRemoteCacheManagerFactory implements FactoryBean<SpringRemoteCacheManager>, InitializingBean, DisposableBean { @Override public void afterPropertiesSet() throws Exception { assertCorrectlyConfigured(); this.logger.info("Creating new instance of RemoteCacheManager ..."); final Properties configurationPropertiesToUse = configurationProperties(); org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = new org.infinispan.client.hotrod.configuration.ConfigurationBuilder(); clientBuilder.withProperties(configurationPropertiesToUse); long readTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)) readTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_READ_TIMEOUT)); else readTimeout = 0; long writeTimeout; if (configurationPropertiesToUse.containsKey(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)) writeTimeout = Long.parseLong(configurationPropertiesToUse.getProperty(ConfigurationPropertiesOverrides.OPERATION_WRITE_TIMEOUT)); else writeTimeout = 0; final RemoteCacheManager nativeRemoteCacheManager = new RemoteCacheManager( clientBuilder.build(), this.startAutomatically); this.springRemoteCacheManager = new SpringRemoteCacheManager(nativeRemoteCacheManager, readTimeout, writeTimeout); this.logger.info("Finished creating new instance of RemoteCacheManager"); }  @Override void afterPropertiesSet(); @Override SpringRemoteCacheManager getObject(); @Override Class<? extends SpringRemoteCacheManager> getObjectType(); @Override boolean isSingleton(); @Override void destroy();  }