Container Binding

When you register a Service Type, an associated Container Binding is created. The Container Binding binds the Service implementation (the library or command) to the Container of the Service (the Engine). The Container Binding describes how to use the implementation.

The binding contains the following fields:

Container Binding Fields

Field

Description

initMethod

Called when a Service Session is first used on an Engine. It is called prior to any requests or updates.

destroyMethod

Called when a Service Session is destroyed.

cancelMethod

Called when the Service is canceled if KILL_CANCELLED_TASKS is false for this Service. Use this field to interrupt the request if the user does not want the Engine to restart on a cancel.

serviceMethods

Methods that perform a request and return a response. These are the actual methods that perform the calculations. Use the * character to denote all methods that are not bound to any other action.

appendStateMethods

Updates state, appending to previous updates.

setStateMethods

Updates state, and flushes the list of previous updates.

You must bind all methods used to one of these methods. All methods are optional except serviceMethods.

The binding also contains the following fields, only applicable to Java, .NET, and R:

Additional Container Binding Fields For Java, .NET, and R

Field

Description

xmlSerialization

Whether to use XML serialization to serialize objects. See Interoperable Types for XML Serialization for more details.

TargetPackage

The package (Java) or namespace (.NET) into which the generated proxy classes are placed. If not set, the default is the name of the Service. This is only necessary when using generated proxies. In this case, if not set, serialization errors might occur.

Note: When you do not set the targetPackage name in the Service Types page and use a generated proxy, deserialization errors occur. To remedy this, edit the Service Type on the Service Types page of the GridServer Administration Tool and assign a value for the targetPackage property.

The binding for R contains the functionInterface field, which is described in R Interoperability.

Python Services need to use the Python Service type. The only other critical step is making certain to set the pythonModule which is the name of the Python file that contains the implementation, without the file extension.