OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
DomainParticipantFactoryQosImpl.java
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2024 ADLINK
5  * Technology Limited, its affiliated companies and licensors. All rights
6  * reserved.
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 package org.opensplice.dds.domain;
22 
30 
31 public class DomainParticipantFactoryQosImpl extends
32  EntityQosImpl<ForDomainParticipantFactory> implements
34  private static final long serialVersionUID = -2614760295894669447L;
35 
37  super(environment);
38  }
39 
41  ForDomainParticipantFactory... domainParticipantFactories) {
42  super(environment, domainParticipantFactories);
43  }
44 
45  @Override
46  protected void setupMissingPolicies() {
47  synchronized (this.policies) {
48  if (!this.policies.containsKey(EntityFactory.class)) {
49  this.policies.put(EntityFactory.class, new EntityFactoryImpl(
50  environment));
51  }
52  }
53  }
54 
55  @Override
57  synchronized (this.policies) {
58  return (EntityFactory) this.policies.get(EntityFactory.class);
59  }
60  }
61 
63  OsplServiceEnvironment env, DDS.DomainParticipantFactoryQos oldQos) {
64  if (oldQos == null) {
65  throw new IllegalArgumentExceptionImpl(env,
66  "oldQos parameter is null.");
67  }
68 
70  env);
71 
72  qos.put(EntityFactory.class, new EntityFactoryImpl(env,
73  oldQos.entity_factory.autoenable_created_entities));
74 
75  return qos;
76  }
77 
78  public DDS.DomainParticipantFactoryQos convert() {
79  DDS.DomainParticipantFactoryQos old = new DDS.DomainParticipantFactoryQos(
80  new DDS.EntityFactoryQosPolicy());
81 
82  synchronized (this.policies) {
83  old.entity_factory.autoenable_created_entities = ((EntityFactory) this.policies
84  .get(EntityFactory.class)).isAutoEnableCreatedEntities();
85  }
86  return old;
87  }
88 
89  @Override
92  return this.withPolicies(policy);
93  }
94 
95  @Override
97  ForDomainParticipantFactory... policy) {
98 
100  this.environment);
101  synchronized (this.policies) {
102  result.putAll(this.policies);
103  }
104 
105  for (ForDomainParticipantFactory f : policy) {
106  result.put(getClassIdForPolicy(f), f);
107  }
108  return result;
109  }
110 }
DomainParticipantFactoryQos withPolicies(ForDomainParticipantFactory... policy)
A QosPolicy interface that implements this marker interface applies to org.omg.dds.domain.DomainParticipantFactory objects.
Definition: QosPolicy.java:124
Class<? extends T > getClassIdForPolicy(T policy)
T put(Class<? extends T > arg0, T arg1)
static DomainParticipantFactoryQosImpl convert(OsplServiceEnvironment env, DDS.DomainParticipantFactoryQos oldQos)
void putAll(Map<? extends Class<? extends T >, ? extends T > arg0)
DomainParticipantFactoryQos withPolicy(ForDomainParticipantFactory policy)
This class is the abstract root for all the QoS policies.
Definition: QosPolicy.java:118
final OsplServiceEnvironment environment
DomainParticipantFactoryQosImpl(OsplServiceEnvironment environment, ForDomainParticipantFactory... domainParticipantFactories)
HashMap< Class<? extends T >, T > policies
Controls the behavior of the org.omg.dds.core.Entity when acting as a factory for other entities...