This document is archived and information here might be outdated. Recommended version. |
ArcObjects namespaces > System > ESRI.ArcGIS.esriSystem > Interfaces > IS > IServerEnvironment Interface (ArcObjects .NET 10.4 SDK) |
Provides access to Server configuration information. Note: the IServerEnvironment interface has been superseded byIServerEnvironment2. Please consider using the more recent version.
The methods of IServerEnvironment allow access to the ILog interface and the PropertySet of server configuration properties.
Use this interface to retrieve the server properties and write access to the server logs.
Description | ||
---|---|---|
CurrentJobID | Retrieves current job ID. | |
JobDirectory | Retrieves job directory for given job. | |
JobTracker | Retrieves IJobTracker interface that provides access to members that track and control execution of jobs. | |
Log | Retrieves an ILog interface that can be used to add logging messages. | |
Properties | Retrieves an IProperySet interface that provides access to the server configuration information. |
This interface is primarily used when developing server object extensions. It permits access to an ILog interface which provides a conduit to log messages. It also retrieves the server properties as an IPropertySet interface. This PropertySet can be used to determine various properties, for example, output and input operating system paths, that might be useful to a server object extension programmer.
// Set reference to GUID for esriServer.IServerEnvironment
UID uid=new UIDClass();
uid.Value="32D4C328-E473-4615-922C-63C108F55E60";
// CoCreate an EnvironmentManager and retrieve the IServerEnvironment
IEnvironmentManager environmentManager=new EnvironmentManager() as IEnvironmentManager;
IServerEnvironment serverEnvironment=environmentManager.getEnvironment(uid);
// Get log and server properties.
ILog log=serverEnvironment.Log;
IPropertySet propertySet=serverEnvironment.Properties;
' Set reference to GUID for esriServer.IServerEnvironment
Dim uid As UID=New UIDClass()
uid.Value="32D4C328-E473-4615-922C-63C108F55E60"
' CoCreate an EnvironmentManager and retrieve the IServerEnvironment
Dim environmentManager As IEnvironmentManager=New TryCast(EnvironmentManager(), IEnvironmentManager)
Dim serverEnvironment As IServerEnvironment=environmentManager.getEnvironment(uid)
' Get log and server properties.
Dim log As ILog=serverEnvironment.Log
Dim propertySet As IPropertySet=serverEnvironment.Properties