Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / SMSvcHost / System / ServiceModel / Activation / App.cs / 1 / App.cs
//------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
namespace System.ServiceModel.Activation
{
using System;
using System.ServiceModel.Channels;
using System.Collections.Generic;
using System.Diagnostics;
using System.Security.Principal;
using System.ServiceModel;
class App
{
string appKey;
AppPool appPool;
int siteId;
IActivatedMessageQueue messageQueue;
string path;
bool requestBlocked;
bool hasInvalidBinding;
AppAction pendingAction;
internal App(string appKey, string path, int siteId, AppPool appPool, bool requestsBlocked)
: base()
{
Debug.Print("App.ctor(appKey:" + appKey + " path:" + path + " appPoolId:" + appPool.AppPoolId + ")");
this.appKey = appKey;
this.path = path;
this.appPool = appPool;
this.siteId = siteId;
this.requestBlocked = requestsBlocked;
}
internal AppAction PendingAction
{
get
{
return this.pendingAction;
}
}
internal void SetPendingAction(AppAction action)
{
if (action != null)
{
DiagnosticUtility.DebugAssert(this.pendingAction == null, "There is already a pending action.");
}
this.pendingAction = action;
}
internal void RegisterQueue(IActivatedMessageQueue messageQueue)
{
if (this.messageQueue != null)
{
DiagnosticUtility.DebugAssert("a message queue was already registered");
throw DiagnosticUtility.ExceptionUtility.ThrowHelperInternal(false);
}
this.messageQueue = messageQueue;
}
internal string AppKey { get { return appKey; } }
internal AppPool AppPool { get { return appPool; } }
internal int SiteId { get { return siteId; } }
internal IActivatedMessageQueue MessageQueue { get { return messageQueue; } }
internal string Path
{
get
{
return path;
}
set
{
this.path = value;
}
}
internal void OnAppPoolChanged(AppPool newAppPool)
{
this.appPool = newAppPool;
}
internal void SetRequestBlocked(bool requestBlocked)
{
if (this.requestBlocked != requestBlocked)
{
this.requestBlocked = requestBlocked;
OnStateChanged();
}
}
internal void OnAppPoolStateChanged()
{
OnStateChanged();
}
internal void OnDeleted(bool appPoolDeleted)
{
messageQueue.Delete();
}
internal bool IsEnabled
{
get
{
return this.appPool.IsEnabled && !this.requestBlocked && !this.hasInvalidBinding;
}
}
internal void OnInvalidBinding(bool hasInvalidBinding)
{
this.hasInvalidBinding = hasInvalidBinding;
OnStateChanged();
}
void OnStateChanged()
{
messageQueue.SetEnabledState(this.IsEnabled);
}
}
}
// 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
- CqlLexerHelpers.cs
- PolyLineSegment.cs
- RemotingServices.cs
- ParameterDataSourceExpression.cs
- AddressHeader.cs
- PathSegment.cs
- DiagnosticEventProvider.cs
- HttpWriter.cs
- Regex.cs
- MsmqVerifier.cs
- MD5.cs
- DataControlLinkButton.cs
- MulticastNotSupportedException.cs
- TdsRecordBufferSetter.cs
- DataTableNewRowEvent.cs
- MultiView.cs
- Base64Stream.cs
- PropertyGeneratedEventArgs.cs
- DeferrableContentConverter.cs
- SemanticResultValue.cs
- IpcManager.cs
- SrgsGrammarCompiler.cs
- SqlConnectionPoolGroupProviderInfo.cs
- VBCodeProvider.cs
- MetaType.cs
- TransformCollection.cs
- StickyNote.cs
- FormViewModeEventArgs.cs
- RegexMatch.cs
- ObjectContext.cs
- PrintPreviewDialog.cs
- VisualBrush.cs
- Menu.cs
- UTF7Encoding.cs
- PropertyManager.cs
- SignatureDescription.cs
- SafeNativeMethods.cs
- EntityStoreSchemaFilterEntry.cs
- BeginStoryboard.cs
- DataGridViewImageColumn.cs
- GridViewDeleteEventArgs.cs
- DataGridViewCellValidatingEventArgs.cs
- SqlConnectionHelper.cs
- DragEventArgs.cs
- DataGridViewComboBoxCell.cs
- CodeDomDesignerLoader.cs
- TokenBasedSet.cs
- SiteMapSection.cs
- DrawTreeNodeEventArgs.cs
- XmlSchemaValidationException.cs
- MasterPageParser.cs
- CodeTypeParameter.cs
- UpdateCommand.cs
- FormsAuthentication.cs
- QilPatternVisitor.cs
- DataListItemCollection.cs
- CultureInfoConverter.cs
- XmlSerializer.cs
- DataGridCaption.cs
- JpegBitmapEncoder.cs
- PassportAuthenticationEventArgs.cs
- WindowsButton.cs
- FunctionDefinition.cs
- DetailsViewUpdatedEventArgs.cs
- TemplateModeChangedEventArgs.cs
- ViewUtilities.cs
- DrawingGroupDrawingContext.cs
- ElementsClipboardData.cs
- CustomErrorsSection.cs
- StrokeDescriptor.cs
- SamlNameIdentifierClaimResource.cs
- StylusOverProperty.cs
- control.ime.cs
- ContractComponent.cs
- WebServiceResponse.cs
- StylusPlugin.cs
- TextTreeInsertUndoUnit.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- SafeNativeMethods.cs
- HandlerBase.cs
- SharedPersonalizationStateInfo.cs
- Char.cs
- WebResponse.cs
- ColumnMapCopier.cs
- HttpCapabilitiesEvaluator.cs
- StylusShape.cs
- DBDataPermissionAttribute.cs
- UmAlQuraCalendar.cs
- CodeSnippetCompileUnit.cs
- ParseNumbers.cs
- MethodBuilder.cs
- ConfigurationStrings.cs
- MenuEventArgs.cs
- SafeViewOfFileHandle.cs
- EdmProperty.cs
- SafeUserTokenHandle.cs
- FileResponseElement.cs
- CreateUserWizardStep.cs
- OperationCanceledException.cs
- DrawingImage.cs