/** * This is an extension point. The manager and other classes will only create * RemoteHttpCacheClient through this method. * <p> * @param cattr * @return IRemoteHttpCacheClient */ protected <K, V> IRemoteHttpCacheClient<K, V> createRemoteHttpCacheClientForAttributes( RemoteHttpCacheAttributes cattr ) { IRemoteHttpCacheClient<K, V> client = OptionConverter.instantiateByClassName( cattr .getRemoteHttpClientClassName(), null ); if ( client == null ) { if ( log.isInfoEnabled() ) { log.info( "Creating the default client." ); } client = new RemoteHttpCacheClient<K, V>( ); } client.initialize( cattr ); return client; }
/** * @return String details */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "\n RemoteHttpCacheAttributes" ); buf.append( "\n maxConnectionsPerHost = [" + getMaxConnectionsPerHost() + "]" ); buf.append( "\n socketTimeoutMillis = [" + getSocketTimeoutMillis() + "]" ); buf.append( "\n httpVersion = [" + getHttpVersion() + "]" ); buf.append( "\n connectionTimeoutMillis = [" + getConnectionTimeoutMillis() + "]" ); buf.append( "\n includeCacheNameAsParameter = [" + isIncludeCacheNameAsParameter() + "]" ); buf.append( "\n includeKeysAndPatternsAsParameter = [" + isIncludeKeysAndPatternsAsParameter() + "]" ); buf.append( "\n includeRequestTypeasAsParameter = [" + isIncludeRequestTypeasAsParameter() + "]" ); buf.append( "\n url = [" + getUrl() + "]" ); buf.append( "\n remoteHttpClientClassName = [" + getRemoteHttpClientClassName() + "]" ); buf.append( super.toString() ); return buf.toString(); } }
/** * @return String details */ @Override public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "\n RemoteHttpCacheAttributes" ); buf.append( "\n maxConnectionsPerHost = [" + getMaxConnectionsPerHost() + "]" ); buf.append( "\n socketTimeoutMillis = [" + getSocketTimeoutMillis() + "]" ); buf.append( "\n httpVersion = [" + getHttpVersion() + "]" ); buf.append( "\n connectionTimeoutMillis = [" + getConnectionTimeoutMillis() + "]" ); buf.append( "\n includeCacheNameAsParameter = [" + isIncludeCacheNameAsParameter() + "]" ); buf.append( "\n includeKeysAndPatternsAsParameter = [" + isIncludeKeysAndPatternsAsParameter() + "]" ); buf.append( "\n includeRequestTypeasAsParameter = [" + isIncludeRequestTypeasAsParameter() + "]" ); buf.append( "\n url = [" + getUrl() + "]" ); buf.append( "\n remoteHttpClientClassName = [" + getRemoteHttpClientClassName() + "]" ); buf.append( super.toString() ); return buf.toString(); } }
/** * This is an extension point. The manager and other classes will only create * RemoteHttpCacheClient through this method. * @param cattr the cache configuration * @return the client instance */ protected <V, K> IRemoteHttpCacheClient<K, V> createRemoteHttpCacheClientForAttributes(RemoteHttpCacheAttributes cattr) { IRemoteHttpCacheClient<K, V> remoteService = OptionConverter.instantiateByClassName( cattr .getRemoteHttpClientClassName(), null ); if ( remoteService == null ) { if ( log.isInfoEnabled() ) { log.info( "Creating the default client for " + cattr.getCacheName()); } remoteService = new RemoteHttpCacheClient<K, V>( ); } remoteService.initialize( cattr ); return remoteService; }