Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / ServiceModel / System / ServiceModel / Security / NegotiationTokenAuthenticatorStateCache.cs / 1 / NegotiationTokenAuthenticatorStateCache.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Security { using System; using System.ServiceModel; using System.Collections; using System.Runtime.InteropServices; using System.Threading; using System.Diagnostics; sealed class NegotiationTokenAuthenticatorStateCache: TimeBoundedCache where T : NegotiationTokenAuthenticatorState { static int lowWaterMark = 50; static TimeSpan purgingInterval = TimeSpan.FromMinutes(10); TimeSpan cachingSpan; public NegotiationTokenAuthenticatorStateCache(TimeSpan cachingSpan, int maximumCachedState) : base(lowWaterMark, maximumCachedState, null, PurgingMode.TimerBasedPurge, TimeSpan.FromTicks(cachingSpan.Ticks >> 2), true) { this.cachingSpan = cachingSpan; } public void AddState(string context, T state) { DateTime expirationTime = TimeoutHelper.Add(DateTime.UtcNow, this.cachingSpan); bool wasStateAdded = base.TryAddItem(context, state, expirationTime, false); if (!wasStateAdded) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperWarning(new SecurityNegotiationException(SR.GetString(SR.NegotiationStateAlreadyPresent, context))); } } public T GetState(string context) { return (this.GetItem(context) as T); } public void RemoveState(string context) { this.TryRemoveItem(context); } protected override ArrayList OnQuotaReached(Hashtable cacheTable) { throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new QuotaExceededException(SR.GetString(SR.CachedNegotiationStateQuotaReached, this.Capacity))); } protected override void OnRemove(object item) { ((IDisposable)item).Dispose(); base.OnRemove(item); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Clock.cs
- WebPartConnectionsCloseVerb.cs
- StandardOleMarshalObject.cs
- InvokeBase.cs
- Point4D.cs
- HttpPostClientProtocol.cs
- FormsAuthentication.cs
- LocalizabilityAttribute.cs
- XmlEncoding.cs
- assertwrapper.cs
- InternalUserCancelledException.cs
- DynamicQueryableWrapper.cs
- ExpandSegment.cs
- EventToken.cs
- FloatAverageAggregationOperator.cs
- CatalogPartChrome.cs
- NamespaceList.cs
- ProfileManager.cs
- ActivitySurrogateSelector.cs
- hebrewshape.cs
- HttpBrowserCapabilitiesWrapper.cs
- SmiTypedGetterSetter.cs
- ReliableMessagingVersion.cs
- SecurityStandardsManager.cs
- CalendarDataBindingHandler.cs
- SelectionItemPattern.cs
- NgenServicingAttributes.cs
- ReadOnlyMetadataCollection.cs
- CodePageUtils.cs
- LostFocusEventManager.cs
- HtmlControlPersistable.cs
- OneToOneMappingSerializer.cs
- CommandValueSerializer.cs
- PageAsyncTask.cs
- VerificationAttribute.cs
- RewritingSimplifier.cs
- MouseDevice.cs
- TrustManagerMoreInformation.cs
- TagNameToTypeMapper.cs
- WindowsEditBoxRange.cs
- DataGridTable.cs
- AutoSizeToolBoxItem.cs
- VirtualizedCellInfoCollection.cs
- XmlAttribute.cs
- BufferBuilder.cs
- FolderBrowserDialog.cs
- DocumentReferenceCollection.cs
- SafeEventHandle.cs
- CodeGenHelper.cs
- KnownTypes.cs
- ServiceDescriptionData.cs
- SelectionItemProviderWrapper.cs
- CodeGeneratorOptions.cs
- UpdateCommand.cs
- CryptoKeySecurity.cs
- ReachFixedPageSerializerAsync.cs
- WebConfigurationFileMap.cs
- AccessDataSource.cs
- DistributedTransactionPermission.cs
- Keywords.cs
- StructuredProperty.cs
- RequestCache.cs
- SQLInt16.cs
- ArrayList.cs
- EntityTypeEmitter.cs
- LinkClickEvent.cs
- ListViewDeletedEventArgs.cs
- Operand.cs
- OperationCanceledException.cs
- ReadOnlyCollection.cs
- DesignerVerb.cs
- HttpHandlerActionCollection.cs
- unitconverter.cs
- TypeConverterAttribute.cs
- FilterException.cs
- OrthographicCamera.cs
- Registration.cs
- MessageQueueTransaction.cs
- Compiler.cs
- FixedTextPointer.cs
- LogWriteRestartAreaAsyncResult.cs
- XmlDataCollection.cs
- TemplateBindingExtensionConverter.cs
- Registry.cs
- Profiler.cs
- Application.cs
- ConfigurationValues.cs
- ResourceType.cs
- EntityKeyElement.cs
- UserValidatedEventArgs.cs
- ObjectManager.cs
- SystemNetworkInterface.cs
- TablePatternIdentifiers.cs
- ClientFormsAuthenticationCredentials.cs
- DataRowChangeEvent.cs
- HitTestDrawingContextWalker.cs
- UIAgentMonitor.cs
- XmlSortKeyAccumulator.cs
- Literal.cs
- NamedPermissionSet.cs