bump product version to 6.4.0.3
[LibreOffice.git] / jurt / com / sun / star / comp / loader / JavaLoaderFactory.java
blobedf4f7a3a4c7a0c58e6c9254cc1d272422901b65
1 /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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);
54 return loader;
57 /**
58 * Implements the XServiceInfo interface.
60 public String getImplementationName()
61 throws com.sun.star.uno.RuntimeException
63 return JavaLoader.class.getName();
66 /**
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)) {
74 return true;
77 return false;
80 /**
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: */