21 package org.opensplice.dds.core;
23 import java.util.Collection;
24 import java.util.HashMap;
35 private static final long serialVersionUID = -5714560284083338546L;
37 protected HashMap<Class<? extends T>, T>
policies;
40 Collection<T> policies) {
42 this.policies =
new HashMap<Class<? extends T>, T>();
49 this.policies =
new HashMap<Class<? extends T>, T>();
56 for (T p : policies) {
64 for (T p : policies) {
70 @SuppressWarnings(
"unchecked")
72 Class<?>[] interfaces = policy.getClass().getInterfaces();
74 if (interfaces.length == 0) {
76 "Provided policy not a valid policy.");
83 if (interfaces[0].getName().startsWith(
84 "org.opensplice.dds.core.policy.")) {
85 Class<?>[] superInterfaces = interfaces[0].getInterfaces();
87 if (superInterfaces.length != 0) {
88 if (!superInterfaces[0].getName().startsWith(
89 "org.omg.dds.core.policy.QosPolicy")) {
90 return (Class<? extends T>) (superInterfaces[0]);
94 return (Class<? extends T>) interfaces[0];
113 return this.
policies.containsKey(arg0);
120 return this.
policies.containsValue(arg0);
125 public Set<java.util.Map.Entry<Class<? extends T>, T>>
entrySet() {
132 public T
get(Object arg0) {
144 public Set<Class<? extends T>>
keySet() {
151 public T
put(Class<? extends T> arg0, T arg1) {
153 return this.
policies.put(arg0, arg1);
158 public void putAll(Map<? extends Class<? extends T>, ? extends T> arg0) {
165 public T
remove(Object arg0) {
169 removed = this.
policies.remove(arg0);
190 public <POLICY extends T> POLICY
get(Class<POLICY> id) {
192 return id.cast(this.
policies.get(
id));
Set< java.util.Map.Entry< Class<? extends T >, T > > entrySet()
Set< Class<? extends T > > keySet()
ServiceEnvironment getEnvironment()
void setupPolicies(T... policies)
EntityQosImpl(OsplServiceEnvironment environment, T... policies)
EntityQosImpl(OsplServiceEnvironment environment, Collection< T > policies)
void setupPolicies(Collection< T > policies)
Class<? extends T > getClassIdForPolicy(T policy)
T put(Class<? extends T > arg0, T arg1)
boolean containsValue(Object arg0)
static PolicyFactory getPolicyFactory(ServiceEnvironment env)
boolean containsKey(Object arg0)
void putAll(Map<? extends Class<? extends T >, ? extends T > arg0)
This class is the abstract root for all the QoS policies.
final OsplServiceEnvironment environment
PolicyFactory getPolicyFactory()
Provides an instance of org.omg.dds.core.policy.PolicyFactory.
DDS implementations are rooted in this class, a concrete subclass of which can be instantiated based ...
HashMap< Class<? extends T >, T > policies
The Data-Distribution Service (DDS) relies on the use of QoS.
abstract void setupMissingPolicies()