  public void setEntityContext(EntityContext ctx) {
    log("setEntityContext called (" + id() + ")");
    this.ctx = ctx;
  }

  public void unsetEntityContext() {
    log("BoardBean.unsetEntityContext (" + id() + ")");
    this.ctx = null;
  }

  public boolean isModified() {
    log("isModified(): isDirty = " + (isDirty ? "true" : "false"));
    isDirty = true;
    return isDirty;
  }

  public void setModified(boolean flag) {
    flag = true;
    isDirty = flag;
    log("setModified(): " + id() + (String) (flag ? ": requires saving" 
                         : ": saving not required"));
  }

  private String id() {
    return "" + System.identityHashCode(this) + ", PK = " + 
      (String) ((ctx == null) ? "nullctx" 
                 : ((ctx.getPrimaryKey() == null ?
                   "null" : ctx.getPrimaryKey().toString()))) +
                   "; isDirty = " + isDirty;
  }

  public void ejbActivate() {
      log("BoardBean.ejbActivate (" + id() + ")");
  }

  public void ejbPassivate() {
    log("BoardBean.ejbPassivate (" + id() + ")");
  }

  public void ejbLoad() {
    log("BoardBean.ejbLoad (" + id() +  ")");
  }

  public void ejbStore() {
    log("BoardBean.ejbStore (" + id() + ")");

    setModified(true);
  }

  public void ejbRemove()
    throws RemoveException
  {
    log("BoardBean.ejbRemove (" + id() + ")");
  }

  private void log(String s) {
    System.out.println(s);
  } 
