SYS.ADD_LISTENER

Attach an event listener (an implementation of the EventCallBack interface) to a table.

Syntax

SYS.ADD_LISTENER
(
IN ID VARCHAR(128) NOT NULL, 
IN SCHEMA_NAME VARCHAR(128) NOT NULL, 
IN TABLE_NAME VARCHAR(128) NOT NULL,  
IN FUNCTION_STRING VARCHAR() NOT NULL, 
IN INIT_INFO_STR VARCHAR(), 
IN SERVER_GROUPS VARCHAR()
)
ID
A unique identifier for this listener.
SCHEMA_NAME
The schema of the table to which the listener is added.
TABLE_NAME
Table name to which the listener is added.
FUNCTION_STRING
The fully-qualified class name of the EventCallback implementation.
INIT_INFO_STR
A string of initialization parameter values to pass to the init method of the listener implementation after calling its default constructor.
SERVER_GROUPS
A comma-separated list of server groups on which GemFire XD installs the listener. If this parameter is null, GemFire XD installs the listener to all data stores (GemFire XD members that host data).

Example

The following code adds an example listener implementation to a table.

   Connection conn = getConnection();
   CallableStatement cs = conn
        .prepareCall("CALL SYS.ADD_LISTENER(?,?,?,?,?,?)");
   cs.setString(1, "id");
   cs.setString(2, "test");
   cs.setString(3, "table");
   cs.setString(4, "testpackage.EventCallBackListenerImpl");
   cs.setString(5, "emp.ftable:3");
   cs.setString(6, null);
   cs.execute();