1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 package com
.sun
.star
.comp
.loader
;
22 import com
.sun
.star
.lang
.XSingleServiceFactory
;
23 import com
.sun
.star
.lang
.XMultiServiceFactory
;
24 import com
.sun
.star
.lang
.XServiceInfo
;
27 public class JavaLoaderFactory
implements XSingleServiceFactory
, XServiceInfo
{
29 private static String
[] supportedServices
= {
30 "com.sun.star.loader.Java",
31 "com.sun.star.loader.Java2"
34 protected XMultiServiceFactory multiServiceFactory
= null;
36 public JavaLoaderFactory(XMultiServiceFactory factory
) {
37 multiServiceFactory
= factory
;
40 public java
.lang
.Object
createInstance()
41 throws com
.sun
.star
.uno
.Exception
,
42 com
.sun
.star
.uno
.RuntimeException
44 return new JavaLoader(multiServiceFactory
);
47 public java
.lang
.Object
createInstanceWithArguments( java
.lang
.Object
[] args
)
48 throws com
.sun
.star
.uno
.Exception
,
49 com
.sun
.star
.uno
.RuntimeException
51 JavaLoader loader
= new JavaLoader();
52 loader
.initialize(args
);
58 * Implements the XServiceInfo interface.
60 public String
getImplementationName()
61 throws com
.sun
.star
.uno
.RuntimeException
63 return JavaLoader
.class.getName();
67 * Implements the XServiceInfo interface.
69 public boolean supportsService(String serviceName
)
70 throws com
.sun
.star
.uno
.RuntimeException
72 for (String supportedService
: supportedServices
) {
73 if (supportedService
.equals(serviceName
)) {
81 * Implements the XServiceInfo interface.
83 public String
[] getSupportedServiceNames()
84 throws com
.sun
.star
.uno
.RuntimeException
86 return supportedServices
;
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */