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
- TraceSection.cs
- HtmlControl.cs
- ListenerAdapterBase.cs
- CodeNamespaceImport.cs
- WebHeaderCollection.cs
- BitmapMetadataBlob.cs
- ModulesEntry.cs
- _HTTPDateParse.cs
- MissingMemberException.cs
- TextBoxBase.cs
- Token.cs
- StaticTextPointer.cs
- DesignDataSource.cs
- IDispatchConstantAttribute.cs
- QueryComponents.cs
- SqlUtil.cs
- ResourceSetExpression.cs
- LineBreak.cs
- ComponentConverter.cs
- FontSizeConverter.cs
- FastEncoderStatics.cs
- IBuiltInEvidence.cs
- HtmlValidationSummaryAdapter.cs
- DllNotFoundException.cs
- BasicViewGenerator.cs
- DropDownButton.cs
- CopyOnWriteList.cs
- StringKeyFrameCollection.cs
- HttpHeaderCollection.cs
- LinkedResource.cs
- AdornerPresentationContext.cs
- ImageAnimator.cs
- SHA1CryptoServiceProvider.cs
- RadioButtonAutomationPeer.cs
- XmlSchemaCollection.cs
- MenuRendererClassic.cs
- SQLUtility.cs
- Focus.cs
- ProcessThread.cs
- HttpDebugHandler.cs
- LogSwitch.cs
- MatrixTransform3D.cs
- DbProviderServices.cs
- EndGetFileNameFromUserRequest.cs
- Trigger.cs
- NodeLabelEditEvent.cs
- Condition.cs
- DefaultPrintController.cs
- HttpListenerTimeoutManager.cs
- TileBrush.cs
- ScrollViewer.cs
- IdnElement.cs
- RepeatButton.cs
- IntPtr.cs
- DNS.cs
- DodSequenceMerge.cs
- ZipIOLocalFileDataDescriptor.cs
- TypeConstant.cs
- DateTimeConverter2.cs
- HwndSourceKeyboardInputSite.cs
- SortQuery.cs
- SqlStatistics.cs
- IntPtr.cs
- HtmlElementCollection.cs
- ContextMenuStripActionList.cs
- RightNameExpirationInfoPair.cs
- InputManager.cs
- ApplicationContext.cs
- OneToOneMappingSerializer.cs
- CryptoApi.cs
- ReadWriteObjectLock.cs
- StorageEntitySetMapping.cs
- OdbcConnectionPoolProviderInfo.cs
- EtwTrackingParticipant.cs
- ProcessManager.cs
- ForEach.cs
- X509WindowsSecurityToken.cs
- EDesignUtil.cs
- MULTI_QI.cs
- PersistenceTypeAttribute.cs
- DSASignatureFormatter.cs
- InputScope.cs
- OrthographicCamera.cs
- Convert.cs
- AssemblyContextControlItem.cs
- ConfigXmlAttribute.cs
- SendSecurityHeader.cs
- NamespaceEmitter.cs
- LinkConverter.cs
- CheckBoxAutomationPeer.cs
- PathGeometry.cs
- HiddenField.cs
- DBPropSet.cs
- UnsafeNativeMethods.cs
- WMICapabilities.cs
- ContextMenu.cs
- GetPageCompletedEventArgs.cs
- HandlerMappingMemo.cs
- DataPointer.cs
- ThreadStateException.cs