String name = JcrRemotingConstants.RELATION_REMOTE_SESSION_ID;
Object forSessionId = session.getAttribute(name);
// calculate "local" flags
if (forSessionId != null
&& event instanceof AdditionalEventInfo) {
AdditionalEventInfo aei = (AdditionalEventInfo) event;
try {
boolean isLocal = forSessionId.equals(
aei.getSessionAttribute(name));
DomUtil.setAttribute(
bundle, XML_EVENT_LOCAL, null,
Boolean.toString(isLocal));
} catch (UnsupportedRepositoryOperationException ex) {
// optional feature