Function | Package: net.jlinker | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Moderate update since 9.0 release. 8.2 version

## jregister-handler

Arguments: object event handler &key data count

object, the first argument, may be a remote Java reference object used to specialize the Lisp method. object may be `nil` to denote an event not associated with an object.

The value of the handler argument should be a function which will be the handler for the event. The form of the function is given below. handler may be `nil` to delete a handler.

The data argument is any Lisp value. It is passed to the handler function as the first argument in each call.

The count argument may be an integer that specifies the lifetime of the handler or `nil`. A `nil` value specifies a handler that will persist until deleted. A positive integer is decremented after each call. When the value reaches zero, the handler is deleted. For example, a count of 1 defines a handler that will handle one event and then will disappear.

Note that only one handler may be specified for each event and object combination. A new handler definition simply overrides an existing one.

### The template for a handler

A handler function should have an argument list:

Arguments: data object longs strings event seqnum

The arguments to the event handler are the data and object that were used in the call to jregister-handler. The third argument is a sequence of integer values representing the numeric data associated with the event. The fourth argument is a sequence of strings representing the string data associated with the event. The event name is passed so that several events could share the same handler. The seqnum argument is the sequence number assigned to the event by the Java event handler. It may be used to identify events or detect lost events.

The handler functions are called sequentially in a dedicated Lisp process; any Lisp errors during a call are ignored. If `*jlinker-verbose*` is non-`nil` (or if jlinker-init was called with a non-`nil` value for the verbose keyword argument) then a message is printed to the Lisp console when a handler function signals an error.

See jlinker.htm for more information on the jLinker facility.

Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 9.0 Moderate update since 9.0 release. 8.2 version