All pastes #257005 Raw Edit

Anonymous

public text v1 · immutable
#257005 ·published 2006-11-24 21:54 UTC
rendered paste body
/*
 * CrawlerController.java
 *
 * Created on 24. November 2006, 22:22
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package javaapplication5;

/**
 *
 * @author kj09
 */
public class CrawlerController {
    private int crawlers;
    /** Creates a new instance of CrawlerController */
    public CrawlerController() {
        crawlers=0;
    }
    
     public synchronized void checkin(){
        System.out.println("Crawler is checking in!");
        crawlers++;
    }
    public synchronized void checkout(){
        System.out.println("Crawler is checking out!");
        crawlers--;
    }

    public long getWorkingCrawlers(){
        return(crawlers);
    }
    
}