Programmatical setup example

55 views
Skip to first unread message

Luca T.

unread,
Jul 18, 2012, 7:10:49 AM7/18/12
to quick...@googlegroups.com
Hi everyone!

Is this project alive? Can anybody provide a programmatical example on how to use the server? I'd like to use it in integration tests within a Java environment. 

Cheers,
Luca 

Akshath

unread,
Jul 18, 2012, 7:41:38 AM7/18/12
to quick...@googlegroups.com

Luca

unread,
Jul 20, 2012, 7:14:03 AM7/20/12
to quick...@googlegroups.com
I found more useful to browse the code inside src/main/org/quickcached/QuickCached.java 

The class itself seems just a wrapper around QuickServer, which I was able to replicate as an independent thread. This is the simple solution I adopted: 

class MemcachedDaemon extends Thread {

QuickServer qs;

boolean running;

public MemcachedDaemon(int port) throws AppException {

qs = new QuickServer();

qs.initServer(new Object[]{"conf/QuickCached.xml"});

qs.setPort(port);

}

@Override

public void run() {

running = true;

try {

qs.startServer();

while(running){

Thread.sleep(1000);

}

qs.stopService();

} catch (Exception e) {

e.printStackTrace();

}

}

public void terminate(){

running = false;

}

}


which works well as an external thread for my integration test purposes (and btw seems to much better than j-memcached) 

Cheers,
Luca 
Reply all
Reply to author
Forward
0 new messages