Example usage for com.liferay.portal.kernel.poller.comet CometException CometException

List of usage examples for com.liferay.portal.kernel.poller.comet CometException CometException

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.poller.comet CometException CometException.

Prototype

public CometException(Throwable cause) 

Source Link

Usage

From source file:com.liferay.support.tomcat.poller.comet.CatalinaCometResponse.java

License:Open Source License

public void writeData(byte[] data) throws CometException {
    synchronized (this) {
        if (!_open) {
            throw new CometException("Stream is closed");
        }//from   www  . ja  v  a  2  s  .com

        try {
            OutputStream outputStream = _response.getOutputStream();

            outputStream.write(data);

            outputStream.flush();
        } catch (IOException ioe) {
            throw new CometException(ioe);
        }
    }
}

From source file:com.liferay.support.tomcat.poller.comet.CatalinaCometResponse.java

License:Open Source License

public void writeData(String data) throws CometException {
    synchronized (this) {
        if (!_open) {
            throw new CometException("Writer is closed");
        }/*from www  .j a  v a  2  s  .com*/

        try {
            Writer writer = _response.getWriter();

            writer.write(data);

            writer.flush();
        } catch (IOException ioe) {
            throw new CometException(ioe);
        }
    }
}