protected boolean register ( IEventListener listener ) { log . debug ( "register - listener: {}" , listener ) ; boolean registered = listeners . add ( listener ) ; if ( registered ) { listenerStats . increment ( ) ; // prepare response for new client ownerMessage . addEvent ( Type . CLIENT_INITIAL_DATA , null , null ) ; if ( ! isPersistent ( ) ) { ownerMessage . addEvent ( Type . CLIENT_CLEAR_DATA , null , null ) ; } if ( ! attributes . isEmpty ( ) ) { ownerMessage . addEvent ( new SharedObjectEvent ( Type . CLIENT_UPDATE_DATA , null , getAttributes ( ) ) ) ; } // we call notifyModified here to send response if we're not in a beginUpdate block notifyModified ( ) ; } return registered ; }
Register event listener