/*
 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * 
 * $Id: ThrowingEncoder.java 72854 2013-09-12 14:31:02Z supol $
 */

package com.sun.ts.tests.websocket.ee.javax.websocket.remoteendpoint.basic;

import javax.websocket.EncodeException;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;

public class ThrowingEncoder implements Encoder.Text<HolderForThrowingEncoder> {
	static final String ERR_MSG = "Meant TCK EncodeException";

	@Override
	public void init(EndpointConfig config) {
	}

	@Override
	public void destroy() {
	}

	@Override
	public String encode(HolderForThrowingEncoder object)
			throws EncodeException {
		throw new EncodeException(object, ERR_MSG);
	}

}
