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
- Material.cs
- ServiceObjectContainer.cs
- ToggleButtonAutomationPeer.cs
- DataGridViewAutoSizeModeEventArgs.cs
- DuplexSecurityProtocolFactory.cs
- FilterableAttribute.cs
- ActivityTypeResolver.xaml.cs
- WebPartPersonalization.cs
- BitmapVisualManager.cs
- BitmapImage.cs
- EntityProviderFactory.cs
- EditorResources.cs
- VisualCollection.cs
- MultilineStringEditor.cs
- Literal.cs
- SqlComparer.cs
- UrlMapping.cs
- RTLAwareMessageBox.cs
- SQLBinary.cs
- unitconverter.cs
- safesecurityhelperavalon.cs
- LayoutDump.cs
- TextCompositionEventArgs.cs
- EditCommandColumn.cs
- InternalConfigConfigurationFactory.cs
- SizeChangedInfo.cs
- WebColorConverter.cs
- ISAPIRuntime.cs
- ColumnMapProcessor.cs
- NamespaceTable.cs
- ViewKeyConstraint.cs
- XmlDataSource.cs
- VariableAction.cs
- CachedFontFamily.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- BufferModeSettings.cs
- ApplicationActivator.cs
- XmlReturnReader.cs
- BinaryFormatter.cs
- IPAddress.cs
- SelectionRange.cs
- CompilerLocalReference.cs
- TextParagraphCache.cs
- ProgramNode.cs
- safemediahandle.cs
- PersonalizationAdministration.cs
- ResourceAttributes.cs
- Function.cs
- DataRecordInternal.cs
- DrawingAttributeSerializer.cs
- SizeConverter.cs
- WebSysDisplayNameAttribute.cs
- XmlEntityReference.cs
- UInt16Converter.cs
- oledbconnectionstring.cs
- CharacterMetricsDictionary.cs
- TTSVoice.cs
- ValidationResults.cs
- RootBrowserWindow.cs
- Condition.cs
- FontWeightConverter.cs
- EventDescriptor.cs
- InvalidComObjectException.cs
- Root.cs
- PtsHost.cs
- UnsafeNativeMethodsMilCoreApi.cs
- RTTrackingProfile.cs
- Attributes.cs
- CaseCqlBlock.cs
- IssuedTokenServiceElement.cs
- UriScheme.cs
- JournalEntryListConverter.cs
- NativeMethods.cs
- GeometryGroup.cs
- FormsAuthenticationConfiguration.cs
- XmlSchemaGroup.cs
- ImportCatalogPart.cs
- ContainerParaClient.cs
- DataGridViewHitTestInfo.cs
- PrintDialog.cs
- sqlser.cs
- ErrorReporting.cs
- SqlProcedureAttribute.cs
- Freezable.cs
- FreezableDefaultValueFactory.cs
- EntityViewGenerationAttribute.cs
- CompiledAction.cs
- MessageDispatch.cs
- SdlChannelSink.cs
- DataServiceEntityAttribute.cs
- HttpListener.cs
- PropVariant.cs
- ListenerElementsCollection.cs
- CriticalHandle.cs
- CompressedStack.cs
- BevelBitmapEffect.cs
- SqlDataSourceEnumerator.cs
- HandlerBase.cs
- FieldBuilder.cs
- Debug.cs