OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org.opensplice.dds.core.OsplServiceEnvironment Class Reference
Inheritance diagram for org.opensplice.dds.core.OsplServiceEnvironment:
Inheritance graph
Collaboration diagram for org.opensplice.dds.core.OsplServiceEnvironment:
Collaboration graph

Classes

class  OpenSpliceServiceProviderInterface
 

Public Member Functions

 OsplServiceEnvironment (Map< String, Object > environment)
 
 OsplServiceEnvironment ()
 
final ServiceEnvironment getEnvironment ()
 
Object getEnvironmentValue (String name)
 
ServiceProviderInterface getSPI ()
 

Static Public Member Functions

static ServiceEnvironment createInstance (ClassLoader classLoader)
 Create and return a new instance of a concrete implementation of this class with the given environment. More...
 
static ServiceEnvironment createInstance (String implClassNameProperty, Map< String, Object > environment, ClassLoader classLoader)
 Look up the system property identified by the given string and load, then instantiate, the ServiceEnvironment implementation class identified by its value. More...
 

Static Public Attributes

static final String IMPLEMENTATION_CLASS_NAME_PROPERTY
 

Detailed Description

Definition at line 50 of file OsplServiceEnvironment.java.

Constructor & Destructor Documentation

◆ OsplServiceEnvironment() [1/2]

org.opensplice.dds.core.OsplServiceEnvironment.OsplServiceEnvironment ( Map< String, Object >  environment)

Definition at line 54 of file OsplServiceEnvironment.java.

◆ OsplServiceEnvironment() [2/2]

org.opensplice.dds.core.OsplServiceEnvironment.OsplServiceEnvironment ( )

Definition at line 63 of file OsplServiceEnvironment.java.

Member Function Documentation

◆ createInstance() [1/2]

static ServiceEnvironment org.omg.dds.core.ServiceEnvironment.createInstance ( ClassLoader  classLoader)
staticinherited

Create and return a new instance of a concrete implementation of this class with the given environment.

This method is equivalent to calling:

createInstance(IMPLEMENTATION_CLASS_NAME_PROPERTY, null, classLoader);

See also
#createInstance(String, Map, ClassLoader)
IMPLEMENTATION_CLASS_NAME_PROPERTY

Definition at line 79 of file ServiceEnvironment.java.

◆ createInstance() [2/2]

static ServiceEnvironment org.omg.dds.core.ServiceEnvironment.createInstance ( String  implClassNameProperty,
Map< String, Object >  environment,
ClassLoader  classLoader 
)
staticinherited

Look up the system property identified by the given string and load, then instantiate, the ServiceEnvironment implementation class identified by its value.

The class must be accessible and have a public constructor.

The public constructors of the implementation class will first be searched for one accepting a single argument of type Map. If one is found, it will be called with the environment map provided to this method as its argument. If no such constructor is found, a no-argument constructor will be used instead, and the provided environment, if any, will be ignored. If the implementation class provides no public constructor with either of these signatures, an exception will be thrown.

By default, the class loader for the ServiceEnvironment class will be used to load the indicated class. If this class loader is null – for instance, if it is the bootstrap class loader – then the system class loader will be used in its place. If it is also null, a ServiceConfigurationException will be thrown.

Neither the class loader nor the loaded class will be cached between invocations of this method. As a result, execution of this method is expected to be relatively expensive. However, as any DDS object can provide a reference to its creating ServiceEnvironment via org.omg.dds.core.DDSObject#getEnvironment(), executions of this method are also expected to be rare.

Parameters
implClassNamePropertyThe name of a system property, the value of which will be taken as the name of a ServiceEnvironment implementation class to load.
environmentA collection of name-value pairs to be provided to the concrete ServiceEnvironment subclass. If that class does not provide a constructor that can accept this environment, the environment will be ignored. This argument may be null; a null environment shall be considered equivalent to an empty map.
classLoaderThe class loader to use to load the service implementation class. If it is null, this class's class loader will be used if it is accessible; otherwise, the system class loader will be used.
Returns
A non-null ServiceEnvironment.
Exceptions
NullPointerExceptionIf the given property name is null.
IllegalArgumentExceptionIf the given property name is the empty string.
ServiceConfigurationExceptionIf the class could not be loaded because of an issue with the the invocation of this method or the configuration of the runtime environment. For example, the class may not be on the class path, it may require a native library that is not available, or an inappropriate class may have been requested (e.g. one that is not a ServiceEnvironment or that doesn't have a no-argument constructor).
ServiceInitializationExceptionIf the class was found but could not be initialized and/or instantiated because of an error that occurred within its implementation.
See also
createInstance(ClassLoader)
DDSObject::getEnvironment()
System::getProperty(String)
Class::getClassLoader()
ClassLoader::getSystemClassLoader()
ClassLoader::loadClass(String)

Definition at line 156 of file ServiceEnvironment.java.

◆ getEnvironment()

final ServiceEnvironment org.omg.dds.core.ServiceEnvironment.getEnvironment ( )
inherited
Returns
the org.omg.dds.core.ServiceEnvironment object that directly or indirectly was used to create this object.

Implements org.omg.dds.core.DDSObject.

Definition at line 289 of file ServiceEnvironment.java.

◆ getEnvironmentValue()

Object org.opensplice.dds.core.OsplServiceEnvironment.getEnvironmentValue ( String  name)

Definition at line 68 of file OsplServiceEnvironment.java.

◆ getSPI()

ServiceProviderInterface org.opensplice.dds.core.OsplServiceEnvironment.getSPI ( )

Definition at line 80 of file OsplServiceEnvironment.java.

Member Data Documentation

◆ IMPLEMENTATION_CLASS_NAME_PROPERTY

final String org.omg.dds.core.ServiceEnvironment.IMPLEMENTATION_CLASS_NAME_PROPERTY
staticinherited
Initial value:
=
"org.omg.dds.serviceClassName"

Definition at line 50 of file ServiceEnvironment.java.


The documentation for this class was generated from the following file: