19 package org.omg.dds.core;
21 import java.lang.reflect.Constructor;
22 import java.lang.reflect.InvocationTargetException;
25 import java.util.concurrent.TimeUnit;
51 "org.omg.dds.serviceClassName";
59 private static final String ERROR_STRING =
60 "Unable to load OMG DDS implementation. ";
80 ClassLoader classLoader)
83 IMPLEMENTATION_CLASS_NAME_PROPERTY,
157 String implClassNameProperty,
158 Map<String, Object> environment,
159 ClassLoader classLoader)
166 String className = System.getProperty(implClassNameProperty);
167 if (className == null || className.length() == 0) {
170 ERROR_STRING +
"Please set " +
171 implClassNameProperty +
" property.");
176 if (classLoader == null) {
177 classLoader = getDefaultClassLoader();
179 assert classLoader != null;
186 Class<?> ctxClass = classLoader.loadClass(className);
191 Constructor<?> ctor = ctxClass.getConstructor(Map.class);
193 }
catch (NoSuchMethodException nsmx) {
202 Constructor<?> ctor = ctxClass.getConstructor(
208 }
catch (ExceptionInInitializerError initx) {
212 ERROR_STRING +
"Error during static initialization.",
214 }
catch (InvocationTargetException itx) {
217 ERROR_STRING +
"Error during object initialization.",
221 }
catch (ClassNotFoundException cnfx) {
224 ERROR_STRING + className +
" was not found.",
226 }
catch (LinkageError linkx) {
229 ERROR_STRING + className +
" could not be loaded.",
231 }
catch (NoSuchMethodException nsmx) {
234 ERROR_STRING + className +
235 " has no appropriate constructor.",
237 }
catch (IllegalAccessException iax) {
240 ERROR_STRING + className +
241 " has no appropriate constructor.",
243 }
catch (InstantiationException ix) {
246 ERROR_STRING + className +
" could not be instantiated.",
248 }
catch (SecurityException sx) {
251 ERROR_STRING +
"Prevented by security manager.", sx);
252 }
catch (ClassCastException ccx) {
255 ERROR_STRING + className +
256 " is not a ServiceEnvironment.", ccx);
259 }
catch (IllegalArgumentException argx) {
265 throw new AssertionError(argx);
311 private static ClassLoader getDefaultClassLoader() {
313 ClassLoader classLoader =
315 if (classLoader != null) {
325 classLoader = ClassLoader.getSystemClassLoader();
326 }
catch (SecurityException sx) {
328 ERROR_STRING +
"Prevented by security manager.",
330 }
catch (IllegalStateException isx) {
339 "Circular system class loader dependencies.",
341 }
catch (Error err) {
348 "System class loader could not be initialized.",
362 if (classLoader == null) {
364 ERROR_STRING +
"No system class loader available.");
412 Class<TYPE> type, String registeredName);
abstract PolicyFactory getPolicyFactory()
Provides an instance of org.omg.dds.core.policy.PolicyFactory.
InstanceHandle nilHandle()
A GuardCondition object is a specific Condition whose triggerValue is completely under the control of...
static final String IMPLEMENTATION_CLASS_NAME_PROPERTY
A WaitSet object allows an application to wait until one or more of the attached org.omg.dds.core.Condition objects has a triggerValue of true or else until the timeout expires.
ModifiableTime newTime(long time, TimeUnit units)
Construct a specific instant in time.
abstract ServiceProviderInterface getSPI()
This method is not intended for use by applications.
Indicates that a DDS implementation could not be initialized due to an error that occurred within tha...
GuardCondition newGuardCondition()
static ServiceEnvironment createInstance(ClassLoader classLoader)
Create and return a new instance of a concrete implementation of this class with the given environmen...
public< TYPE > TypeSupport< TYPE > newTypeSupport(Class< TYPE > type, String registeredName)
Create a new org.omg.dds.type.TypeSupport object for the given physical type.
An opaque handle that can be used to refer to a local or remote entity.
Indicates that a DDS implementation could not be loaded because the either the request to do so or th...
Set< Class<? extends Status > > allStatusKinds()
A supertype of all DDS classes and interfaces.
This interface is for the use of the DDS implementation, not of DDS applications. ...
The sole purpose of this class is to allow the creation and destruction of org.omg.dds.domain.DomainParticipant objects.
The QoS provider API allows users to specify the QoS settings of their DCPS entities outside of appli...
final ServiceEnvironment getEnvironment()
abstract KeyedString newKeyedString()
TypeSupport is an abstract interface that has to be specialized for each concrete type that will be u...
Duration newDuration(long duration, TimeUnit unit)
Construct a org.omg.dds.core.Duration of the given magnitude.
A span of elapsed time expressed with nanosecond precision.
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.
abstract DynamicDataFactory getDynamicDataFactory()
DDS implementations are rooted in this class, a concrete subclass of which can be instantiated based ...
abstract KeyedBytes newKeyedBytes()
abstract QosProvider newQosProvider(String uri, String profile)
Create a QosProvider fetching QoS configuration from the specified URI.
Set< Class<? extends Status > > noStatusKinds()
Duration infiniteDuration()
DomainParticipantFactory getParticipantFactory()
A moment in time expressed with nanosecond precision (though not necessarily nanosecond accuracy)...
Status is the abstract root class for all communication status objects.
DynamicTypeFactory getTypeFactory()