public class CaDataSourceProvider extends AbstractJackieDataSourceProvider
Provider for JackieDataSource
s that uses the name ca.
This provider should only be on the class-path if the JCA-based data-source
provider is not present. As the JCA-based data-source provider uses the same
name, both would collide and it would be a matter of chance which of two
would be used by the CompositeDataSource
. This conflict is only
resolved when running in an OSGi environment (see below) or when this
data-source provider (or the JCA-based data-source provider) is explicitly
registered with the CompositeDataSource
. The
registerWith(CompositeDataSource)
method should be called for this
purpose.
When the JCA-based data-source provider is also on the class-path, the
JackieDataSourceProvider
can be used instead.
When this class is used in an OSGi environment, this bundle's activator
explicitly adds this data-source provider to the CompositeDataSource
returned by PVManager.getDefaultDataSource()
(only if it actually is
a CompositeDataSource
, this means if it has not been replaced by a
different implementation). In this case, this data-source provider is going
to be used when a channel requests the "ca" data-source provider, even if
another provider can also be discovered on the class-path. In such a
situation, it is safe to have both this and the JCA-based data-source
provider on the class-path, but the JCA-based data-source provider is not
going to be available through means of the CompositeDataSource
.
Constructor and Description |
---|
CaDataSourceProvider() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName() |
static void |
registerWith(org.diirt.datasource.CompositeDataSource dataSource)
Explicitly registers this data-source provider with the specified
composite data-source.
|
public static void registerWith(org.diirt.datasource.CompositeDataSource dataSource)
Explicitly registers this data-source provider with the specified
composite data-source. This is useful when both this data-source provider
and another data-source provider using the "ca" name are on the
class-path. In this case, this method should be called before using the
CompositeDataSource
in order to ensure that the
CompositeDataSource
consistently uses this provider.
When running in an OSGi environment, this bundle's activator
automatically calls this method passing the data-source returned by
PVManager.getDefaultDataSource()
(as long as it actually is a
CompositeDataSource
. This means that in an OSGi environment this
data-source provider will actually replace the standard "ca" data-source
provider as far as the PVManager
's default data-source is
concerned.
dataSource
- composite data-source with which this provider shall be
registered.public java.lang.String getName()
getName
in class org.diirt.datasource.DataSourceProvider
Copyright © 2017–2019 aquenos GmbH. All rights reserved.