All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.refcodes.interceptor.WorkPieceException Maven / Gradle / Ivy

Go to download

With the refcodes-interceptor artifact you can build up assembly lines of any structure; digesting and refining messages (objects) you pass in. In its most basic form, the refcodes-interceptor acts as an interceptor (as of the interceptor pattern).

There is a newer version: 3.1.2
Show newest version
// /////////////////////////////////////////////////////////////////////////////
// REFCODES.ORG
// =============================================================================
// This code is copyright (c) by Siegfried Steiner, Munich, Germany and licensed
// under the following (see "http://en.wikipedia.org/wiki/Multi-licensing")
// licenses:
// =============================================================================
// GNU General Public License, v3.0 ("http://www.gnu.org/licenses/gpl-3.0.html")
// together with the GPL linking exception applied; as being applied by the GNU
// Classpath ("http://www.gnu.org/software/classpath/license.html")
// =============================================================================
// Apache License, v2.0 ("http://www.apache.org/licenses/TEXT-2.0")
// =============================================================================
// Please contact the copyright holding author(s) of the software artifacts in
// question for licensing issues not being covered by the above listed licenses,
// also regarding commercial licensing models or regarding the compatibility
// with other open source licenses.
// /////////////////////////////////////////////////////////////////////////////

package org.refcodes.interceptor;

/**
 * The work piece exception is related to a work piece. Therefore the work piece
 * exception provides access to the work piece in question.
 */
public class WorkPieceException extends InterceptorException implements WorkPieceAccessor {

	private static final long serialVersionUID = 1L;

	private Object _workPiece;

	// /////////////////////////////////////////////////////////////////////////
	// CONSTRUCTORS:
	// /////////////////////////////////////////////////////////////////////////

	/**
	 * Instantiates a new work piece exception.
	 *
	 * @param aWorkPiece the work piece
	 * @param aMessage the message
	 * @param aErrorCode the error code
	 */
	public WorkPieceException( Object aWorkPiece, String aMessage, String aErrorCode ) {
		super( aMessage, aErrorCode );
		_workPiece = aWorkPiece;
	}

	/**
	 * Instantiates a new work piece exception.
	 *
	 * @param aWorkPiece the work piece
	 * @param aMessage the message
	 * @param aCause the cause
	 * @param aErrorCode the error code
	 */
	public WorkPieceException( Object aWorkPiece, String aMessage, Throwable aCause, String aErrorCode ) {
		super( aMessage, aCause, aErrorCode );
		_workPiece = aWorkPiece;
	}

	/**
	 * Instantiates a new work piece exception.
	 *
	 * @param aWorkPiece the work piece
	 * @param message the message
	 * @param cause the cause
	 */
	public WorkPieceException( Object aWorkPiece, String message, Throwable cause ) {
		super( message, cause );
		_workPiece = aWorkPiece;
	}

	/**
	 * Instantiates a new work piece exception.
	 *
	 * @param aWorkPiece the work piece
	 * @param message the message
	 */
	public WorkPieceException( Object aWorkPiece, String message ) {
		super( message );
		_workPiece = aWorkPiece;
	}

	/**
	 * Instantiates a new work piece exception.
	 *
	 * @param aWorkPiece the work piece
	 * @param aCause the cause
	 * @param aErrorCode the error code
	 */
	public WorkPieceException( Object aWorkPiece, Throwable aCause, String aErrorCode ) {
		super( aCause, aErrorCode );
		_workPiece = aWorkPiece;
	}

	/**
	 * Instantiates a new work piece exception.
	 *
	 * @param aWorkPiece the work piece
	 * @param cause the cause
	 */
	public WorkPieceException( Object aWorkPiece, Throwable cause ) {
		super( cause );
		_workPiece = aWorkPiece;
	}

	// /////////////////////////////////////////////////////////////////////////
	// ATTRIBUTES:
	// /////////////////////////////////////////////////////////////////////////

	/**
	 * {@inheritDoc}
	 */
	@Override
	public Object getWorkPiece() {
		return _workPiece;
	}
}