diff options
author | Kay Ramme <kr@openoffice.org> | 2001-03-14 11:16:25 +0000 |
---|---|---|
committer | Kay Ramme <kr@openoffice.org> | 2001-03-14 11:16:25 +0000 |
commit | aa7f686d7eda35362e2c9b1bcb9dc66bd7b4006a (patch) | |
tree | 077697dad20d95c08034d704a20b8de15ab17198 /javaunohelper | |
parent | 04441091d3aa27126294c2291ca472e260c3bc3d (diff) |
throw runtime exception when trying to use green threads
Diffstat (limited to 'javaunohelper')
-rw-r--r-- | javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java b/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java index 48f60490dc8a..1d3d1fdebee0 100644 --- a/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java +++ b/javaunohelper/com/sun/star/comp/helper/RegistryServiceFactory.java @@ -2,9 +2,9 @@ * * $RCSfile: RegistryServiceFactory.java,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 16:31:32 $ + * last change: $Author: kr $ $Date: 2001-03-14 12:16:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,8 +62,11 @@ package com.sun.star.comp.helper; + import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.uno.UnoRuntime; +import com.sun.star.uno.RuntimeException; + public class RegistryServiceFactory { static { @@ -117,6 +120,13 @@ public class RegistryServiceFactory { String writeRegistryFile, String readRegistryFile, boolean readOnly ) throws com.sun.star.uno.Exception { + // Ensure that we are on a native threads vm + // (binary UNO does use native threads). + String vm_info = System.getProperty("java.vm.info"); + if(vm_info != null && vm_info.indexOf("green") != -1) + throw new RuntimeException(RegistryServiceFactory.class.toString() + ".create - can't use binary UNO with green threads"); + + if (writeRegistryFile == null && readRegistryFile == null) throw new com.sun.star.uno.Exception("No registry is specified!"); |