Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Membase client now lives at https://github.com/couchbase/couchbase-ne…

  • Loading branch information...
commit b993e333f24a26a9cf9a668aafe42fcbd12f35ea 1 parent 0c6fe75
Attila Kiskó authored

Showing 41 changed files with 10 additions and 4,501 deletions. Show diff stats Hide diff stats

  1. 4  DemoApp/DemoApp.csproj
  2. 9  DemoApp/Program.cs
  3. 11  Enyim.Caching.sln
  4. 45  Membase/BasicMembaseOperationFactory.cs
  5. 276  Membase/BucketConfigListener.cs
  6. 32  Membase/Changes.mdown
  7. 28  Membase/Config.transform
  8. 92  Membase/ConfigHelper.cs
  9. 40  Membase/Configuration/BucketPortType.cs
  10. 44  Membase/Configuration/DefaultPerformanceMonitorFactory.cs
  11. 75  Membase/Configuration/IMembaseClientConfiguration.cs
  12. 33  Membase/Configuration/IMembasePerformanceMonitorFactory.cs
  13. 293  Membase/Configuration/MembaseClientConfiguration.cs
  14. 169  Membase/Configuration/MembaseClientSection.cs
  15. 119  Membase/Configuration/ServersElement.cs
  16. 42  Membase/Configuration/UriElement.cs
  17. 68  Membase/Configuration/UriElementCollection.cs
  18. 85  Membase/Configuration/UriValidator.cs
  19. 28  Membase/Demo.config
  20. 218  Membase/Deserialization.cs
  21. 15  Membase/IMembaseOperationFactory.cs
  22. 13  Membase/IMembaseServerPool.cs
  23. 91  Membase/Membase.csproj
  24. 19  Membase/Membase.nuspec
  25. 464  Membase/MembaseClient.cs
  26. 577  Membase/MembasePool.cs
  27. 564  Membase/MessageStreamListener.cs
  28. 11  Membase/OperationInterfaces.cs
  29. 88  Membase/Operations/GetAndTouchOperation.cs
  30. 240  Membase/Operations/SyncOperation.cs
  31. 65  Membase/Operations/TouchOperation.cs
  32. 35  Membase/Properties/AssemblyInfo.cs
  33. 359  Membase/VBucketAwareOperationFactory.cs
  34. 116  Membase/WebClientWithTimeout.cs
  35. 29  MemcachedTest/ConfigTest.cs
  36. 47  MemcachedTest/MembaseClientTest.cs
  37. 41  MemcachedTest/MembaseMemcachedBucketTest.cs
  38. 6  MemcachedTest/MemcachedTest.csproj
  39. 12  TestApp/Program.cs
  40. 4  TestApp/TestApp.csproj
  41. 4  build/properties.ps1
4  DemoApp/DemoApp.csproj
@@ -39,10 +39,6 @@
39 39
       <Project>{D438C0B3-A168-40B8-BDDD-61F0939DFF35}</Project>
40 40
       <Name>Enyim.Caching</Name>
41 41
     </ProjectReference>
42  
-    <ProjectReference Include="..\Membase\Membase.csproj">
43  
-      <Project>{708A2350-A26C-444D-B975-8164263951A7}</Project>
44  
-      <Name>Membase</Name>
45  
-    </ProjectReference>
46 42
   </ItemGroup>
47 43
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
48 44
 </Project>
9  DemoApp/Program.cs
... ...
@@ -1,13 +1,8 @@
1 1
 using System;
2  
-using System.Collections.Generic;
3  
-using System.Text;
4  
-using Enyim.Caching;
5  
-using Enyim.Caching.Memcached;
6 2
 using System.Net;
  3
+using Enyim.Caching;
7 4
 using Enyim.Caching.Configuration;
8  
-using Membase;
9  
-using Membase.Configuration;
10  
-using System.Threading;
  5
+using Enyim.Caching.Memcached;
11 6
 
12 7
 namespace DemoApp
