public DiscussionThreadPresenter(ProjectId projectId) {
    view = new DiscussionThreadViewImpl();
    this.projectId = checkNotNull(projectId);

    handlerRegistrationManager.registerHandlerToProject(
        projectId,
        NotePostedEvent.TYPE,
        new NotePostedHandler() {
          @Override
          public void handleNotePosted(NotePostedEvent event) {
            refreshForNotePosted(event);
          }
        });

    handlerRegistrationManager.registerHandlerToProject(
        projectId,
        NoteDeletedEvent.TYPE,
        new NoteDeletedHandler() {
          @Override
          public void handleNoteDeleted(NoteDeletedEvent event) {
            GWT.log("Received delete");
            reload();
          }
        });

    handlerRegistrationManager.registerHandler(
        UserLoggedInEvent.TYPE,
        new UserLoggedInHandler() {
          @Override
          public void handleUserLoggedIn(UserLoggedInEvent event) {}
        });

    handlerRegistrationManager.registerHandler(
        UserLoggedOutEvent.TYPE,
        new UserLoggedOutHandler() {
          @Override
          public void handleUserLoggedOut(UserLoggedOutEvent event) {}
        });
  }
 @Override
 public void dispose() {
   handlerRegistrationManager.removeHandlers();
 }