@@ -0,0 +1,3555 @@
+/*%0A * OpenRemote, the Home of the Digital Home.%0A * Copyright 2008-2014, OpenRemote Inc.%0A *%0A * See the contributors.txt file in the distribution for a%0A * full listing of individual contributors.%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as%0A * published by the Free Software Foundation, either version 3 of the%0A * License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0Apackage org.openremote.exception;%0A%0Aimport java.text.MessageFormat;%0A%0A/**%0A * A common (unchecked) exception super-class for shared functionality.%0A *%0A * @author %3Ca href=%22mailto:juha@openremote.org%22%3EJuha Lindfors%3C/a%3E%0A */%0Apublic class OpenRemoteRuntimeException extends RuntimeException%0A%7B%0A%0A  // TODO : See MODELER-274, ORCJAVA-213%0A%0A  // TODO : Should be moved to a base package once one is created   %5BJPL%5D%0A%0A%0A  // Class Members --------------------------------------------------------------------------------%0A%0A  /**%0A   * Handles the message formatting (and possible errors originating from it).%0A   *%0A   * @param msg     exception message to format%0A   * @param params  exception message parameters -- message parameterization must be%0A   *                compatible with %7B@link java.text.MessageFormat%7D API%0A   *%0A   * @see java.text.MessageFormat%0A   *%0A   * @return  message formatted with given parameters%0A   */%0A  protected static String format(String msg, Object... params)%0A  %7B%0A    try%0A    %7B%0A      return MessageFormat.format(msg, params);%0A    %7D%0A%0A    catch (Throwable t)%0A    %7B%0A      return msg + %22  %5BEXCEPTION MESSAGE FORMATTING ERROR: %22 + t.getMessage().toUpperCase() + %22%5D%22;%0A    %7D%0A  %7D%0A%0A%0A  // Constructors ---------------------------------------------------------------------------------%0A%0A  /**%0A   * Constructs a new exception with a given message.%0A   *%0A   * @param msg  human-readable error message%0A   */%0A  public OpenRemoteRuntimeException(String msg)%0A  %7B%0A    super(msg);%0A  %7D%0A%0A  /**%0A   * Constructs a new exception with a parameterized message.%0A   *%0A   * @param msg     human-readable error message%0A   * @param params  exception message parameters -- message parameterization must be%0A   *                compatible with %7B@link java.text.MessageFormat%7D API%0A   *%0A   * @see java.text.MessageFormat%0A   */%0A  public OpenRemoteRuntimeException(String msg, Object... params)%0A  %7B%0A    super(format(msg, params));%0A  %7D%0A%0A  /**%0A   * Constructs a new exception with a given message and root cause.%0A   *%0A   * @param msg     human-readable error message%0A   * @param cause   root exception cause%0A   */%0A  public OpenRemoteRuntimeException(String msg, Throwable cause)%0A  %7B%0A    super(msg, cause);%0A  %7D%0A%0A  /**%0A   * Constructs a new exception with a parameterized message and root cause.%0A   *%0A   * @param msg     human-readable error message%0A   * @param cause   root exception cause%0A   * @param params  exception message parameters -- message parameterization must be%0A   *                compatible with %7B@link java.text.MessageFormat%7D API%0A   *%0A   * @see java.text.MessageFormat%0A   */%0A  public OpenRemoteRuntimeException(String msg, Throwable cause, Object... params)%0A  %7B%0A    super(format(msg, params), cause);%0A  %7D%0A%0A%7D%0A%0A

add copy of OpenRemote runtime exception into source tree -- should move to a or-base project once it has been established