1*7c448b18SAndrew Rist /************************************************************** 2*7c448b18SAndrew Rist * 3*7c448b18SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*7c448b18SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*7c448b18SAndrew Rist * distributed with this work for additional information 6*7c448b18SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*7c448b18SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*7c448b18SAndrew Rist * "License"); you may not use this file except in compliance 9*7c448b18SAndrew Rist * with the License. You may obtain a copy of the License at 10*7c448b18SAndrew Rist * 11*7c448b18SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*7c448b18SAndrew Rist * 13*7c448b18SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*7c448b18SAndrew Rist * software distributed under the License is distributed on an 15*7c448b18SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*7c448b18SAndrew Rist * KIND, either express or implied. See the License for the 17*7c448b18SAndrew Rist * specific language governing permissions and limitations 18*7c448b18SAndrew Rist * under the License. 19*7c448b18SAndrew Rist * 20*7c448b18SAndrew Rist *************************************************************/ 21*7c448b18SAndrew Rist 22*7c448b18SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir package com.sun.star.comp.test.deployment.passive_java; 25cdf0e10cSrcweir 26cdf0e10cSrcweir import com.sun.star.frame.DispatchDescriptor; 27cdf0e10cSrcweir import com.sun.star.frame.XDispatch; 28cdf0e10cSrcweir import com.sun.star.frame.XDispatchProvider; 29cdf0e10cSrcweir import com.sun.star.lang.XServiceInfo; 30cdf0e10cSrcweir import com.sun.star.lib.uno.helper.WeakBase; 31cdf0e10cSrcweir import com.sun.star.uno.UnoRuntime; 32cdf0e10cSrcweir import com.sun.star.uno.XComponentContext; 33cdf0e10cSrcweir import com.sun.star.util.URL; 34cdf0e10cSrcweir 35cdf0e10cSrcweir public final class Provider extends WeakBase 36cdf0e10cSrcweir implements XServiceInfo, XDispatchProvider 37cdf0e10cSrcweir { Provider(XComponentContext context)38cdf0e10cSrcweir public Provider(XComponentContext context) { 39cdf0e10cSrcweir this.context = context; 40cdf0e10cSrcweir } 41cdf0e10cSrcweir getImplementationName()42cdf0e10cSrcweir public String getImplementationName() { return implementationName; } 43cdf0e10cSrcweir supportsService(String ServiceName)44cdf0e10cSrcweir public boolean supportsService(String ServiceName) { 45cdf0e10cSrcweir return ServiceName.equals(getSupportedServiceNames()[0]); //TODO 46cdf0e10cSrcweir } 47cdf0e10cSrcweir getSupportedServiceNames()48cdf0e10cSrcweir public String[] getSupportedServiceNames() { 49cdf0e10cSrcweir return serviceNames; 50cdf0e10cSrcweir } 51cdf0e10cSrcweir queryDispatch( URL URL, String TargetFrameName, int SearchFlags)52cdf0e10cSrcweir public XDispatch queryDispatch( 53cdf0e10cSrcweir URL URL, String TargetFrameName, int SearchFlags) 54cdf0e10cSrcweir { 55cdf0e10cSrcweir return UnoRuntime.queryInterface( 56cdf0e10cSrcweir XDispatch.class, 57cdf0e10cSrcweir context.getValueByName( 58cdf0e10cSrcweir "/singletons/" + 59cdf0e10cSrcweir "com.sun.star.test.deployment.passive_java_singleton")); 60cdf0e10cSrcweir } 61cdf0e10cSrcweir queryDispatches(DispatchDescriptor[] Requests)62cdf0e10cSrcweir public XDispatch[] queryDispatches(DispatchDescriptor[] Requests) { 63cdf0e10cSrcweir XDispatch[] s = new XDispatch[Requests.length]; 64cdf0e10cSrcweir for (int i = 0; i < s.length; ++i) { 65cdf0e10cSrcweir s[i] = queryDispatch( 66cdf0e10cSrcweir Requests[i].FeatureURL, Requests[i].FrameName, 67cdf0e10cSrcweir Requests[i].SearchFlags); 68cdf0e10cSrcweir } 69cdf0e10cSrcweir return s; 70cdf0e10cSrcweir } 71cdf0e10cSrcweir 72cdf0e10cSrcweir private final XComponentContext context; 73cdf0e10cSrcweir 74cdf0e10cSrcweir static final String implementationName = 75cdf0e10cSrcweir "com.sun.star.comp.test.deployment.passive_java"; 76cdf0e10cSrcweir 77cdf0e10cSrcweir static final String[] serviceNames = new String[] { 78cdf0e10cSrcweir "com.sun.star.test.deployment.passive_java" }; 79cdf0e10cSrcweir } 80