// starts notification bufferization
IlpDefaultDataSource datasource = (IlpDefaultDataSource)
equipment.getDataSource();
datasource.startBatch();
datasource.addObject(newRoot1);
datasource.addObject(newRoot2);
datasource.addObject(newRoot3);
// ends notification bufferization
dataSource.endBatch();
In this example, implicit notifications
arising from additions or removals of child objects will also
be buffered.
The listener is based on the
EquipmentModelEvent class, which defines
the equipment model events. It is divided into four different
types of events:
ROOT_OBJECT_ADDED
,
ROOT_OBJECT_REMOVED
,
CHILDREN_ADDED
and
CHILDREN_REMOVED
. Each type of event corresponds to a specific update. There
are two special types of events,
SERIES_BEGIN
and
SERIES_END
, used to delimit a series of notifications sent after the
model has completed buffered changes. Right after the method
endBatch has been issued, an event of
type
SERIES_BEGIN
is sent to the listeners indicating the beginning of buffered
changes, followed by all the buffered events. Then, an event of
type
SERIES_END
is sent, which indicates the end of buffered notifications.