/*
 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
 * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 * 
 * $Id: OnMessageClientEndpoint.java 74509 2015-05-25 13:33:41Z jsupol $
 */

package com.sun.ts.tests.websocket.negdep.onmessage.client.textduplicate;

import javax.websocket.ClientEndpoint;
import javax.websocket.EndpointConfig;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;

import com.sun.ts.tests.websocket.common.client.AnnotatedStringClientEndpoint;
import com.sun.ts.tests.websocket.common.stringbean.StringBean;
import com.sun.ts.tests.websocket.common.stringbean.StringBeanTextDecoder;

@ClientEndpoint(decoders={StringBeanTextDecoder.class})
public class OnMessageClientEndpoint extends AnnotatedStringClientEndpoint {

	@OnError
	public void onError(Session session, Throwable t) {
		clientEndpoint.onError(session, t);
	}

	@OnMessage
	public void onMessage(String msg, boolean finito) {
		clientEndpoint.onMessage(msg);
	}
	
	@OnMessage
	public void onMessage(StringBean bean) {
		clientEndpoint.onMessage(bean.get());
	}
	

	@OnOpen
	public void onOpen(Session session, EndpointConfig config) {
		clientEndpoint.onOpen(session, config, false);
	}
}