13 8
 {
11  Enyim.Caching.sln
@@ -13,10 +13,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MemcachedTest", "MemcachedT
13 13
 EndProject
14 14
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DemoApp", "DemoApp\DemoApp.csproj", "{7225B6E0-A1FB-4F64-A5C5-1F640E21C90B}"
15 15
 EndProject
16  
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Membase", "Membase\Membase.csproj", "{708A2350-A26C-444D-B975-8164263951A7}"
17  
-EndProject
18  
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "TestApp\TestApp.csproj", "{607B1927-A964-48B2-AEA3-6810D10A6831}"
19  
-EndProject
20 16
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enyim.Caching.Log4NetAdapter", "Enyim.Caching.Log4NetAdapter\Enyim.Caching.Log4NetAdapter.csproj", "{9D3F12E6-6BDD-4DED-8B25-D877780640B4}"
21 17
 EndProject
22 18
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Enyim.Caching.NLogAdapter", "Enyim.Caching.NLogAdapter\Enyim.Caching.NLogAdapter.csproj", "{C96760B1-7CAD-4983-9FAD-EB00CD7A9FC6}"
@@ -37,13 +33,6 @@ Global
37 33
 		{7225B6E0-A1FB-4F64-A5C5-1F640E21C90B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38 34
 		{7225B6E0-A1FB-4F64-A5C5-1F640E21C90B}.Debug|Any CPU.Build.0 = Debug|Any CPU
39 35
 		{7225B6E0-A1FB-4F64-A5C5-1F640E21C90B}.Release|Any CPU.ActiveCfg = Release|Any CPU
40  
-		{708A2350-A26C-444D-B975-8164263951A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41  
-		{708A2350-A26C-444D-B975-8164263951A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
42  
-		{708A2350-A26C-444D-B975-8164263951A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
43  
-		{708A2350-A26C-444D-B975-8164263951A7}.Release|Any CPU.Build.0 = Release|Any CPU
44  
-		{607B1927-A964-48B2-AEA3-6810D10A6831}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
45  
-		{607B1927-A964-48B2-AEA3-6810D10A6831}.Debug|Any CPU.Build.0 = Debug|Any CPU
46  
-		{607B1927-A964-48B2-AEA3-6810D10A6831}.Release|Any CPU.ActiveCfg = Release|Any CPU
47 36
 		{9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
48 37
 		{9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
49 38
 		{9D3F12E6-6BDD-4DED-8B25-D877780640B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
45  Membase/BasicMembaseOperationFactory.cs
... ...
@@ -1,45 +0,0 @@
1  
-using System;
2  
-using System.Collections.Generic;
3  
-
4  
-namespace Membase
5  
-{
6  
-	internal class BasicMembaseOperationFactory : Enyim.Caching.Memcached.Protocol.Binary.BinaryOperationFactory, IMembaseOperationFactory
7  
-	{
8  
-		internal static readonly BasicMembaseOperationFactory Instance = new BasicMembaseOperationFactory();
9  
-
10  
-		ITouchOperation IMembaseOperationFactory.Touch(string key, uint newExpiration)
11  
-		{
12  
-			return new TouchOperation(null, key, newExpiration);
13  
-		}
14  
-
15  
-		IGetAndTouchOperation IMembaseOperationFactory.GetAndTouch(string key, uint newExpiration)
16  
-		{
17  
-			return new GetAndTouchOperation(null, key, newExpiration);
18  
-		}
19  
-
20  
-		ISyncOperation IMembaseOperationFactory.Sync(SyncMode mode, IList<KeyValuePair<string, ulong>> keys, int replicationCount)
21  
-		{
22  
-			throw new NotSupportedException("Sync is not supported on memcached buckets.");
23  
-		}
24  
-	}
25  
-}
26  
-
27  
-#region [ License information          ]
28  
-/* ************************************************************
29  
- * 
30  
- *    Copyright (c) 2010 Attila Kiskó, enyim.com
31  
- *    
32  
- *    Licensed under the Apache License, Version 2.0 (the "License");
33  
- *    you may not use this file except in compliance with the License.
34  
- *    You may obtain a copy of the License at
35  
- *    
36  
- *        http://www.apache.org/licenses/LICENSE-2.0
37  
- *    
38  
- *    Unless required by applicable law or agreed to in writing, software
39  
- *    distributed under the License is distributed on an "AS IS" BASIS,
40  
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41  
- *    See the License for the specific language governing permissions and
42  
- *    limitations under the License.
43  
- *    
44  
- * ************************************************************/
45  
-#endregion
276  Membase/BucketConfigListener.cs
... ...
@@ -1,276 +0,0 @@
1  
-using System;
2  
-using System.Collections.Generic;
3  
-using System.Linq;
4  
-using System.Web.Script.Serialization;
5  
-using System.Threading;
6  
-using System.Net;
7  
-using Enyim;
8  
-using Membase.Configuration;
9  
-
10  
-namespace Membase
11  
-{
12  
-	internal class BucketConfigListener
13  
-	{
14  
-		private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(BucketConfigListener));
15  
-
16  
-		private Uri[] poolUrls;
17  
-		private string bucketName;
18  
-		private NetworkCredential credential;
19  
-		private int? lastHash;
20  
-		private ManualResetEvent mre;
21  
-		private MessageStreamListener listener;
22  
-
23  
-		public BucketConfigListener(Uri[] poolUrls, string bucketName, string bucketPassword)
24  
-		{
25  
-			this.poolUrls = poolUrls;
26  
-			this.bucketName = String.IsNullOrEmpty(bucketName)
27  
-								? "default"
28  
-								: bucketName;
29  
-
30  
-			this.credential = bucketName == "default" || String.IsNullOrEmpty(bucketPassword)
31  
-								? null
32  
-								: new NetworkCredential(bucketName, bucketPassword);
33  
-
34  
-			this.Timeout = 10000;
35  
-			this.DeadTimeout = 10000;
36  
-
37  
-			this.RetryCount = 0;
38  
-			this.RetryTimeout = new TimeSpan(0, 0, 0, 0, 500);
39  
-		}
40  
-
41  
-		/// <summary>
42  
-		/// Connection timeout in milliseconds for connecting the pool.
43  
-		/// </summary>
44  
-		public int Timeout { get; set; }
45  
-
46  
-		public int RetryCount { get; set; }
47  
-		public TimeSpan RetryTimeout { get; set; }
48  
-
49  
-		/// <summary>
50  
-		/// Time to wait in milliseconds to reconnect to the pool when all nodes are down.
51  
-		/// </summary>
52  
-		public int DeadTimeout { get; set; }
53  
-
54  
-		/// <summary>
55  
-		/// Raised when the pool's configuration changes.
56  
-		/// </summary>
57  
-		public event Action<ClusterConfig> ClusterConfigChanged;
58  
-
59  
-		/// <summary>
60  
-		/// Starts listening for configuration data. This method blocks until the initial configuration is received. (Or until all pool urls fail.)
61  
-		/// </summary>
62  
-		public void Start()
63  
-		{
64  
-			var reset = this.mre = new ManualResetEvent(false);
65  
-
66  
-			// subscribe to the config url
67  
-			this.listener = this.GetPooledListener();
68  
-
69  
-			// this will be signaled by the config changed event handler
70  
-			reset.WaitOne();
71  
-
72  
-			// set to null, then dispose, so RaiseConfigChanged will not 
73  
-			// fail at Set when the config changes while we're cleaning up here
74  
-			this.mre = null;
75  
-			((IDisposable)reset).Dispose();
76  
-		}
77  
-
78  
-		public void Stop()
79  
-		{
80  
-			this.ReleaseListener(this.listener);
81  
-			this.listener = null;
82  
-		}
83  
-
84  
-		private static readonly JavaScriptConverter[] KnownConverters = { ClusterNode.ConverterInstance };
85  
-
86  
-		private void HandleMessage(string message)
87  
-		{
88  
-			// everything failed
89  
-			if (String.IsNullOrEmpty(message))
90  
-			{
91  
-				this.lastHash = null;
92  
-				this.RaiseConfigChanged(null);
93  
-				return;
94  
-			}
95  
-
96  
-			// deserialize the buckets
97  
-			var jss = new JavaScriptSerializer();
98  
-			jss.RegisterConverters(KnownConverters);
99  
-
100  
-			var config = jss.Deserialize<ClusterConfig>(message);
101  
-
102  
-			// check if the config is the same as the previous
103  
-			// we cannot compare the messages because they have more information than we deserialize from them
104  
-			var configHash = config.GetHashCode();
105  
-
106  
-			if (lastHash != configHash)
107  
-			{
108  
-				lastHash = configHash;
109  
-				this.RaiseConfigChanged(config);
110  
-			}
111  
-			else if (log.IsDebugEnabled)
112  
-				log.Debug("Last message was the same as current, ignoring.");
113  
-		}
114  
-
115  
-		private void RaiseConfigChanged(ClusterConfig config)
116  
-		{
117  
-			var ccc = this.ClusterConfigChanged;
118  
-
119  
-			// we got a new config, notify the pool to reload itself
120  
-			if (ccc != null)
121  
-				ccc(config);
122  
-
123  
-			// trigger the event so Start stops blocking
124  
-			if (this.mre != null)
125  
-				this.mre.Set();
126  
-		}
127  
-
128  
-		#region [ message listener pooling     ]
129  
-		private static readonly object ListenerSync = new Object();
130  
-
131  
-		// we pool and refcount the listeners here so we can safely dispose them when all clients are destroyed
132  
-		private static Dictionary<int, MessageStreamListener> listeners = new Dictionary<int, MessageStreamListener>();
133  
-		private static Dictionary<MessageStreamListener, ListenerInfo> listenerRefs = new Dictionary<MessageStreamListener, ListenerInfo>();
134  
-
135  
-		private class ListenerInfo
136  
-		{
137  
-			public int RefCount;
138  
-			public int HashKey;
139  
-		}
140  
-
141  
-		/// <summary>
142  
-		/// Unsubscibes from a pooled listener, and destrpys it if no additionals subscribers are present.
143  
-		/// </summary>
144  
-		/// <param name="listener"></param>
145  
-		private void ReleaseListener(MessageStreamListener listener)
146  
-		{
147  
-			lock (ListenerSync)
148  
-			{
149  
-				listener.Unsubscribe(this.HandleMessage);
150  
-
151  
-				var info = listenerRefs[listener];
152  
-				if (info.RefCount == 1)
153  
-				{
154  
-					listenerRefs.Remove(listener);
155  
-					listeners.Remove(info.HashKey);
156  
-
157  
-					try { using (listener) listener.Stop(); }
158  
-					catch { }
159  
-				}
160  
-				else
161  
-				{
162  
-					info.RefCount--;
163  
-				}
164  
-			}
165  
-		}
166  
-
167  
-		/// <summary>
168  
-		/// Returns a MessageStreamListener instance based on this instance's configuratino (timeout, bucket name etc.)
169  
-		/// 
170  
-		/// When multiple listeners are requested with the exact same parameters (usually when multiple clients are instantiated from the same configuration),
171  
-		/// the same listener will be returned each time.
172  
-		/// </summary>
173  
-		/// <returns></returns>
174  
-		private MessageStreamListener GetPooledListener()
175  
-		{
176  
-			// create a unique key based on the parameters
177  
-			// to find out if we already have a listener attached to this pool
178  
-			var hcc = new HashCodeCombiner();
179  
-
180  
-			hcc.Add(this.Timeout);
181  
-			hcc.Add(this.DeadTimeout);
182  
-			hcc.Add(this.RetryCount);
183  
-			hcc.Add(this.RetryTimeout.GetHashCode());
184  
-			hcc.Add(this.bucketName.GetHashCode());
185  
-
186  
-			if (credential != null)
187  
-			{
188  
-				hcc.Add((this.credential.UserName ?? String.Empty).GetHashCode());
189  
-				hcc.Add((this.credential.Password ?? String.Empty).GetHashCode());
190  
-				hcc.Add((this.credential.Domain ?? String.Empty).GetHashCode());
191  
-			}
192  
-
193  
-			for (var i = 0; i < this.poolUrls.Length; i++)
194  
-				hcc.Add(this.poolUrls[i].GetHashCode());
195  
-
196  
-			var hash = hcc.CurrentHash;
197  
-
198  
-			MessageStreamListener retval;
199  
-
200  
-			lock (ListenerSync)
201  
-				if (listeners.TryGetValue(hash, out retval))
202  
-				{
203  
-					listenerRefs[retval].RefCount++;
204  
-					retval.Subscribe(this.HandleMessage);
205  
-				}
206  
-				else
207  
-				{
208  
-					var name = this.bucketName;
209  
-
210  
-					// create a new listener for the pool urls
211  
-					retval = new MessageStreamListener(poolUrls, (client, root) => ResolveBucketUri(client, root, name));
212  
-
213  
-					retval.ConnectionTimeout = this.Timeout;
214  
-					retval.DeadTimeout = this.DeadTimeout;
215  
-					retval.Credentials = this.credential;
216  
-					retval.RetryCount = this.RetryCount;
217  
-					retval.RetryTimeout = this.RetryTimeout;
218  
-
219  
-					retval.Subscribe(this.HandleMessage);
220  
-
221  
-					listeners[hash] = retval;
222  
-					listenerRefs[retval] = new ListenerInfo { RefCount = 1, HashKey = hash };
223  
-
224  
-					retval.Start();
225  
-				}
226  
-
227  
-			return retval;
228  
-		}
229  
-
230  
-		private static Uri ResolveBucketUri(WebClientWithTimeout client, Uri root, string bucketName)
231  
-		{
232  
-			try
233  
-			{
234  
-				var bucket = ConfigHelper.ResolveBucket(client, root, bucketName);
235  
-				if (bucket == null)
236  
-					return null;
237  
-
238  
-				if (String.IsNullOrEmpty(bucket.streamingUri))
239  
-				{
240  
-					log.ErrorFormat("Url {0} for bucket {1} returned a config with no streamingUri", root, bucketName);
241  
-					return null;
242  
-				}
243  
-
244  
-				return new Uri(root, bucket.streamingUri);
245  
-			}
246  
-			catch (Exception e)
247  
-			{
248  
-				log.Error("Error resolving streaming uri: " + root, e);
249  
-
250  
-				return null;
251  
-			}
252  
-		}
253  
-
254  
-		#endregion
255  
-	}
256  
-}
257  
-
258  
-#region [ License information          ]
259  
-/* ************************************************************
260  
- * 
261  
- *    Copyright (c) 2010 Attila Kiskó, enyim.com
262  
- *    
263  
- *    Licensed under the Apache License, Version 2.0 (the "License");
264  
- *    you may not use this file except in compliance with the License.
265  
- *    You may obtain a copy of the License at
266  
- *    
267  
- *        http://www.apache.org/licenses/LICENSE-2.0
268  
- *    
269  
- *    Unless required by applicable law or agreed to in writing, software
270  
- *    distributed under the License is distributed on an "AS IS" BASIS,
271  
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
272  
- *    See the License for the specific language governing permissions and
273  
- *    limitations under the License.
274  
- *    
275  
- * ************************************************************/
276  
-#endregion
32  Membase/Changes.mdown
Source Rendered
... ...
@@ -1,32 +0,0 @@
1  
-# Membase Client Version History
2  
-
3  
-## Version 2.14
4  
-
5  
- * Fixed [Issue #69](https://github.com/enyim/EnyimMemcached/issues#issue/69) - Handle hist names in the cluster config
6  
- * Fixed [Issue #71](https://github.com/enyim/EnyimMemcached/issues#issue/71) - Increasing number of vbucket errors
7  
- * Fixed the CAS handling of Append and Prepend
8  
- * Multigets now honor the receive timeout
9  
-
10  
-## Version 2.13
11  
-
12  
- * Fixed [Issue #65](https://github.com/enyim/EnyimMemcached/issues#issue/65) - Getting multiple keys twice in a row fails.
13  
-
14  
-## Version 2.12
15  
-
16  
- * Includes all the changes from Enyim.Caching 2.9
17  
- * Fixed [Issue #60](https://github.com/enyim/EnyimMemcached/issues#issue/60) - Bucket and BucketPassword not picked up from config
18  
- * Membase 1.7 support:
19  
-    * Get&Touch allows you to extend the expiration of an item without retrieving it.
20  
-    * Sync allows you to wait for an item to be replicated, changed, persisted, etc. _Please note: the maximum time to wait is ~2.5 sec and this limit is enforced by the Membase server (by closing the connection) so use it only for short waits._
21  
-
22  
-## Version 2.11
23  
-
24  
- * Includes all the changes from Enyim.Caching 2.8 (perfmon, bugfixes)
25  
- * Cleaned up the credentials handling: only BucketName and BucketPasswords will be used, Credentials is obsolete. This way you do not have to specify your Membase cluster admin password in config files. See the wiki for more information.
26  
-
27  
-## Version 2.10
28  
-
29  
- * Changed the namespace to Membase and the client's name to MembaseClient to follow the name change of the product (& the company).
30  
- * Includes all the changes from Enyim.Caching 2.7
31  
-
32  
-Make sure you update your configuration files accordingly!
28  Membase/Config.transform
... ...
@@ -1,28 +0,0 @@
1  
-<?xml version="1.0" encoding="utf-8" ?>
2  
-<configuration>
3  
-	<configSections>
4  
-		<section name="membase" type="Membase.Configuration.MembaseClientSection, Membase" />
5  
-	</configSections>
6  
-
7  
-	<membase>
8  
-		<!-- 
9  
-			Please read the documentation first:
10  
-				http://github.com/enyim/EnyimMemcached/wiki/MembaseClient-configuration
11  
-
12  
-			Use this section as a template if you're connecting to Membase Servers.
13  
-			Note: you must have the top-level membase section if you're using the parameterless constructor of MembaseClient.
14  
-		-->
15  
-		<servers bucket="enyim" bucketPassword="password" retryCount="2" retryTimeout="00:00:02">
16  
-			<!--
17  
-				Provide at least 2-3 urls from your cluster. 
18  
-				Usually you only need to change the host, except when connecting to older versions.
19  
-				Membase uses port 8091, while the NorthScale Memcached Server (1.0.3) uses 8080
20  
-			-->
21  
-			<add uri="http://192.168.2.202:8091/pools/default" />
22  
-			<add uri="http://192.168.2.200:8091/pools/default" />
23  
-		</servers>
24  
-		<!-- the client waits deadTmimeout time to reconnect to the pool when all the specified urls are down -->
25  
-		<socketPool connectionTimeout="00:00:10" deadTimeout="00:00:10" />
26  
-	</membase>
27  
-
28  
-</configuration>
92  Membase/ConfigHelper.cs
... ...
@@ -1,92 +0,0 @@
1  
-using System;
2  
-using System.Collections.Generic;
3  
-using System.Linq;
4  
-using System.Net;
5  
-using System.Text;
6  
-using System.Web.Script.Serialization;
7  
-using System.IO;
8  
-using System.Text.RegularExpressions;
9  
-using Membase.Configuration;
10  
-
11  
-namespace Membase
12  
-{
13  
-	internal static class ConfigHelper
14  
-	{
15  
-		private static readonly Enyim.Caching.ILog log = Enyim.Caching.LogManager.GetLogger(typeof(ConfigHelper));
16  
-
17  
-		/// <summary>
18  
-		/// Deserializes the content of an url as a json object
19  
-		/// </summary>
20  
-		/// <typeparam name="T"></typeparam>
21  
-		/// <param name="uri"></param>
22  
-		/// <returns></returns>
23  
-		private static T DeserializeUri<T>(WebClient client, Uri uri, IEnumerable<JavaScriptConverter> converters)
24  
-		{
25  
-			var info = client.DownloadString(uri);
26  
-			var jss = new JavaScriptSerializer();
27  
-
28  
-			if (converters != null)
29  
-				jss.RegisterConverters(converters);
30  
-
31  
-			return jss.Deserialize<T>(info);
32  
-		}
33  
-
34  
-		private static readonly JavaScriptConverter[] JSC = { ClusterNode.ConverterInstance };
35  
-
36  
-		private static ClusterInfo GetClusterInfo(WebClient client, Uri clusterUrl)
37  
-		{
38  
-			var info = DeserializeUri<ClusterInfo>(client, clusterUrl, JSC);
39  
-
40  
-			if (info == null)
41  
-				throw new ArgumentException("invalid pool url: " + clusterUrl);
42  
-
43  
-			if (info.buckets == null || String.IsNullOrEmpty(info.buckets.uri))
44  
-				throw new ArgumentException("got an invalid response, missing { buckets : { uri : '' } }");
45  
-
46  
-			return info;
47  
-		}
48  
-
49  
-		/// <summary>
50  
-		/// Asks the cluster for the specified bucket's configuration.
51  
-		/// </summary>
52  
-		/// <param name="poolUri"></param>
53  
-		/// <param name="name"></param>
54  
-		/// <returns></returns>
55  
-		public static ClusterConfig ResolveBucket(WebClient client, Uri poolUri, string name)
56  
-		{
57  
-			var info = ConfigHelper.GetClusterInfo(client, poolUri);
58  
-			var root = new Uri(poolUri, info.buckets.uri);
59  
-
60  
-			var allBuckets = ConfigHelper.DeserializeUri<ClusterConfig[]>(client, root, JSC);
61  
-			var retval = allBuckets.FirstOrDefault(b => b.name == name);
62  
-
63  
-			if (retval == null)
64  
-			{
65  
-				if (log.IsWarnEnabled) log.WarnFormat("Could not find the pool '{0}' at {1}", name, poolUri);
66  
-			}
67  
-			else if (log.IsDebugEnabled) log.DebugFormat("Found config for bucket {0}.", name);
68  
-
69  
-			return retval;
70  
-		}
71  
-	}
72  
-}
73  
-
74  
-#region [ License information          ]
75  
-/* ************************************************************
76  
- * 
77  
- *    Copyright (c) 2010 Attila Kiskó, enyim.com
78  
- *    
79  
- *    Licensed under the Apache License, Version 2.0 (the "License");
80  
- *    you may not use this file except in compliance with the License.
81  
- *    You may obtain a copy of the License at
82  
- *    
83  
- *        http://www.apache.org/licenses/LICENSE-2.0
84  
- *    
85  
- *    Unless required by applicable law or agreed to in writing, software
86  
- *    distributed under the License is distributed on an "AS IS" BASIS,
87  
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
88  
- *    See the License for the specific language governing permissions and
89  
- *    limitations under the License.
90  
- *    
91  
- * ************************************************************/
92  
-#endregion
40  Membase/Configuration/BucketPortType.cs
... ...
@@ -1,40 +0,0 @@
1  
-using System;
2  
-using System.Collections.Generic;
3  
-using System.Linq;
4  
-using System.Text;
5  
-
6  
-namespace Membase.Configuration
7  
-{
8  
-	public enum BucketPortType
9  
-	{
10  
-		/// <summary>
11  
-		/// Connect to the nodes using moxy
12  
-		/// </summary>
13  
-		Proxy,
14  
-
15  
-		/// <summary>
16  
-		/// Connect to the nodes directly using the Memcached port
17  
-		/// </summary>
18  
-		Direct
19  
-	}
20  
-}
21  
-
22  
-#region [ License information          ]
23  
-/* ************************************************************
24  
- * 
25  
- *    Copyright (c) 2010 Attila Kiskó, enyim.com
26  
- *    
27  
- *    Licensed under the Apache License, Version 2.0 (the "License");
28  
- *    you may not use this file except in compliance with the License.
29  
- *    You may obtain a copy of the License at
30  
- *    
31  
- *        http://www.apache.org/licenses/LICENSE-2.0
32  
- *    
33  
- *    Unless required by applicable law or agreed to in writing, software
34  
- *    distributed under the License is distributed on an "AS IS" BASIS,
35  
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
36  
- *    See the License for the specific language governing permissions and
37  
- *    limitations under the License.
38  
- *    
39  
- * ************************************************************/
40  
-#endregion
44  Membase/Configuration/DefaultPerformanceMonitorFactory.cs
... ...
@@ -1,44 +0,0 @@
1  
-using System;
2  
-using System.Collections.Generic;
3  
-using System.Net;
4  
-using Enyim.Caching.Configuration;
5  
-using Enyim.Caching.Memcached;
6  
-
7  
-namespace Membase.Configuration
8  
-{
9  
-	public class DefaultPerformanceMonitorFactory : IMembasePerformanceMonitorFactory
10  
-	{
11  
-		private string prefix;
12  
-
13  
-		IPerformanceMonitor IMembasePerformanceMonitorFactory.Create(string bucket)
14  
-		{
15  
-			return new DefaultPerformanceMonitor(this.prefix + (String.IsNullOrEmpty(bucket) ? "default" : bucket));
16  
-		}
17  
-
18  
-		void IProvider.Initialize(Dictionary<string, string> parameters)
19  
-		{
20  
-			if (parameters != null)
21  
-				parameters.TryGetValue("prefix", out this.prefix);
22  
-		}
23  
-	}
24  
-}
25  
-
26  
-#region [ License information          ]
27  
-/* ************************************************************
28  
- * 
29  
- *    Copyright (c) 2010 Attila Kiskó, enyim.com
30  
- *    
31  
- *    Licensed under the Apache License, Version 2.0 (the "License");
32  
- *    you may not use this file except in compliance with the License.
33  
- *    You may obtain a copy of the License at
34  
- *    
35  
- *        http://www.apache.org/licenses/LICENSE-2.0
36  
- *    
37  
- *    Unless required by applicable law or agreed to in writing, software
38  
- *    distributed under the License is distributed on an "AS IS" BASIS,
39  
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
40  
- *    See the License for the specific language governing permissions and
41  
- *    limitations under the License.
42  
- *    
43  
- * ************************************************************/
44  
-#endregion
75  Membase/Configuration/IMembaseClientConfiguration.cs
... ...
@@ -1,75 +0,0 @@
1  
-using System;
2  
-using System.Collections.Generic;
3  
-using System.Net;
4  
-using Enyim.Caching.Configuration;
5  
-using Enyim.Caching.Memcached;
6  
-
7  
-namespace Membase.Configuration
8  
-{
9  
-	public interface IMembaseClientConfiguration
10  
-	{
11  
-		/// <summary>
12  
-		/// Gets the name of the bucket to be used. If not specified the "default" bucket will be used.
13  
-		/// </summary>
14  
-		string Bucket { get; }
15  
-
16  
-		/// <summary>
17  
-		/// Gets the pasword used to connect to the bucket.
18  
-		/// </summary>
19  
-		/// <remarks> If null, the bucket name will be used. Set to String.Empty to use an empty password.</remarks>
20  
-		string BucketPassword { get; }
21  
-
22  
-		/// <summary>
23  
-		/// Gets a list of <see cref="T:IPEndPoint"/> each representing a Memcached server in the pool.
24  
-		/// </summary>
25  
-		IList<Uri> Urls { get; }
26  
-
27  
-		/// <summary>
28  
-		/// Gets the configuration of the socket pool.
29  
-		/// </summary>
30  
-		ISocketPoolConfiguration SocketPool { get; }
31  
-
32  
-		/// <summary>
33  
-		/// Creates an <see cref="T:Enyim.Caching.Memcached.IMemcachedKeyTransformer"/> instance which will be used to convert item keys for Memcached.
34  
-		/// </summary>
35  
-		IMemcachedKeyTransformer CreateKeyTransformer();
36  
-
37  
-		/// <summary>
38  
-		/// Creates an <see cref="T:Enyim.Caching.Memcached.IMemcachedNodeLocator"/> instance which will be used to assign items to Memcached nodes.
39  
-		/// </summary>
40  
-		IMemcachedNodeLocator CreateNodeLocator();
41  
-
42  
-		/// <summary>
43  
-		/// Creates an <see cref="T:Enyim.Caching.Memcached.ITranscoder"/> instance which will be used to serialize or deserialize items.
44  
-		/// </summary>
45  
-		ITranscoder CreateTranscoder();
46  
-
47  
-		/// <summary>
48  
-		/// Creates an <see cref="T:Enyim.Caching.Memcached.IPerformanceMonitor"/> instance which will be used to monitor the performance of the client.
49  
-		/// </summary>
50  
-		IPerformanceMonitor CreatePerformanceMonitor();
51  
-
52  
-		TimeSpan RetryTimeout { get; }
53  
-		int RetryCount { get; }
54  
-	}
55  
-}
56  
-
57  
-#region [ License information          ]
58  
-/* ************************************************************
59  
- * 
60  
- *    Copyright (c) 2010 Attila Kiskó, enyim.com
61  
- *    
62  
- *    Licensed under the Apache License, Version 2.0 (the "License");
63  
- *    you may not use this file except in compliance with the License.
64  
- *    You may obtain a copy of the License at
65  
- *    
66  
- *        http://www.apache.org/licenses/LICENSE-2.0
67  
- *    
68  
- *    Unless required by applicable law or agreed to in writing, software
69  
- *    distributed under the License is distributed on an "AS IS" BASIS,
70  
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
71  
- *    See the License for the specific language governing permissions and
72  
- *    limitations under the License.
73  
- *    
74  
- * ************************************************************/
75  
-#endregion
33  Membase/Configuration/IMembasePerformanceMonitorFactory.cs
... ...
@@ -1,33 +0,0 @@
1  
-using System;
2  
-using System.Collections.Generic;
3  
-using System.Net;
4  
-using Enyim.Caching.Configuration;
5  
-using Enyim.Caching.Memcached;
6  
-
7  
-namespace Membase.Configuration
8  
-{
9  
-	public interface IMembasePerformanceMonitorFactory: IProvider
10  
-	{
11  
-		IPerformanceMonitor Create(string bucket);
12  
-	}
13  
-}
14  
-
15  
-#region [ License information          ]
16  
-/* ************************************************************
17  
- * 
18  
- *    Copyright (c) 2010 Attila Kiskó, enyim.com
19  
- *    
20  
- *    Licensed under the Apache License, Version 2.0 (the "License");
21  
- *    you may not use this file except in compliance with the License.
22  
- *    You may obtain a copy of the License at
23  
- *    
24  
- *        http://www.apache.org/licenses/LICENSE-2.0
25  
- *    
26  
- *    Unless required by applicable law or agreed to in writing, software
27  
- *    distributed under the License is distributed on an "AS IS" BASIS,
28  
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29  
- *    See the License for the specific language governing permissions and
30  
- *    limitations under the License.
31  
- *    
32  
- * ************************************************************/
33  
-#endregion
293  Membase/Configuration/MembaseClientConfiguration.cs
... ...
@@ -1,293 +0,0 @@
1  
-using System;
2  
-using System.Linq;
3  
-using System.Collections.Generic;
4  
-using System.Net;
5  
-using Enyim.Caching.Configuration;
6  
-using Enyim.Caching.Memcached;
7  
-using Enyim.Reflection;
8  
-
9  
-namespace Membase.Configuration
10  
-{
11  
-	/// <summary>
12  
-	/// Configuration class
13  
-	/// </summary>
14  
-	public class MembaseClientConfiguration : IMembaseClientConfiguration
15  
-	{
16  
-		private Type nodeLocator;
17  
-		private ITranscoder transcoder;
18  
-		private IMemcachedKeyTransformer keyTransformer;
19  
-
20  
-		/// <summary>
21  
-		/// Initializes a new instance of the <see cref="T:MemcachedClientConfiguration"/> class.
22  
-		/// </summary>
23  
-		public MembaseClientConfiguration()
24  
-		{
25  
-			this.Urls = new List<Uri>();
26  
-
27  
-			this.SocketPool = new SocketPoolConfiguration();
28  
-		}
29  
-
30  
-		/// <summary>
31  
-		/// Gets or sets the name of the bucket to be used. Can be overriden at the pool's constructor, and if not specified the "default" bucket will be used.
32  
-		/// </summary>
33  
-		public string Bucket { get; set; }
34  
-
35  
-		/// <summary>
36  
-		/// Gets or sets the pasword used to connect to the bucket.
37  
-		/// </summary>
38  
-		/// <remarks> If null, the bucket name will be used. Set to String.Empty to use an empty password.</remarks>
39  
-		public string BucketPassword { get; set; }
40  
-
41  
-		/// <summary>
42  
-		/// Gets a list of <see cref="T:IPEndPoint"/> each representing a Memcached server in the pool.
43  
-		/// </summary>
44  
-		public IList<Uri> Urls { get; private set; }
45  
-
46  
-		[Obsolete("Please use the bucket name&password for specifying credentials. This property has no use now, and will be completely removed in the next version.", true)]
47  
-		public NetworkCredential Credentials { get; set; }
48  
-
49  
-		/// <summary>
50  
-		/// Gets the configuration of the socket pool.
51  
-		/// </summary>
52  
-		public ISocketPoolConfiguration SocketPool { get; private set; }
53  
-
54  
-		/// <summary>
55  
-		/// Gets or sets the <see cref="T:Enyim.Caching.Memcached.IMemcachedKeyTransformer"/> which will be used to convert item keys for Memcached.
56  
-		/// </summary>
57  
-		public IMemcachedKeyTransformer KeyTransformer
58  
-		{
59  
-			get { return this.keyTransformer ?? (this.keyTransformer = new DefaultKeyTransformer()); }
60  
-			set { this.keyTransformer = value; }
61  
-		}
62  
-
63  
-		/// <summary>
64  
-		/// Gets or sets the Type of the <see cref="T:Enyim.Caching.Memcached.IMemcachedNodeLocator"/> which will be used to assign items to Memcached nodes.
65  
-		/// </summary>
66  
-		/// <remarks>If both <see cref="M:NodeLocator"/> and  <see cref="M:NodeLocatorFactory"/> are assigned then the latter takes precedence.</remarks>
67  
-		public Type NodeLocator
68  
-		{
69  
-			get { return this.nodeLocator; }
70  
-			set
71  
-			{
72  
-				ConfigurationHelper.CheckForInterface(value, typeof(IMemcachedNodeLocator));
73  
-				this.nodeLocator = value;
74  
-			}
75  
-		}
76  
-
77  
-		/// <summary>
78  
-		/// Gets or sets the NodeLocatorFactory instance which will be used to create a new IMemcachedNodeLocator instances.
79  
-		/// </summary>
80  
-		/// <remarks>If both <see cref="M:NodeLocator"/> and  <see cref="M:NodeLocatorFactory"/> are assigned then the latter takes precedence.</remarks>
81  
-		public IProviderFactory<IMemcachedNodeLocator> NodeLocatorFactory { get; set; }
82  
-
83  
-		/// <summary>
84  
-		/// Gets or sets the <see cref="T:Enyim.Caching.Memcached.ITranscoder"/> which will be used serialzie or deserialize items.
85  
-		/// </summary>
86  
-		public ITranscoder Transcoder
87  
-		{
88  
-			get { return this.transcoder ?? (this.transcoder = new DefaultTranscoder()); }
89  
-			set { this.transcoder = value; }
90  
-		}
91  
-
92  
-		/// <summary>
93  
-		/// Gets or sets the <see cref="T:Enyim.Caching.Memcached.IPerformanceMonitor"/> instance which will be used monitor the performance of the client.
94  
-		/// </summary>
95  
-		public IMembasePerformanceMonitorFactory PerformanceMonitorFactory { get; set; }
96  
-
97  
-		public int RetryCount { get; set; }
98  
-		public TimeSpan RetryTimeout { get; set; }
99  
-
100  
-		#region [ interface                     ]
101  
-
102  
-		IList<Uri> IMembaseClientConfiguration.Urls
103  
-		{
104  
-			get { return this.Urls; }
105  
-		}
106  
-
107  
-		ISocketPoolConfiguration IMembaseClientConfiguration.SocketPool
108  
-		{
109  
-			get { return this.SocketPool; }
110  
-		}
111  
-
112  
-		IMemcachedKeyTransformer IMembaseClientConfiguration.CreateKeyTransformer()
113  
-		{
114  
-			return this.KeyTransformer;
115  
-		}
116  
-
117  
-		IMemcachedNodeLocator IMembaseClientConfiguration.CreateNodeLocator()
118  
-		{
119  
-			var f = this.NodeLocatorFactory;
120  
-			if (f != null) return f.Create();
121  
-
122  
-			return this.NodeLocator == null
123  
-					? new KetamaNodeLocator()
124  
-					: (IMemcachedNodeLocator)FastActivator.Create(this.NodeLocator);
125  
-		}
126  
-
127  
-		ITranscoder IMembaseClientConfiguration.CreateTranscoder()
128  
-		{
129  
-			return this.Transcoder;
130  
-		}
131  
-
132  
-		string IMembaseClientConfiguration.Bucket
133  
-		{
134  
-			get { return this.Bucket; }
135  
-		}
136  
-
137  
-		int IMembaseClientConfiguration.RetryCount
138  
-		{
139  
-			get { return this.RetryCount; }
140  
-		}
141  
-
142  
-		TimeSpan IMembaseClientConfiguration.RetryTimeout
143  
-		{
144  
-			get { return this.RetryTimeout; }
145  
-		}
146  
-
147  
-		string IMembaseClientConfiguration.BucketPassword
148  
-		{
149  
-			get { return this.BucketPassword; }
150  
-		}
151  
-
152  
-		IPerformanceMonitor IMembaseClientConfiguration.CreatePerformanceMonitor()
153  
-		{
154  
-			return this.PerformanceMonitorFactory == null
155  
-					? null
156  
-					: this.PerformanceMonitorFactory.Create(this.Bucket);
157  
-		}
158  
-
159  
-		#endregion
160  
-	}
161  
-
162  
-	internal class ReadOnlyConfig : IMembaseClientConfiguration
163  
-	{
164  
-		private string bucket;
165  
-		private string bucketPassword;
166  
-		private Uri[] urls;
167  
-		private TimeSpan retryTimeout;
168  
-		private int retryCount;
169  
-		private ISocketPoolConfiguration spc;
170  
-
171  
-		private IMembaseClientConfiguration original;
172  
-
173  
-		public ReadOnlyConfig(IMembaseClientConfiguration original)
174  
-		{
175  
-			this.bucket = original.Bucket;
176  
-			this.bucketPassword = original.BucketPassword;
177  
-			this.urls = original.Urls.ToArray();
178  
-
179  
-			this.retryCount = original.RetryCount;
180  
-			this.retryTimeout = original.RetryTimeout;
181  
-
182  
-			this.spc = new SPC(original.SocketPool);
183  
-
184  
-			this.original = original;
185  
-		}
186  
-
187  
-		public void OverrideBucket(string bucketName, string bucketPassword)
188  
-		{
189  
-			this.bucket = bucketName;
190  
-			this.bucketPassword = bucketPassword;
191  
-		}
192  
-
193  
-		string IMembaseClientConfiguration.Bucket
194  
-		{
195  
-			get { return this.bucket; }
196  
-		}
197  
-
198  
-		string IMembaseClientConfiguration.BucketPassword
199  
-		{
200  
-			get { return this.bucketPassword; }
201  
-		}
202  
-
203  
-		IList<Uri> IMembaseClientConfiguration.Urls
204  
-		{
205  
-			get { return this.urls; }
206  
-		}
207  
-
208  
-		ISocketPoolConfiguration IMembaseClientConfiguration.SocketPool
209  
-		{
210  
-			get { return this.spc; }
211  
-		}
212  
-
213  
-		IMemcachedKeyTransformer IMembaseClientConfiguration.CreateKeyTransformer()
214  
-		{
215  
-			return this.original.CreateKeyTransformer();
216  
-		}
217  
-
218  
-		IMemcachedNodeLocator IMembaseClientConfiguration.CreateNodeLocator()
219  
-		{
220  
-			return this.original.CreateNodeLocator();
221  
-		}
222  
-
223  
-		ITranscoder IMembaseClientConfiguration.CreateTranscoder()
224  
-		{
225  
-			return this.original.CreateTranscoder();
226  
-		}
227  
-
228  
-		IPerformanceMonitor IMembaseClientConfiguration.CreatePerformanceMonitor()
229  
-		{
230  
-			return this.original.CreatePerformanceMonitor();
231  
-		}
232  
-
233  
-		TimeSpan IMembaseClientConfiguration.RetryTimeout
234  
-		{
235  
-			get { return this.retryTimeout; }
236  
-		}
237  
-
238  
-		int IMembaseClientConfiguration.RetryCount
239  
-		{
240  
-			get { return this.retryCount; }
241  
-		}
242  
-
243  
-		private class SPC : ISocketPoolConfiguration
244  
-		{
245  
-			private TimeSpan connectionTimeout;
246  
-			private TimeSpan deadTimeout;
247  
-			private int maxPoolSize;
248  
-			private int minPoolSize;
249  
-			private TimeSpan queueTimeout;
250  
-			private TimeSpan receiveTimeout;
251  
-			private INodeFailurePolicyFactory fpf;
252  
-
253  
-			public SPC(ISocketPoolConfiguration original)
254  
-			{
255  
-				this.connectionTimeout = original.ConnectionTimeout;
256  
-				this.deadTimeout = original.DeadTimeout;
257  
-				this.maxPoolSize = original.MaxPoolSize;
258  
-				this.minPoolSize = original.MinPoolSize;
259  
-				this.queueTimeout = original.QueueTimeout;
260  
-				this.receiveTimeout = original.ReceiveTimeout;
261  
-				this.fpf = original.FailurePolicyFactory;
262  
-			}
263  
-
264  
-			int ISocketPoolConfiguration.MinPoolSize { get { return this.minPoolSize; } set { } }
265  
-			int ISocketPoolConfiguration.MaxPoolSize { get { return this.maxPoolSize; } set { } }
266  
-			TimeSpan ISocketPoolConfiguration.ConnectionTimeout { get { return this.connectionTimeout; } set { } }
267  
-			TimeSpan ISocketPoolConfiguration.QueueTimeout { get { return this.queueTimeout; } set { } }
268  
-			TimeSpan ISocketPoolConfiguration.ReceiveTimeout { get { return this.receiveTimeout; } set { } }
269  
-			TimeSpan ISocketPoolConfiguration.DeadTimeout { get { return this.deadTimeout; } set { } }
270  
-			INodeFailurePolicyFactory ISocketPoolConfiguration.FailurePolicyFactory { get { return this.fpf; } set { } }
271  
-		}
272  
-	}
273  
-}
274  
-
275  
-#region [ License information          ]
276  
-/* ************************************************************
277  
- * 
278  
- *    Copyright (c) 2010 Attila Kiskó, enyim.com
279  
- *    
280  
- *    Licensed under the Apache License, Version 2.0 (the "License");
281  
- *    you may not use this file except in compliance with the License.
282  
- *    You may obtain a copy of the License at
283  
- *    
284  
- *        http://www.apache.org/licenses/LICENSE-2.0
285  
- *    
286  
- *    Unless required by applicable law or agreed to in writing, software
287  
- *    distributed under the License is distributed on an "AS IS" BASIS,
288  
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
289  
- *    See the License for the specific language governing permissions and
290  
- *    limitations under the License.
291  
- *    
292  
- * ************************************************************/
293  
-#endregion
169  Membase/Configuration/MembaseClientSection.cs
... ...
@@ -1,169 +0,0 @@
1  
-using System;
2  
-using System.Collections.Generic;
3  
-using System.ComponentModel;
4  
-using System.Configuration;
5  
-using System.Net;
6  
-using System.Web.Configuration;
7  
-using Enyim.Caching.Configuration;
8  
-using Enyim.Caching.Memcached;
9  
-
10  
-namespace Membase.Configuration
11  
-{
12  
-	/// <summary>
13  
-	/// Configures the <see cref="T:MembaseClient"/>. This class cannot be inherited.
14  
-	/// </summary>
15  
-	public class MembaseClientSection : ConfigurationSection, IMembaseClientConfiguration
16  
-	{
17  
-		[ConfigurationProperty("servers", IsRequired = true)]
18  
-		public ServersElement Servers
19  
-		{
20  
-			get { return (ServersElement)base["servers"]; }
21  
-			set { base["servers"] = value; }
22  
-		}
23  
-
24  
-		/// <summary>
25  
-		/// Gets or sets the configuration of the socket pool.
26  
-		/// </summary>
27  
-		[ConfigurationProperty("socketPool", IsRequired = false)]
28  
-		public SocketPoolElement SocketPool
29  
-		{
30  
-			get { return (SocketPoolElement)base["socketPool"]; }
31  
-			set { base["socketPool"] = value; }
32  
-		}
33  
-
34  
-		/// <summary>
35  
-		/// Gets or sets the <see cref="T:Enyim.Caching.Memcached.IMemcachedNodeLocator"/> which will be used to assign items to Memcached nodes.
36  
-		/// </summary>
37  
-		[ConfigurationProperty("locator", IsRequired = false)]
38  
-		public ProviderElement<IMemcachedNodeLocator> NodeLocator
39  
-		{
40  
-			get { return (ProviderElement<IMemcachedNodeLocator>)base["locator"]; }
41  
-			set { base["locator"] = value; }
42  
-		}
43  
-
44  
-		/// <summary>
45  
-		/// Gets or sets the <see cref="T:Enyim.Caching.Memcached.IMemcachedKeyTransformer"/> which will be used to convert item keys for Memcached.
46  
-		/// </summary>
47  
-		[ConfigurationProperty("keyTransformer", IsRequired = false)]
48  
-		public ProviderElement<IMemcachedKeyTransformer> KeyTransformer
49  
-		{
50  
-			get { return (ProviderElement<IMemcachedKeyTransformer>)base["keyTransformer"]; }
51  
-			set { base["keyTransformer"] = value; }
52  
-		}
53  
-
54  
-		/// <summary>
55  
-		/// Gets or sets the <see cref="T:Enyim.Caching.Memcached.ITranscoder"/> which will be used serialize or deserialize items.
56  
-		/// </summary>