// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/EPaperClient.java
// public interface EPaperClient extends Closeable {
// 	static final int WIDTH = 800;
// 
// 	static final int HEIGHT = 600;
// 
// 	void drawImage(int x, int y, InputStream inputStream) throws IOException, EPaperException;
// 
// 	void refreshAndUpdate() throws IOException, EPaperException;
// 
// 	void clear() throws IOException, EPaperException;
// 
// 	void drawPoint(int x, int y) throws IOException, EPaperException;
// 
// 	void drawLine(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void drawRectangle(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void drawTable(int x0, int y0, int x1, int y1, Table table) throws IOException, EPaperException;
// 
// 	void fillRectangle(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void displayText(int x, int y, String text) throws IOException, EPaperException;
// 
// 	void displayText(int x0, int y0, int x1, int y1, FontSize fontSize, int lineSpacing,
// 			HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, String text)
// 			throws IOException, EPaperException;
// 
// 	DrawingColors getDrawingColors() throws IOException, EPaperException;
// 
// 	void setDrawingColors(DrawingColors drawingColors) throws IOException, EPaperException;
// 
// 	FontSize getFontSize() throws IOException, EPaperException;
// 
// 	void setFontSize(FontSize fontSize) throws IOException, EPaperException;
// 
// 	void setDisplayDirection(DisplayDirection displayDirection) throws IOException, EPaperException;
// 
// 	DisplayDirection getDisplayDirection() throws IOException, EPaperException;
// }
// 
// Path: e-paper-jaxb-api/src/main/java/fr/romainmoreau/epaper/jaxb/api/Command.java
// public interface Command {
// 	void execute(EPaperClient ePaperClient) throws IOException, EPaperException;
// }
// 
// Path: e-paper-jaxb-api/src/main/java/fr/romainmoreau/epaper/jaxb/api/Commands.java
// @XmlRootElement
// public class Commands {
// 	private List<Command> commands;
// 
// 	@XmlElements({ @XmlElement(name = "clear", type = Clear.class),
// 			@XmlElement(name = "setDrawingColors", type = SetDrawingColors.class),
// 			@XmlElement(name = "setDisplayDirection", type = SetDisplayDirection.class),
// 			@XmlElement(name = "setFontSize", type = SetFontSize.class),
// 			@XmlElement(name = "drawLine", type = DrawLine.class),
// 			@XmlElement(name = "drawRectangle", type = DrawRectangle.class),
// 			@XmlElement(name = "drawPoint", type = DrawPoint.class),
// 			@XmlElement(name = "drawTable", type = DrawTable.class),
// 			@XmlElement(name = "fillRectangle", type = FillRectangle.class),
// 			@XmlElement(name = "displayText", type = DisplayText.class),
// 			@XmlElement(name = "displayTextRectangle", type = DisplayTextRectangle.class),
// 			@XmlElement(name = "refreshAndUpdate", type = RefreshAndUpdate.class) })
// 	public List<Command> getCommands() {
// 		return commands;
// 	}
// 
// 	public void setCommands(List<Command> commands) {
// 		this.commands = commands;
// 	}
// }


import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import fr.romainmoreau.epaper.client.api.EPaperClient;
import fr.romainmoreau.epaper.jaxb.api.Command;
import fr.romainmoreau.epaper.jaxb.api.Commands;
package fr.romainmoreau.epaper.web.common;





@Service
public class EPaperWorker {
	private static final Logger LOGGER = LoggerFactory.getLogger(EPaperWorker.class);

	@Autowired
	private EPaperClient ePaperClient;

	private final Thread thread;

// Path: e-paper-client-api/src/main/java/fr/romainmoreau/epaper/client/api/EPaperClient.java
// public interface EPaperClient extends Closeable {
// 	static final int WIDTH = 800;
// 
// 	static final int HEIGHT = 600;
// 
// 	void drawImage(int x, int y, InputStream inputStream) throws IOException, EPaperException;
// 
// 	void refreshAndUpdate() throws IOException, EPaperException;
// 
// 	void clear() throws IOException, EPaperException;
// 
// 	void drawPoint(int x, int y) throws IOException, EPaperException;
// 
// 	void drawLine(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void drawRectangle(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void drawTable(int x0, int y0, int x1, int y1, Table table) throws IOException, EPaperException;
// 
// 	void fillRectangle(int x0, int y0, int x1, int y1) throws IOException, EPaperException;
// 
// 	void displayText(int x, int y, String text) throws IOException, EPaperException;
// 
// 	void displayText(int x0, int y0, int x1, int y1, FontSize fontSize, int lineSpacing,
// 			HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, String text)
// 			throws IOException, EPaperException;
// 
// 	DrawingColors getDrawingColors() throws IOException, EPaperException;
// 
// 	void setDrawingColors(DrawingColors drawingColors) throws IOException, EPaperException;
// 
// 	FontSize getFontSize() throws IOException, EPaperException;
// 
// 	void setFontSize(FontSize fontSize) throws IOException, EPaperException;
// 
// 	void setDisplayDirection(DisplayDirection displayDirection) throws IOException, EPaperException;
// 
// 	DisplayDirection getDisplayDirection() throws IOException, EPaperException;
// }
// 
// Path: e-paper-jaxb-api/src/main/java/fr/romainmoreau/epaper/jaxb/api/Command.java
// public interface Command {
// 	void execute(EPaperClient ePaperClient) throws IOException, EPaperException;
// }
// 
// Path: e-paper-jaxb-api/src/main/java/fr/romainmoreau/epaper/jaxb/api/Commands.java
// @XmlRootElement
// public class Commands {
// 	private List<Command> commands;
// 
// 	@XmlElements({ @XmlElement(name = "clear", type = Clear.class),
// 			@XmlElement(name = "setDrawingColors", type = SetDrawingColors.class),
// 			@XmlElement(name = "setDisplayDirection", type = SetDisplayDirection.class),
// 			@XmlElement(name = "setFontSize", type = SetFontSize.class),
// 			@XmlElement(name = "drawLine", type = DrawLine.class),
// 			@XmlElement(name = "drawRectangle", type = DrawRectangle.class),
// 			@XmlElement(name = "drawPoint", type = DrawPoint.class),
// 			@XmlElement(name = "drawTable", type = DrawTable.class),
// 			@XmlElement(name = "fillRectangle", type = FillRectangle.class),
// 			@XmlElement(name = "displayText", type = DisplayText.class),
// 			@XmlElement(name = "displayTextRectangle", type = DisplayTextRectangle.class),
// 			@XmlElement(name = "refreshAndUpdate", type = RefreshAndUpdate.class) })
// 	public List<Command> getCommands() {
// 		return commands;
// 	}
// 
// 	public void setCommands(List<Command> commands) {
// 		this.commands = commands;
// 	}
// }


// Path: e-paper-web-common/src/main/java/fr/romainmoreau/epaper/web/common/EPaperWorker.java
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import fr.romainmoreau.epaper.client.api.EPaperClient;
import fr.romainmoreau.epaper.jaxb.api.Command;
import fr.romainmoreau.epaper.jaxb.api.Commands;

package fr.romainmoreau.epaper.web.common;





@Service
public class EPaperWorker {
	private static final Logger LOGGER = LoggerFactory.getLogger(EPaperWorker.class);

	@Autowired
	private EPaperClient ePaperClient;

	private final Thread thread;

	private final BlockingQueue<Commands> commandsQueue;