diff options
Diffstat (limited to 'bindings/corba/java')
-rw-r--r-- | bindings/corba/java/Makefile | 7 | ||||
-rw-r--r-- | bindings/corba/java/Makefile.in | 43 | ||||
-rw-r--r-- | bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java | 23 |
3 files changed, 20 insertions, 53 deletions
diff --git a/bindings/corba/java/Makefile b/bindings/corba/java/Makefile index c4ae46c..8b32da1 100644 --- a/bindings/corba/java/Makefile +++ b/bindings/corba/java/Makefile @@ -1,9 +1,10 @@ #CHANGE THESE TO MATCH YOUR SYSTEM TOMCAT_HOME=/opt/tomcat -instdir=${TOMCAT_HOME}/webapps/swordweb +#instdir=${TOMCAT_HOME}/webapps/swordweb # Typically you'll point this to your home directory, e.g. -#instdir=/home/swordweb/livehtml/webapp +instdir=/home/swordweb/livehtml/webapp +#instdir=/home/sword/html #instdir=/home/scribe/src/swordweb/webapp SERVLET_LIB=${TOMCAT_HOME}/lib/servlet-api.jar @@ -30,4 +31,4 @@ clean: rm -rf classes/* install: - cp -a classes/org/ ${instdir}/WEB-INF/classes/ + cp -r classes/org/ ${instdir}/WEB-INF/classes/ diff --git a/bindings/corba/java/Makefile.in b/bindings/corba/java/Makefile.in deleted file mode 100644 index 320afcc..0000000 --- a/bindings/corba/java/Makefile.in +++ /dev/null @@ -1,43 +0,0 @@ - -TOMCAT_HOME = @TOMCAT_HOME@ -VERSION = @VERSION@ -JAVAC = @JAVAC@ -top_srcdir = @top_srcdir@ -top_builddir = @top_builddir@ -INSTALL = @INSTALL@ -JAR = @JAR@ - -#SWORDORBJAR=sword-orb-$(VERSION).jar -SWORDORBJAR=sword-orb.jar - -all: $(SWORDORBJAR) - -src/org/crosswire/sword/orb/SWMgr.java: $(top_builddir)/corba/java/src/org/crosswire/util/Base64.java - idlj -pkgTranslate swordorb org.crosswire.sword.orb -td src $(top_srcdir)/corba/swordorb.idl - -classes/org/crosswire/sword/orb/SwordOrb.class: src/org/crosswire/sword/orb/SWMgr.java - mkdir -p $(top_builddir)/corba/java/classes - $(JAVAC) -classpath ${TOMCAT_HOME}/common/lib/servlet-api.jar -d $(top_builddir)/corba/java/classes -sourcepath src src/org/crosswire/sword/orb/*.java src/org/crosswire/util/*.java - -$(top_builddir)/corba/java/src/org/crosswire/util/Base64.java: - cp -a $(top_srcdir)/corba/java/src . - find . -name .svn|xargs rm -r - -clean: - -rm src/org/crosswire/sword/orb/SW*.java - -rm src/org/crosswire/sword/orb/_SW*.java - -rm src/org/crosswire/sword/orb/Mod*.java - -rm src/org/crosswire/sword/orb/Search*.java - -rm src/org/crosswire/sword/orb/String*.java - -rm -rf classes/* - -rmdir -p src/org/crosswire/sword/orb - -rm $(SWORDORBJAR) - -$(SWORDORBJAR): classes/org/crosswire/sword/orb/SwordOrb.class - $(JAR) cf $(SWORDORBJAR) -C $(top_builddir)/corba/java/classes org - -install: - @INSTALL@ $(SWORDORBJAR) $(TOMCAT_HOME)/common/lib - -uninstall: - -rm $(TOMCAT_HOME)/common/lib/$(SWORDORBJAR) diff --git a/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java b/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java index bde7478..aab6001 100644 --- a/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java +++ b/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java @@ -1,5 +1,10 @@ -/* - * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org) +/****************************************************************************** + * + * SwordOrb.java - + * + * $Id: SwordOrb.java 2833 2013-06-29 06:40:28Z chrislit $ + * + * Copyright 2003-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -35,9 +40,9 @@ import java.util.Properties; public class SwordOrb extends Object implements HttpSessionBindingListener { public static Properties config = null; public static String ORBEXE = "swordorbserver"; - public static final int MAX_REMOTE_ADDR_CONNECTIONS = 20; - public static final int MAX_ACCESS_COUNT_PER_INTERVAL = 10; - public static final long MAX_ACCESS_COUNT_INTERVAL = 10 * 1000; // milliseconds + public static final int MAX_REMOTE_ADDR_CONNECTIONS = 10; + public static final int MAX_ACCESS_COUNT_PER_INTERVAL = 50; + public static final long MAX_ACCESS_COUNT_INTERVAL = 50 * 1000; // milliseconds public static final long BLACKLIST_DURATION = 10 * 60 * 1000; // milliseconds public static final String BIBLES = "Biblical Texts"; public static final String COMMENTARIES = "Commentaries"; @@ -53,7 +58,7 @@ public class SwordOrb extends Object implements HttpSessionBindingListener { public static final int NONE = 0; // set this to your desired debug output level - public static int debugLevel = INFO; + public static int debugLevel = WARN; static void log(int level, String message, Throwable e) { @@ -256,7 +261,11 @@ log(INFO, "No ORB found in session; constructing a new instance", null); session.setAttribute("SwordOrb", orb); } - else throw new Exception("Max Remote Addr Connections from: ["+remoteAddr+"]"); + else { + // recycle oldest orb + orb = orbs.remove(0); + orbs.add(orb); + } } else { log(INFO, "ORB found in session", null); |