AP&C API Reference
Static Public Attributes | Properties | List of all members
Apac.ProcessIdentity Class Reference

This class provides a consistant location for applications to retrieve high-level information about a running application instance. It aggregates this information from various sources such as reflection and configuration. It is intended to provide a single source for information needed when creating auditable information, such as a message log that needs to record the initiators of the messages. More...

Static Public Attributes

static readonly string UnknownExe = "Unknown entry assembly"
 A constant value used to denote the name of the entry assembly could not be determined. More...
 
static readonly string DefaultNameFormat = "_{0}_{1}"
 

Properties

static string Hostname [get]
 The hostname used to uniquely identify the process on the network. More...
 
static string Name [get]
 Gets the assigned name for the running process (from application configuration). In the event the configuration doesn't provide this information the a unique value based on the executable path and name will be returned. Because a very common use for this information is in dynamically registering different instances of the same service code with different names, the value returned will be suitable for use as a service name (no restricted characters and of limited length). More...
 
static string DisplayName [get]
 Gets the assigned display name for the running process (from application configuration). In the event the configuration doesn't provide this information no value (empty string) will be returned. More...
 
static string Description [get]
 Gets the assigned description for the running process (from application configuration). In the event the configuration is missing (but not if an existing configuration ommits this value) the executable path will be provided. Because a very common use for this information is in dynamically registering different instances of the same service code with different names, this will help in locating poorly configured instances so they can have better display qualities. More...
 
static string? ExecutablePath [get]
 Gets the full path to the executable hosting the process. More...
 
static string? ExecutableName [get]
 Gets the full name of the executable hosting the process. More...
 
static string? ExecutableVersion [get]
 Gets the file version of the executable hosting the process. More...
 

Detailed Description

This class provides a consistant location for applications to retrieve high-level information about a running application instance. It aggregates this information from various sources such as reflection and configuration. It is intended to provide a single source for information needed when creating auditable information, such as a message log that needs to record the initiators of the messages.

Member Data Documentation

◆ UnknownExe

readonly string Apac.ProcessIdentity.UnknownExe = "Unknown entry assembly"
static

A constant value used to denote the name of the entry assembly could not be determined.

Property Documentation

◆ Description

string Apac.ProcessIdentity.Description
staticget

Gets the assigned description for the running process (from application configuration). In the event the configuration is missing (but not if an existing configuration ommits this value) the executable path will be provided. Because a very common use for this information is in dynamically registering different instances of the same service code with different names, this will help in locating poorly configured instances so they can have better display qualities.

◆ DisplayName

string Apac.ProcessIdentity.DisplayName
staticget

Gets the assigned display name for the running process (from application configuration). In the event the configuration doesn't provide this information no value (empty string) will be returned.

◆ ExecutableName

string? Apac.ProcessIdentity.ExecutableName
staticget

Gets the full name of the executable hosting the process.

◆ ExecutablePath

string? Apac.ProcessIdentity.ExecutablePath
staticget

Gets the full path to the executable hosting the process.

◆ ExecutableVersion

string? Apac.ProcessIdentity.ExecutableVersion
staticget

Gets the file version of the executable hosting the process.

◆ Hostname

string Apac.ProcessIdentity.Hostname
staticget

The hostname used to uniquely identify the process on the network.

◆ Name

string Apac.ProcessIdentity.Name
staticget

Gets the assigned name for the running process (from application configuration). In the event the configuration doesn't provide this information the a unique value based on the executable path and name will be returned. Because a very common use for this information is in dynamically registering different instances of the same service code with different names, the value returned will be suitable for use as a service name (no restricted characters and of limited length).

Due to the limited length allowed for a service name, the default rule for this property (in the event no process identity configuration exists) is to return the hashcode of the executable path with the name of the executable file in this format: {path hash}.{exe file name}. This should prevent collisions when registering similarly mal-configured services while at the same time identifying the service, at least somewhat. To aid in identification, the Description will return the full path of the executable.


The documentation for this class was generated from the following file: