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:
@@ -147,11 +147,6 @@ public class ActiveXComponent extends Dispatch {
|
||||
super.finalize();
|
||||
}
|
||||
|
||||
static {
|
||||
System.loadLibrary("jacob");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*============================================================
|
||||
*
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -168,7 +168,4 @@ public class DispatchEvents extends JacobObject {
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
System.loadLibrary("jacob");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -875,8 +875,4 @@ public class SafeArray extends JacobObject {
|
||||
*/
|
||||
public native void setBoolean(int indices[], boolean c);
|
||||
|
||||
static {
|
||||
System.loadLibrary("jacob");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user