![JAR search and dependency download from the Maven repository](/logo.png)
net.java.openjdk.cacio.ctc.CTCEventSource Maven / Gradle / Ivy
package net.java.openjdk.cacio.ctc;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;
import sun.awt.peer.cacio.CacioEventSource;
import sun.awt.peer.cacio.managed.EventData;
public class CTCEventSource implements CacioEventSource {
private static CTCEventSource instance;
static CTCEventSource getInstance() {
if (instance == null) {
instance = new CTCEventSource();
}
return instance;
}
private BlockingQueue queue = new LinkedBlockingQueue();
private CTCEventSource() {
// Singleton.
}
@Override
public EventData getNextEvent() throws InterruptedException {
return queue.take();
}
void postEvent(EventData ev) {
queue.offer(ev);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy