21 package org.opensplice.dds.domain;
23 import java.util.Arrays;
24 import java.util.Collection;
25 import java.util.HashMap;
26 import java.util.HashSet;
44 private DDS.DomainParticipantFactory factory;
48 this.environment = environment;
50 this.factory = DDS.DomainParticipantFactory.get_instance();
54 DDS.DomainParticipant old = participant.
getOld();
56 synchronized (this.participants) {
57 old.delete_contained_entities();
58 int rc = this.factory.delete_participant(old);
59 this.participants.remove(old);
61 "DomainParticipant.close() failed.");
67 return this.environment;
84 Collection<Class<? extends Status>> statuses) {
87 synchronized (this.participants) {
89 domainId, qos, listener, statuses);
90 this.participants.put(participant.
getOld(), participant);
98 Class<? extends Status>... statuses) {
105 DDS.DomainParticipant oldParticipant;
107 synchronized (this.participants) {
108 oldParticipant = factory.lookup_participant(domainId);
110 if (oldParticipant != null) {
111 participant = participants.get(oldParticipant);
121 DDS.DomainParticipantFactoryQosHolder holder =
new DDS.DomainParticipantFactoryQosHolder();
122 int rc = this.factory.get_qos(holder);
125 "DomainParticipantFactory.getQos() failed.");
134 "Supplied DomainParticipantFactoryQos is null.");
137 DDS.DomainParticipantFactoryQos oldQos = ((DomainParticipantFactoryQosImpl) qos)
139 int rc = this.factory.set_qos(oldQos);
141 "DomainParticipantFactory.setQos() failed.");
144 "DomainParticipantFactoryQos not supplied by OpenSplice Service provider.");
151 DDS.DomainParticipantQosHolder holder;
154 holder =
new DDS.DomainParticipantQosHolder();
155 rc = this.factory.get_default_participant_qos(holder);
157 "DomainParticipantFactory.getDefaultParticipantQos() failed.");
166 DDS.DomainParticipantQos oldQos;
171 "Supplied DomainParticipantQos is null.");
174 rc = this.factory.set_default_participant_qos(oldQos);
176 "DomainParticipantFactory.setDefaultParticipantQos() failed.");
182 this.factory.detach_all_domains(blockOperations, deleteEntities);
The DomainParticipant object plays several roles:
DomainParticipantQos getDefaultParticipantQos()
ServiceEnvironment getEnvironment()
DomainParticipant lookupParticipant(int domainId)
DomainParticipant createParticipant(int domainId)
DomainParticipant createParticipant(int domainId, DomainParticipantQos qos, DomainParticipantListener listener, Class<? extends Status >... statuses)
DomainParticipantFactoryQos getQos()
static DomainParticipantQosImpl convert(OsplServiceEnvironment env, DDS.DomainParticipantQos oldQos)
void setQos(DomainParticipantFactoryQos qos)
DomainParticipant createParticipant(int domainId, DomainParticipantQos qos, DomainParticipantListener listener, Collection< Class<? extends Status >> statuses)
static void checkReturnCode(int retCode, OsplServiceEnvironment environment, String message)
static DomainParticipantFactoryQosImpl convert(OsplServiceEnvironment env, DDS.DomainParticipantFactoryQos oldQos)
void setDefaultParticipantQos(DomainParticipantQos qos)
DomainParticipantFactoryImpl(OsplServiceEnvironment environment)
DomainParticipant createParticipant()
The sole purpose of this class is to allow the creation and destruction of org.omg.dds.domain.DomainParticipant objects.
This is the interface that can be implemented by an application-provided class and then registered wi...
DDS implementations are rooted in this class, a concrete subclass of which can be instantiated based ...
void detachAllDomains(boolean blockOperations, boolean deleteEntities)
void destroyParticipant(DomainParticipantImpl participant)
Status is the abstract root class for all communication status objects.