Top Description Fields Constructors Methods
org.javamoney.moneta.internal

public Class OSGIServiceProvider

extends Object
implements ServiceProvider
Class Inheritance
All Implemented Interfaces
javax.money.spi.ServiceProvider
Imports
org.osgi.framework.*, javax.money.Monetary, javax.money.spi.ServiceProvider, java.net.URL, java.util.*, java.util.logging.Level, .Logger

ServiceContext implementation based on OSGI Service mechanisms.

Field Summary

Modifier and TypeField and Description
private final BundleContext
private static final Logger
private static final OSGIServiceComparator

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <T> T
create(Class<T> serviceType)

public int
getPriority()

Implements javax.money.spi.ServiceProvider.getPriority.

This method allows to define a priority for a registered ServiceProvider instance.

public Enumeration<URL>
public <T> T
getService(Class<T> serviceType)

Overrides default javax.money.spi.ServiceProvider.getService.

Access a single service, given its type.

public <T> List<T>
getServices(Class<T> serviceType)

Implements javax.money.spi.ServiceProvider.getServices.

Access a list of services, given its type.

public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bundleContextback to summary
private final BundleContext bundleContext
LOGback to summary
private static final Logger LOG
REF_COMPARATORback to summary
private static final OSGIServiceComparator REF_COMPARATOR

Constructor Detail

OSGIServiceProviderback to summary
public OSGIServiceProvider(BundleContext bundleContext)

Method Detail

createback to summary
public <T> T create(Class<T> serviceType)
Annotations
@SuppressWarnings:unchecked
getPriorityback to summary
public int getPriority()

Implements javax.money.spi.ServiceProvider.getPriority.

Doc from javax.money.spi.ServiceProvider.getPriority.

This method allows to define a priority for a registered ServiceProvider instance. When multiple providers are registered in the system the provider with the highest priority value is taken.

Annotations
@Override
getResourcesback to summary
public Enumeration<URL> getResources(String resource, ClassLoader cl)
getServiceback to summary
public <T> T getService(Class<T> serviceType)

Overrides default javax.money.spi.ServiceProvider.getService.

Doc from javax.money.spi.ServiceProvider.getService.

Access a single service, given its type. The bootstrap mechanism should order the instance for precedence, hereby the most significant should be first in order and returned. If no such services are found, null is returned.

Annotations
@Override
getServicesback to summary
public <T> List<T> getServices(Class<T> serviceType)

Implements javax.money.spi.ServiceProvider.getServices.

Doc from javax.money.spi.ServiceProvider.getServices.

Access a list of services, given its type. The bootstrap mechanism should order the instance for precedence, hereby the most significant should be first in order. If no such services are found, an empty list should be returned.

Annotations
@Override
isInitializedback to summary
public boolean isInitialized()