private static FactoryConfiguration getDefaultTransactionManagerLookupConfiguration() { FactoryConfiguration configuration = new FactoryConfiguration(); configuration.setClass(DefaultTransactionManagerLookup.class.getName()); return configuration; }
private static FactoryConfiguration getDefaultTransactionManagerLookupConfiguration() { FactoryConfiguration configuration = new FactoryConfiguration(); configuration.setClass(DefaultTransactionManagerLookup.class.getName()); return configuration; }
private static FactoryConfiguration getDefaultTransactionManagerLookupConfiguration() { FactoryConfiguration configuration = new FactoryConfiguration(); configuration.setClass(DefaultTransactionManagerLookup.class.getName()); return configuration; }
private static FactoryConfiguration getDefaultTransactionManagerLookupConfiguration() { FactoryConfiguration configuration = new FactoryConfiguration(); configuration.setClass(DefaultTransactionManagerLookup.class.getName()); return configuration; }
private FactoryConfiguration buildPeerListenerFactory(final ClusterNodeProperties clusterNodeProperties) { final String hostname = clusterNodeProperties.getProperty(EHCACHE_LISTENER_HOSTNAME); final String port = clusterNodeProperties.getProperty(EHCACHE_LISTENER_PORT); final String socketTimeoutMillis = clusterNodeProperties.getProperty(EHCACHE_LISTENER_SOCKET_TIMEOUT_MILLIS); final Properties properties = new Properties(); // We add the JiraUtils to maintain consistency between Java 7 and 8. // EhCache uses the default Java 7 approach, and it will fail in the future. properties.put("hostName", hostname != null ? hostname : JiraUtils.getHostname()); properties.put("port", port != null ? port : DEFAULT_LISTENER_PORT); if (socketTimeoutMillis != null) { properties.put("socketTimeoutMillis", socketTimeoutMillis); } return new FactoryConfiguration() .className(RMICacheManagerPeerListenerFactory.class.getName()) .properties(propertiesToString(properties)); }
private FactoryConfiguration buildPeerProviderFactory(final ClusterNodeProperties clusterNodeProperties) { final String address = clusterNodeProperties.getProperty(EHCACHE_MULTICAST_ADDRESS); final String port = clusterNodeProperties.getProperty(EHCACHE_MULTICAST_PORT); final String timeToLive = clusterNodeProperties.getProperty(EHCACHE_MULTICAST_TTL); final String hostName = clusterNodeProperties.getProperty(EHCACHE_MULTICAST_HOSTNAME); final String peerDiscovery = clusterNodeProperties.getProperty(EHCACHE_PEER_DISCOVERY); final Properties properties = new Properties(); if (timeToLive != null) { properties.put("timeToLive", timeToLive); } if (hostName != null) { properties.put("hostName", hostName); } properties.put(PEER_DISCOVERY, peerDiscovery != null ? peerDiscovery : "default"); properties.put("multicastGroupAddress", address != null ? address : DEFAULT_MULTICAST_ADDRESS); properties.put("multicastGroupPort", port != null ? port : DEFAULT_MULTICAST_PORT); return new FactoryConfiguration() .className(JiraRMICacheManagerPeerProviderFactory.class.getName()) .properties(propertiesToString(properties)); }
@Override public void start() { try { final Configuration configuration = ConfigurationFactory.parseConfiguration( config.getUrl() ); if ( jtaPlatform != null ) { OgmTransactionManagerLookupDelegate.transactionManager = jtaPlatform.retrieveTransactionManager(); final FactoryConfiguration transactionManagerLookupParameter = new FactoryConfiguration(); transactionManagerLookupParameter.setClass( OgmTransactionManagerLookupDelegate.class.getName() ); configuration.addTransactionManagerLookup( transactionManagerLookupParameter ); } cacheManager = CacheManager.create( config.getUrl() ); } catch (Exception e) { // Wrap Exception in a ServiceException to make the stack trace more friendly // Otherwise a generic unable to request service is thrown throw logger.unableToStartDatastoreProvider( e ); } }