RESOLVED - # 99: Change StringBuffer deleteCharAt() to integer
http://bugs.koc.se/view.php?id=99 Added Base64 decoder
This commit is contained in:
parent
e46ecc1dca
commit
6e890b81e1
8 changed files with 292 additions and 16 deletions
|
|
@ -31,6 +31,7 @@ import java.util.HashMap;
|
|||
import java.util.Map;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
|
|
@ -54,7 +55,7 @@ public class HttpServer extends ThreadedTCPNetworkServer{
|
|||
public final String server_url;
|
||||
public final int server_port;
|
||||
|
||||
private HashMap<String,HttpPage> pages;
|
||||
private Map<String,HttpPage> pages;
|
||||
private HttpPage defaultPage;
|
||||
private Map<String,Map<String,Object>> sessions;
|
||||
private int nextSessionId;
|
||||
|
|
@ -83,12 +84,12 @@ public class HttpServer extends ThreadedTCPNetworkServer{
|
|||
this.server_url = url;
|
||||
this.server_port = port;
|
||||
|
||||
pages = new HashMap<String,HttpPage>();
|
||||
sessions = Collections.synchronizedMap(new HashMap<String,Map<String,Object>>());
|
||||
pages = new ConcurrentHashMap<String,HttpPage>();
|
||||
sessions = new ConcurrentHashMap<String,Map<String,Object>>();
|
||||
nextSessionId = 0;
|
||||
|
||||
Timer timer = new Timer();
|
||||
timer.schedule(new GarbageCollector(), 0, SESSION_TTL / 2);
|
||||
timer.schedule(new GarbageCollector(), 10000, SESSION_TTL / 2);
|
||||
|
||||
logger.info("HTTP"+(keyStore==null?"":"S")+" Server ready!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import zutil.net.ws.WebServiceDef;
|
|||
* This is an factory that generates clients for web services
|
||||
*
|
||||
* @author Ziver
|
||||
* TODO: Incomplete
|
||||
*/
|
||||
public class SOAPClientFactory {
|
||||
|
||||
|
|
|
|||
|
|
@ -94,12 +94,12 @@ public abstract class ThreadedTCPNetworkServer extends Thread{
|
|||
}
|
||||
} catch(Exception e) {
|
||||
logger.log(Level.SEVERE, null, e);
|
||||
}
|
||||
|
||||
if( ss!=null ){
|
||||
try{
|
||||
ss.close();
|
||||
}catch(IOException e){ logger.log(Level.SEVERE, null, e); }
|
||||
} finally {
|
||||
if( ss!=null ){
|
||||
try{
|
||||
ss.close();
|
||||
}catch(IOException e){ logger.log(Level.SEVERE, null, e); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -135,4 +135,12 @@ public abstract class ThreadedTCPNetworkServer extends Thread{
|
|||
System.setProperty("javax.net.ssl.keyStore", keyStore.getAbsolutePath());
|
||||
System.setProperty("javax.net.ssl.keyStorePassword", keyStorePass);
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the server and interrupts its internal thread.
|
||||
* This is a permanent action that will not be able to recover from
|
||||
*/
|
||||
public void close(){
|
||||
this.interrupt();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,5 +132,12 @@ public class ThreadedUDPNetwork extends Thread{
|
|||
this.thread = thread;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Stops the server and interrupts its internal thread.
|
||||
* This is a permanent action that will not be able to recover from
|
||||
*/
|
||||
public void close(){
|
||||
this.interrupt();
|
||||
socket.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue