*not part of the buid*

fix for 82729
r=edburns@acm.org


git-svn-id: svn://10.0.0.236/trunk@96127 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
idk%eng.sun.com
2001-05-31 19:22:09 +00:00
parent f31ee1309b
commit 39d47e72ad
3 changed files with 27 additions and 7 deletions

View File

@@ -69,10 +69,16 @@ NS_IMETHODIMP bcJavaComponentFactory::CreateInstance(nsISupports *aOuter, const
_orb->GetORB(&orb);
bcOID oid;
r = javaStubsAndProxies->GetOID(location, &oid);
if (NS_FAILED(r)) {
return r;
}
printf("--bcJavaComponentFactory::CreateInstance after GetOID");
nsISupports *proxy;
printf("--[c++]bcJavaComponentFactory::CreateInstance iid:%s\n",iid.ToString());
xpcomStubsAndProxies->GetProxy(oid, iid, orb, &proxy);
if (NS_FAILED(r)) {
return r;
}
*result = proxy;
printf("--bcJavaComponentFactory::CreateInstance end");
return NS_OK;

View File

@@ -82,13 +82,19 @@ void bcJavaGlobal::StartJVM() {
char classpath[1024];
JavaVMInitArgs vm_args;
JavaVMOption options[2];
sprintf(classpath, "-Djava.class.path=%s",PR_GetEnv("CLASSPATH"));
PR_LOG(l,PR_LOG_DEBUG,("--[c++] classpath %s\n",classpath));
options[0].optionString = classpath;
options[1].optionString=""; //-Djava.compiler=NONE";
char * classpathEnv = PR_GetEnv("CLASSPATH");
if (classpathEnv != NULL) {
sprintf(classpath, "-Djava.class.path=%s",classpathEnv);
PR_LOG(l,PR_LOG_DEBUG,("--[c++] classpath %s\n",classpath));
options[0].optionString = classpath;
options[1].optionString=""; //-Djava.compiler=NONE";
vm_args.options = options;
vm_args.nOptions = 2;
} else {
vm_args.nOptions = 0;
}
vm_args.version = 0x00010002;
vm_args.options = options;
vm_args.nOptions = 2;
vm_args.ignoreUnrecognized = JNI_TRUE;
/* Create the Java VM */
res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);

View File

@@ -108,6 +108,9 @@ NS_IMETHODIMP bcJavaStubsAndProxies::GetProxy(bcOID oid, const nsIID &iid, bcIOR
if (!componentLoader) {
Init();
}
if (!componentLoader) {
return NS_ERROR_FAILURE;
}
bcOIDKey *key = new bcOIDKey(oid);
void *tmp = oid2objectMap->Get(key);
delete key;
@@ -129,7 +132,9 @@ NS_IMETHODIMP bcJavaStubsAndProxies::GetInterface(const nsIID &iid, jclass *cla
if (!componentLoader) {
Init();
}
if (!componentLoader) {
return NS_ERROR_FAILURE;
}
JNIEnv * env = bcJavaGlobal::GetJNIEnv();
jobject jiid = bcIIDJava::GetObject((nsIID*)&iid);
*clazz = (jclass)env->CallStaticObjectMethod(proxyFactory,getInterfaceID, jiid);
@@ -168,6 +173,9 @@ NS_IMETHODIMP bcJavaStubsAndProxies::GetOID(char *location, bcOID *oid) {
if (!componentLoader) {
Init();
}
if (!componentLoader) {
return NS_ERROR_FAILURE;
}
//location[strlen(location)-5] = 0; //nb dirty hack. location is xyz.jar.info
strcpy(location + strlen(location)-4,"comp");
jstring jstr = env->NewStringUTF(location);