public class OsgiServiceLocator extends ServiceLocator
ServiceLocator
for use in an OSGi runtime environment. Uses OSGI bundles
to load markup
languages using the Java service
defined by bundle resources defined by service files at the
path: "META-INF/services/org.eclipse.mylyn.wikitext.core.parser.markup.MarkupLanguage"
.ServiceLocator.ResourceDescriptor
classLoader
Constructor and Description |
---|
OsgiServiceLocator()
Creates a new
OsgiServiceLocator . |
OsgiServiceLocator(java.lang.ClassLoader classLoader)
Creates a new
OsgiServiceLocator . |
Modifier and Type | Method and Description |
---|---|
protected java.util.List<ServiceLocator.ResourceDescriptor> |
discoverServiceResources() |
protected void |
ensureContext(Bundle bundle) |
static ServiceLocator |
getApplicableInstance()
Provides the
applicable service locator instance. |
static boolean |
isApplicable()
Indicates whether the OSGi service locator can be used.
|
protected java.lang.Class<?> |
loadClass(ServiceLocator.ResourceDescriptor resource,
java.lang.String className)
Loads the specified class.
|
getAllMarkupLanguages, getClasspathServiceResourceNames, getInstance, getInstance, getMarkupLanguage, readServiceClassNames, setImplementation
public OsgiServiceLocator()
OsgiServiceLocator
.public OsgiServiceLocator(java.lang.ClassLoader classLoader)
OsgiServiceLocator
.public static ServiceLocator getApplicableInstance()
applicable
service locator instance. Selects an OsgiServiceLocator
if {isApplicable()
returns true
, otherwise delegates to ServiceLocator.getInstance()
.public static boolean isApplicable()
protected java.util.List<ServiceLocator.ResourceDescriptor> discoverServiceResources()
discoverServiceResources
in class ServiceLocator
ServiceLocator.getClasspathServiceResourceNames()
protected java.lang.Class<?> loadClass(ServiceLocator.ResourceDescriptor resource, java.lang.String className) throws java.lang.ClassNotFoundException
ServiceLocator
loadClass
in class ServiceLocator
className
- the class name to loadjava.lang.ClassNotFoundException
- if the class could not be loadedprotected void ensureContext(Bundle bundle)
Copyright © 2007, 2013 David Green and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html