[sword-svn] r2066 - in trunk/bindings/corba/java: . src/org/crosswire/sword/orb
scribe at www.crosswire.org
scribe at www.crosswire.org
Thu Aug 30 00:08:28 MST 2007
Author: scribe
Date: 2007-08-30 00:08:28 -0700 (Thu, 30 Aug 2007)
New Revision: 2066
Modified:
trunk/bindings/corba/java/Makefile
trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
Log:
changed orb client to not try to connect if ior hasn't yet been set.
saves a stacktrace in the logs
Modified: trunk/bindings/corba/java/Makefile
===================================================================
--- trunk/bindings/corba/java/Makefile 2007-08-12 13:49:53 UTC (rev 2065)
+++ trunk/bindings/corba/java/Makefile 2007-08-30 07:08:28 UTC (rev 2066)
@@ -1,6 +1,6 @@
TOMCAT_HOME=/opt/tomcat
-SERVLET_LIB=${TOMCAT_HOME}/common/lib/servlet-api.jar
-#SERVLET_LIB=${TOMCAT_HOME}/lib/servlet-api.jar
+#SERVLET_LIB=${TOMCAT_HOME}/common/lib/servlet-api.jar
+SERVLET_LIB=${TOMCAT_HOME}/lib/servlet-api.jar
#instdir=/home/scribe/public_html/
instdir=/home/swordweb/livehtml/webapp
all: src/org/crosswire/sword/orb/SWMgr.java classes/org/crosswire/sword/orb/SwordOrb.class
Modified: trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java
===================================================================
--- trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java 2007-08-12 13:49:53 UTC (rev 2065)
+++ trunk/bindings/corba/java/src/org/crosswire/sword/orb/SwordOrb.java 2007-08-30 07:08:28 UTC (rev 2066)
@@ -27,6 +27,7 @@
public static final String LEXDICTS = "Lexicons / Dictionaries";
public static final String GENBOOKS = "Generic Books";
public static final String DAILYDEVOS = "Daily Devotional";
+
static org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(new String[]{}, null);
static Hashtable clients = new Hashtable();
String ior = null;
@@ -38,6 +39,11 @@
long blacklistTill = 0;
private SWMgr attach() {
+
+ // assert IOR has been set
+ if (ior == null)
+ return null;
+
SWMgr retVal = null;
try {
System.out.println("attaching...");
@@ -47,7 +53,7 @@
retVal.testConnection();
System.out.println("testConnection successful");
}
- catch(Exception e) {
+ catch(Throwable e) {
// e.printStackTrace();
retVal = null;
System.out.println("failed in attach");
@@ -64,6 +70,7 @@
public void finalize () throws Throwable {
// shut down external process
try {
+System.out.println("calling finalize.");
getSWMgrInstance().terminate();
}
catch (Exception e) {} // we know this doesn't return property cuz we killed the orb! :)
@@ -77,9 +84,12 @@
try {
// throw new Exception("value unbound; showing stacktrace");
Vector orbs = (Vector)clients.get(remoteAddr);
+int size = -1;
if (orbs != null) {
- orbs.remove(orb);
+size = orbs.size();
+ orbs.remove(this);
}
+System.out.println("calling valueUnbound. size before: " + size + "; size after: "+orbs.size());
getSWMgrInstance().terminate();
}
catch (Exception e) {} // we know this doesn't return properly cuz we killed the orb! :)
More information about the sword-cvs
mailing list