Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


18.2.1 Function interface

Organization of this subsection

(1) Description

This interface must be implemented in the user functions used on the EADS servers.

When a user function is initialized, an instance is created. This is a single instance and remains until EADS server termination processing is performed.

(2) Interface name

com.hitachi.software.xeads.func.Function

(3) List of methods

The following table lists and describes the methods provided by the Function interface:

Method name

Description

init()

Implements user function initialization processing.

execute()

Implements user function processing.

destroy()

Implements user function termination processing.

(4) init()

(a) Description

This method implements user function initialization processing.

This method is called when a user function is initialized during startup of an EADS server.

(b) Format

public void init(FunctionContext context)

(c) Parameters

context

Acquires information needed for execution of user functions.

For details about the information needed for execution of user functions, see 18.2.2 FunctionContext interface.

(5) execute()

(a) Description

This method implements user function processing.

This method is called when a user function execution request is issued from the EADS client.

(b) Format

public Object execute(FunctionContext context)

(c) Parameters

context

Acquires information needed for execution of user functions.

For details about the information needed for execution of user functions, see 18.2.2 FunctionContext interface.

(d) Return value

This method returns the results of the user function processing.

The contents of getObject() of the Value interface are returned to the caller when a Value instance is specified for the return value.

(e) Notes

For a user function that is executed in multiple threads, implement this method to be thread-safe.

(6) destroy()

(a) Description

This method implements user function termination processing.

The method is called when a user function is terminated during termination of an EADS server.

(b) Format

public void destroy(FunctionContext context)

(c) Parameters

context

Acquires information needed for execution of user functions.

For details about the information needed for execution of user functions, see 18.2.2 FunctionContext interface.