DomainParticipantFactoryQos factory_qos = new DomainParticipantFactoryQos(); try { factory.get_qos(factory_qos); /* Change the QosPolicy to create disabled participants */ factory_qos.entity_factory.autoenable_created_entities = false; factory.set_qos(factory_qos); } catch (RETCODE_ERROR err) { System.out.println( "***Error: changing domain participant factory qos\n"); }
DomainParticipantFactory factory = null; factory = DomainParticipantFactory.get_instance();
int domain_id = 10; DomainParticipantQos participant_qos = new DomainParticipantQos(); // initialize participant_qos with default values factory.get_default_participant_qos(participant_qos); /* Set the peer hosts. These list all the computers the application may communicate with along with the maximum maximum participant index of the participants that can concurrently run on that computer. This list only needs to be a superset of the actual list of computers and participants that will be running at any time. */ /* To run this example across multiple nodes, modify the following IP addresses to match your network configuration. */ final String[] NDDS_DISCOVERY_INITIAL_PEERS = { "1@udpv4://10.10.1.192", "1@udpv4://10.10.1.190", "1@udpv4://10.10.1.152" }; participant_qos.discovery.initial_peers. ensureCapacity(NDDS_DISCOVERY_INITIAL_PEERS.length); for (int i = 0; i < NDDS_DISCOVERY_INITIAL_PEERS.length; ++i) { participant_qos.discovery.initial_peers.add( NDDS_DISCOVERY_INITIAL_PEERS[i]); } // Initialize listener if desired DomainParticipantListener participant_listener = null; // Create the participant DomainParticipant participant = null; try { participant = factory.create_participant( domain_id, participant_qos, participant_listener, StatusKind.STATUS_MASK_NONE); } catch (RETCODE_ERROR err) { // participant couldn't be created }
try { factory.delete_participant(participant); } catch (RETCODE_ERROR err) { // unable to delete }