code: public final void setCommitTrigger(CommitTrigger commitTrigger) {
          if (this.commitTrigger == commitTrigger) {
              return;
          }
          if (this.commitTrigger != null) {
              this.commitTrigger.removeCommitTriggerListener(commitTriggerHandler);
              this.commitTrigger = null;
          }
          if (commitTrigger != null) {
              if (this.commitTriggerHandler == null) {
                  this.commitTriggerHandler = new CommitTriggerHandler();
              }
              this.commitTrigger = commitTrigger;
              this.commitTrigger.addCommitTriggerListener(commitTriggerHandler);
          }
      }
docs: Sets the <code>CommitTrigger</code> that triggers the commit and flush events.
  
  @param commitTrigger  the commit trigger; or null to deregister the
  existing trigger.