code: synchronized void stateChanged(Date date, ChannelState state)
      {
          final ChannelStateHistoryEntry historyEntry;
          final ChannelState oldState = this.state;
  
          if (oldState == state)
          {
              return;
          }
  
          // System.err.println(id + " state change: " + oldState + " => " + state
          // + " (" + name + ")");
          historyEntry = new ChannelStateHistoryEntry(date, state);
          synchronized (stateHistory)
          {
              stateHistory.add(historyEntry);
          }
  
          this.state = state;
          firePropertyChange(PROPERTY_STATE, oldState, state);
      }
docs: Changes the state of this channel.
  
  @param date when the state change occurred.
  @param state the new state of this channel.