This document is archived and information here might be outdated.  Recommended version.


IServerEnvironment Interface (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (System)  

IServerEnvironment Interface

Provides access to Server configuration information. Note: the IServerEnvironment interface has been superseded byIServerEnvironment2. Please consider using the more recent version.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The methods of IServerEnvironment allow access to the ILog interface and the PropertySet of server configuration properties.

When To Use

Use this interface to retrieve the server properties and write access to the server logs.

Members

Description
Read-only property CurrentJobID Retrieves current job ID.
Read-only property JobDirectory Retrieves job directory for given job.
Read-only property JobTracker Retrieves IJobTracker interface that provides access to members that track and control execution of jobs.
Read-only property Log Retrieves an ILog interface that can be used to add logging messages.
Read-only property Properties Retrieves an IProperySet interface that provides access to the server configuration information.

Remarks

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.  

[C#]
// 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;

 

[Visual Basic .NET]
' 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