Пример #1
0
  /**
   * Handles adding a new Notification.
   *
   * @param notice The Notification to add.
   * @throws org.exolab.castor.xml.MarshalException if any.
   * @throws org.exolab.castor.xml.ValidationException if any.
   * @throws java.io.IOException if any.
   * @throws java.lang.ClassNotFoundException if any.
   */
  public synchronized void addNotification(final Notification notice)
      throws MarshalException, ValidationException, IOException, ClassNotFoundException {
    // remove any existing notice with the same name
    m_notifications.removeNotification(getNotification(notice.getName()));

    m_notifications.addNotification(notice);
    saveCurrent();
  }
Пример #2
0
 /**
  * removeNotification
  *
  * @param name a {@link java.lang.String} object.
  * @throws org.exolab.castor.xml.MarshalException if any.
  * @throws org.exolab.castor.xml.ValidationException if any.
  * @throws java.io.IOException if any.
  * @throws java.lang.ClassNotFoundException if any.
  */
 public synchronized void removeNotification(final String name)
     throws MarshalException, ValidationException, IOException, ClassNotFoundException {
   m_notifications.removeNotification(getNotification(name));
   saveCurrent();
 }