public boolean matchRemoteEvent ( final TenantAwareEvent tenantAwareEvent ) { if ( ! ( tenantAwareEvent instanceof RemoteIdEvent ) || entityClass == null || entityIds == null ) { return false ; } final RemoteIdEvent remoteIdEvent = ( RemoteIdEvent ) tenantAwareEvent ; try { final Class < ? > remoteEntityClass = Class . forName ( remoteIdEvent . getEntityClass ( ) ) ; return entityClass . isAssignableFrom ( remoteEntityClass ) && entityIds . contains ( remoteIdEvent . getEntityId ( ) ) ; } catch ( final ClassNotFoundException e ) { LOG . error ( "Entity Class of remoteIdEvent cannot be found" , e ) ; return false ; } }
Checks if the remote event is the same as this UI event . Then maybe you can skip the remote event because it is already executed .