converting poolserver to java