SF1550628: loadLibrary call mofed to a single location so that folks interested in changing how it works to support applets only has to modify in one location

This commit is contained in:
clay_shooter
2006-09-23 18:10:02 +00:00
parent 3bd2d84f07
commit e5368d39ee
12 changed files with 88 additions and 29 deletions

View File

@@ -1,5 +1,50 @@
<HTML>
<BODY>
<h2>JACOB 1.11</h2>
<h3>What's New</h3>
<ul>
<li>
<b>Build</b>
<ul>
<li>Build process now notifies developer if version property missing
</ul>
</li>
</ul>
<h3>Tracked Changes</h3>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="100%" colspan="2"><b>Bugs</b></td>
</tr>
<tr>
<td width="13%">1550604</td>
<td width="87%">Build process died with confusing error if version not set in properties file</td>
</tr>
<tr>
<td width="13%">&nbsp;</td>
<td width="87%">&nbsp;</td>
</tr>
<tr>
<td width="100%" colspan="2"><b>Patches</b></td>
</tr>
<tr>
<td width="13%">&nbsp;</td>
<td width="87%">&nbsp;</td>
</tr>
<tr>
<td width="100%" colspan="2"><b>Support Requests</b></td>
</tr>
<tr>
<td width="13%">1550628</td>
<td width="87%">Moved all LoadLibrary requests into JacobObject. Classes not subclassed
off of JacobObject make calls to a static method on JacobObject to make sure
DLL is loaded</td>
</tr>
</table>
</ul>
<!---------------------------------------/>
<h2>JACOB 1.10.1</h2>
<h3>What's New</h3>
<ul>

View File

@@ -147,11 +147,6 @@ public class ActiveXComponent extends Dispatch {
super.finalize();
}
static {
System.loadLibrary("jacob");
}
/*============================================================
*

View File

@@ -144,7 +144,11 @@ public abstract class ComThread {
*/
public static native void doCoUninitialize();
/**
* load the Jacob DLL. We do this in case COMThread is called before
* any other reference to one of the JacboObject subclasses is made.
*/
static {
System.loadLibrary("jacob");
JacobObject.loadJacobLibrary();
}
}

View File

@@ -32,10 +32,6 @@ import java.util.Date;
*/
public class Dispatch extends JacobObject
{
static {
System.loadLibrary("jacob");
}
public static final int LOCALE_SYSTEM_DEFAULT = 2048;
public static final int Method = 1;
public static final int Get = 2;

View File

@@ -168,7 +168,4 @@ public class DispatchEvents extends JacobObject {
}
}
static {
System.loadLibrary("jacob");
}
}

View File

@@ -28,12 +28,16 @@ import java.util.Properties;
* create a standard API framework and to facillitate memory management
* for Java and COM memory elements.
* <p>
* All instances of this class and subclasses are automatically manged
* by the ROT. This means the ROT cannot be a subclass of JacobObject.
* <p>
* All COM object created by JACOB extend this class so that we can
* automatically release them when the thread is detached from COM - if we leave
* it to the finalizer it will call the release from another thread, which may
* result in a segmentation violation.
*/
public class JacobObject {
/**
* holds the build version as retrieved from the version.properties
* file that exists in the JAR.
@@ -57,6 +61,16 @@ public class JacobObject {
ROT.addObject(this);
}
/**
*
* loads the jacob library dll
*
*/
protected static void loadJacobLibrary(){
System.loadLibrary("jacob");
}
/**
* Loads version information from version.properties that was
* built as part of this release.
@@ -137,5 +151,13 @@ public class JacobObject {
+ " in thread "+ Thread.currentThread().getName());
}
}
/**
* force the jacob DLL to be loaded whenever this class is referenced
*/
static {
JacobObject.loadJacobLibrary();
}
}

View File

@@ -26,7 +26,4 @@ package com.jacob.com;
* threading model for the java side of the app.
*/
public class MainSTA extends STA {
static {
System.loadLibrary("jacob");
}
}

View File

@@ -217,8 +217,12 @@ public abstract class ROT {
}
}
/**
* ROT can't be a subclass of JacobObject because of the way ROT pools are managed
* so we force a DLL load here by referncing JacobObject
*/
static {
System.loadLibrary("jacob");
JacobObject.loadJacobLibrary();
}
}

View File

@@ -88,7 +88,11 @@ public class STA extends Thread {
*/
public native void quitMessagePump();
/**
* STA isn't a subclass of JacobObject so a reference to it doesn't load
* the DLL without this
*/
static {
System.loadLibrary("jacob");
JacobObject.loadJacobLibrary();
}
}

View File

@@ -875,8 +875,4 @@ public class SafeArray extends JacobObject {
*/
public native void setBoolean(int indices[], boolean c);
static {
System.loadLibrary("jacob");
}
}

View File

@@ -114,7 +114,7 @@ public class Variant extends JacobObject {
/** variant's type is byte */
public static final short VariantByte = 17;
/** @todo */
/** what is this? */
public static final short VariantTypeMask = 4095;
/** variant's type is array */
@@ -821,7 +821,8 @@ public class Variant extends JacobObject {
/**
* returns true if the passed in Variant is a constant that should not be freed
* @param pVariant
* @return
* @return boolian that is true if Variant is a type of constant,
* VT_FALSE, VT_TRUE, VT_MISSING, DEFAULT
*/
protected boolean objectIsAConstant(Variant pVariant){
if (pVariant == VT_FALSE ||
@@ -896,10 +897,6 @@ public class Variant extends JacobObject {
throw new NotImplementedException("Not implemented");
}
static {
System.loadLibrary("jacob");
}
/**
* custom serialization support
* @param oos

View File

@@ -55,10 +55,12 @@ public class ExcelEventTest extends InvocationProxy {
new Object[] { "A1" }, new int[1]).toDispatch();
Dispatch a2 = Dispatch.invoke(sheet, "Range", Dispatch.Get,
new Object[] { "A2" }, new int[1]).toDispatch();
System.out.println("Inserting value into A1");
System.out.println("Inserting calculation 2xA1 into A2");
Dispatch.put(a1, "Value", "123.456");
Dispatch.put(a2, "Formula", "=A1*2");
System.out.println("Retrieved a1 from excel:" + Dispatch.get(a1, "Value"));
System.out.println("REtrieved a2 from excel:" + Dispatch.get(a2, "Value"));
System.out.println("Retrieved a2 from excel:" + Dispatch.get(a2, "Value"));
Variant f = new Variant(false);
Dispatch.call(workbook, "Close", f);
axc.invoke("Quit", new Variant[] {});