1*87e37ca8SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*87e37ca8SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*87e37ca8SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*87e37ca8SAndrew Rist * distributed with this work for additional information 6*87e37ca8SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*87e37ca8SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*87e37ca8SAndrew Rist * "License"); you may not use this file except in compliance 9*87e37ca8SAndrew Rist * with the License. You may obtain a copy of the License at 10*87e37ca8SAndrew Rist * 11*87e37ca8SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*87e37ca8SAndrew Rist * 13*87e37ca8SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*87e37ca8SAndrew Rist * software distributed under the License is distributed on an 15*87e37ca8SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*87e37ca8SAndrew Rist * KIND, either express or implied. See the License for the 17*87e37ca8SAndrew Rist * specific language governing permissions and limitations 18*87e37ca8SAndrew Rist * under the License. 19*87e37ca8SAndrew Rist * 20*87e37ca8SAndrew Rist *************************************************************/ 21*87e37ca8SAndrew Rist 22*87e37ca8SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir package test.java.javatest; 25cdf0e10cSrcweir 26cdf0e10cSrcweir import com.sun.star.comp.loader.FactoryHelper; 27cdf0e10cSrcweir import com.sun.star.lang.XMultiServiceFactory; 28cdf0e10cSrcweir import com.sun.star.lang.XSingleServiceFactory; 29cdf0e10cSrcweir import com.sun.star.registry.XRegistryKey; 30cdf0e10cSrcweir import test.types.TestException; 31cdf0e10cSrcweir import test.types.XTest; 32cdf0e10cSrcweir 33cdf0e10cSrcweir public final class JavaTest implements XTest { JavaTest()34cdf0e10cSrcweir public JavaTest() {} 35cdf0e10cSrcweir throwException()36cdf0e10cSrcweir public void throwException() throws TestException { 37cdf0e10cSrcweir throw new TestException("test", this); 38cdf0e10cSrcweir } 39cdf0e10cSrcweir __writeRegistryServiceInfo(XRegistryKey key)40cdf0e10cSrcweir public static boolean __writeRegistryServiceInfo(XRegistryKey key) { 41cdf0e10cSrcweir return 42cdf0e10cSrcweir FactoryHelper.writeRegistryServiceInfo( 43cdf0e10cSrcweir IMPLEMENTATION_NAME, SERVICE_NAME, key); 44cdf0e10cSrcweir } 45cdf0e10cSrcweir __getServiceFactory( String name, XMultiServiceFactory factory, XRegistryKey key)46cdf0e10cSrcweir public static XSingleServiceFactory __getServiceFactory( 47cdf0e10cSrcweir String name, XMultiServiceFactory factory, XRegistryKey key) 48cdf0e10cSrcweir { 49cdf0e10cSrcweir if (name.equals(IMPLEMENTATION_NAME)) { 50cdf0e10cSrcweir return FactoryHelper.getServiceFactory( 51cdf0e10cSrcweir JavaTest.class, SERVICE_NAME, factory, key); 52cdf0e10cSrcweir } else { 53cdf0e10cSrcweir return null; 54cdf0e10cSrcweir } 55cdf0e10cSrcweir } 56cdf0e10cSrcweir 57cdf0e10cSrcweir private static final String IMPLEMENTATION_NAME 58cdf0e10cSrcweir = "test.java.javatest.Component"; 59cdf0e10cSrcweir private static final String SERVICE_NAME = "test.types.JavaTest"; 60cdf0e10cSrcweir } 61