ArcObjects Library Reference (Server)  

IServerObjectManager.CreateServerContext Method

Gets a reference to a server context. The server context can be based on a specified server object configuration, or can be an empty server context if no server object configuration is specified.

[Visual Basic .NET]
Public Function CreateServerContext ( _
    ByVal configName As String, _
    ByVal TypeName As String _
) As IServerContext
[C#]
public IServerContext CreateServerContext (
    string configName,
    string TypeName
);
[C++]
HRESULT CreateServerContext(
  BSTR configName,
  BSTR TypeName,
  IServerContext** context
);
[C++]

Parameters

configName [in]   configName is a parameter of type BSTR TypeName [in]   TypeName is a parameter of type BSTR context [out, retval]

  context is a parameter of type IServerContext

Product Availability

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

Remarks

The CreateServerContext method on IServerObjectManager is used to get a reference to a context on the server. A context is a process managed by the server within which a server object runs. You can use CreateServerContext to create a context based on a server object configuration, or you can create empty contexts soley for the purpose of creating ArcObjects on the fly within the server.

When using CreateServerContext to create a context based on a server object configuration, if the server object configuration is pooled, you may get a reference to a context that is already created and running in the server. When you have completed using that context, it is important to released it explicitly by calling the ReleaseContext method on IServerContext to return it to the pool. When using CreateServerContext to create a context based on a non-pooled server object configuration, or when creating an empty context, a new context is created on the server. You still need to call ReleaseContext when you are finished using it, and the context is destroyed on the server.

 

As of 9.3 some of the possible values for typeName are:

See Also

IServerObjectManager Interface

.NET Samples

Closest facility application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: ClosestFacility_GISServerAPIClass) | Route application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: Route_GISServerAPIClass) | Service area application using the NAServer extension in ArcGIS Server via a GIS server (Code Files: ServiceArea_GISServerAPIClass) |

.NET Related Topics

Connecting to a GIS server | Feature services | Managing application state | Pooling objects with server objects | Server |