OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
EntityFactoryImpl.java
Go to the documentation of this file.
1 /*
2  * Vortex OpenSplice
3  *
4  * This software and documentation are Copyright 2006 to 2021 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.core.policy;
22 
26 
27 public class EntityFactoryImpl extends QosPolicyImpl implements EntityFactory {
28  private static final long serialVersionUID = -775163554877034009L;
29  private final boolean autoEnableCreatedEntities;
30 
32  super(environment);
33  this.autoEnableCreatedEntities = true;
34  }
35 
37  boolean autoEnableCreatedEntities) {
38  super(environment);
39  this.autoEnableCreatedEntities = autoEnableCreatedEntities;
40  }
41 
42  @Override
43  public boolean isAutoEnableCreatedEntities() {
44  return this.autoEnableCreatedEntities;
45  }
46 
47  @Override
49  boolean autoEnableCreatedEntities) {
50  return new EntityFactoryImpl(this.environment,
51  autoEnableCreatedEntities);
52  }
53 
54  @Override
55  public String toString(){
56  return "autoEnableCreatedEntities = " +
57  (this.autoEnableCreatedEntities==true?"true":"false");
58  }
59 
60  @Override
61  public Class<? extends QosPolicy> getPolicyClass() {
62  return EntityFactory.class;
63  }
64 
65  @Override
66  public boolean equals(Object other) {
67  if (!(other instanceof EntityFactoryImpl)) {
68  return false;
69  }
70  return (this.autoEnableCreatedEntities == ((EntityFactoryImpl) other).autoEnableCreatedEntities);
71  }
72 
73  @Override
74  public int hashCode() {
75  return 31 * 17 + (this.autoEnableCreatedEntities ? 1 : 0);
76  }
77 }
This class is the abstract root for all the QoS policies.
Definition: QosPolicy.java:118
EntityFactoryImpl(OsplServiceEnvironment environment)
EntityFactoryImpl(OsplServiceEnvironment environment, boolean autoEnableCreatedEntities)
EntityFactory withAutoEnableCreatedEntities(boolean autoEnableCreatedEntities)
Copy this policy and override the value of the property.
Controls the behavior of the org.omg.dds.core.Entity when acting as a factory for other entities...