Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String id_tile;
- int zoomLvl;
- int x;
- int y;
- byte[] imageInByte;
- String id_photo;
- DataLoader dat = new DataLoader();
- private boolean available = false;
- public synchronized void get() throws IOException, SQLException {
- while (available == false) {
- try {
- wait();
- } catch (InterruptedException e) {
- }
- }
- // метод, который записывает в БД (должен записывать)
- dat.insertToTiles(id_tile, zoomLvl, x, y, imageInByte, id_photo);
- available = false;
- notifyAll();
- }
- public synchronized void put(String id_tile, int zoomLvl, int i, int j, byte[] imageInByte, String id_photo)
- throws IOException {
- while (available == true) {
- try {
- wait();
- } catch (InterruptedException e) {
- }
- }
- this.id_tile = id_tile;
- this.zoomLvl = zoomLvl;
- this.x = i;
- this.y = j;
- this.id_photo = id_photo;
- this.imageInByte = imageInByte;
- available = true;
- notifyAll();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement