2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package com
.sun
.star
.comp
.loader
;
21 import com
.sun
.star
.lang
.XSingleServiceFactory
;
22 import com
.sun
.star
.lang
.XMultiServiceFactory
;
23 import com
.sun
.star
.lang
.XServiceInfo
;
26 public class JavaLoaderFactory
implements XSingleServiceFactory
, XServiceInfo
{
28 private static String
[] supportedServices
= {
29 "com.sun.star.loader.Java",
30 "com.sun.star.loader.Java2"
33 protected XMultiServiceFactory multiServiceFactory
= null;
35 public JavaLoaderFactory(XMultiServiceFactory factory
) {
36 multiServiceFactory
= factory
;
39 public java
.lang
.Object
createInstance()
40 throws com
.sun
.star
.uno
.Exception
,
41 com
.sun
.star
.uno
.RuntimeException
43 return new JavaLoader(multiServiceFactory
);
46 public java
.lang
.Object
createInstanceWithArguments( java
.lang
.Object
[] args
)
47 throws com
.sun
.star
.uno
.Exception
,
48 com
.sun
.star
.uno
.RuntimeException
50 JavaLoader loader
= new JavaLoader();
51 loader
.initialize(args
);
57 * Implements the XServiceInfo interface.
59 public String
getImplementationName()
60 throws com
.sun
.star
.uno
.RuntimeException
62 return JavaLoader
.class.getName();
66 * Implements the XServiceInfo interface.
68 public boolean supportsService(String serviceName
)
69 throws com
.sun
.star
.uno
.RuntimeException
71 for (String supportedService
: supportedServices
) {
72 if (supportedService
.equals(serviceName
)) {
80 * Implements the XServiceInfo interface.
82 public String
[] getSupportedServiceNames()
83 throws com
.sun
.star
.uno
.RuntimeException
85 return supportedServices
;