diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-04-24 13:03:21 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-04-24 13:03:21 +0000 |
commit | d4f8f888b2f6d22578e6509d30d27f194c283369 (patch) | |
tree | 6366afefb7ac52ccc60342b0cb4b063e622e4db9 /jurt | |
parent | a4c35bdf4710f90f4c0949752d191605b5a15bb2 (diff) |
INTEGRATION: CWS uno3 (1.6.26); FILE MERGED
2003/04/15 12:32:36 jl 1.6.26.1: #108707# FactoryHelper supports multiple services
Diffstat (limited to 'jurt')
-rw-r--r-- | jurt/com/sun/star/comp/loader/FactoryHelper.java | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/jurt/com/sun/star/comp/loader/FactoryHelper.java b/jurt/com/sun/star/comp/loader/FactoryHelper.java index 36b97cb79..a72c91b0c 100644 --- a/jurt/com/sun/star/comp/loader/FactoryHelper.java +++ b/jurt/com/sun/star/comp/loader/FactoryHelper.java @@ -2,9 +2,9 @@ * * $RCSfile: FactoryHelper.java,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: jl $ $Date: 2002-09-18 09:59:02 $ + * last change: $Author: vg $ $Date: 2003-04-24 14:03:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -85,7 +85,7 @@ import com.sun.star.uno.Type; * This class has default implementations for <code>getServiceFactory</code> * and <code>writeRegistryServiceInfo</code>. * <p> - * @version $Revision: 1.6 $ $ $Date: 2002-09-18 09:59:02 $ + * @version $Revision: 1.7 $ $ $Date: 2003-04-24 14:03:21 $ * @author Kay Ramme * @see com.sun.star.lang.XMultiServiceFactory * @see com.sun.star.lang.XServiceInfo @@ -94,6 +94,8 @@ import com.sun.star.uno.Type; * @since UDK1.0 */ public class FactoryHelper { + + private static final boolean DEBUG = false; // the factory static protected class Factory implements XSingleServiceFactory, XSingleComponentFactory, XServiceInfo, @@ -109,7 +111,7 @@ public class FactoryHelper { } } - private static final boolean DEBUG = false; +// private static final boolean DEBUG = false; protected XMultiServiceFactory _xMultiServiceFactory; protected XRegistryKey _xRegistryKey; @@ -537,7 +539,7 @@ public class FactoryHelper { /** * Writes the registration data into the registry key * <p> - * @return returns a factory + * @return success * @param implName the name of the implementing class * @param serviceName the service name * @param regKey the given registry key @@ -559,5 +561,38 @@ public class FactoryHelper { return result; } + + /** Writes the registration data into the registry key. + * Several services are supported. + * + * @param impl_name name of implementation + * @param supported_services supported services of implementation + * @param xKey registry key to write to + * @return success + */ + public static boolean writeRegistryServiceInfo( + String impl_name, String supported_services [], XRegistryKey xKey ) + { + try + { + XRegistryKey xNewKey = xKey.createKey( "/" + impl_name + "/UNO/SERVICES" ); + for ( int nPos = 0; nPos < supported_services.length; ++nPos ) + { + xNewKey.createKey( supported_services[ nPos ] ); + } + return true; + } + catch (com.sun.star.registry.InvalidRegistryException exc) + { + if (DEBUG) + { + System.err.println( + "##### " + Factory.class.getName() + ".writeRegistryServiceInfo -- exc: " + + exc.toString() ); + } + } + return false; + } + } |