OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
WaitSet.java
Go to the documentation of this file.
1 /* Copyright 2010, Object Management Group, Inc.
2  * Copyright 2010, PrismTech, Inc.
3  * Copyright 2010, Real-Time Innovations, Inc.
4  * All rights reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 package org.omg.dds.core;
20 
21 import java.util.Collection;
22 import java.util.concurrent.TimeUnit;
23 import java.util.concurrent.TimeoutException;
24 
25 
117 public abstract class WaitSet implements DDSObject {
118  // -----------------------------------------------------------------------
119  // Factory Methods
120  // -----------------------------------------------------------------------
121 
128  {
129  return env.getSPI().newWaitSet();
130  }
131 
132 
133 
134  // -----------------------------------------------------------------------
135  // Instance Methods
136  // -----------------------------------------------------------------------
137 
159  public abstract void waitForConditions();
160 
184  public abstract void waitForConditions(
185  Collection<Condition> activeConditions);
186 
214  public abstract void waitForConditions(Duration timeout)
215  throws TimeoutException;
216 
246  public abstract void waitForConditions(long timeout, TimeUnit unit)
247  throws TimeoutException;
248 
277  public abstract void waitForConditions(
278  Collection<Condition> activeConditions,
279  Duration timeout)
280  throws TimeoutException;
281 
311  public abstract void waitForConditions(
312  Collection<Condition> activeConditions,
313  long timeout,
314  TimeUnit unit)
315  throws TimeoutException;
316 
342  public abstract void attachCondition(Condition cond);
343 
355  public abstract void detachCondition(Condition cond);
356 
376  public abstract Collection<Condition> getConditions();
377 }
abstract void waitForConditions()
This operation allows an application thread to wait for the occurrence of a certain condition...
A WaitSet object allows an application to wait until one or more of the attached org.omg.dds.core.Condition objects has a triggerValue of true or else until the timeout expires.
Definition: WaitSet.java:117
abstract ServiceProviderInterface getSPI()
This method is not intended for use by applications.
abstract void detachCondition(Condition cond)
Detaches a Condition from the WaitSet.
abstract Collection< Condition > getConditions()
This operation retrieves the list of attached conditions.
static WaitSet newWaitSet(ServiceEnvironment env)
Creates a new WaitSet object to be used in the application.
Definition: WaitSet.java:127
A Condition is a root interface for all the conditions that may be attached to a org.omg.dds.core.WaitSet.
Definition: Condition.java:31
abstract void attachCondition(Condition cond)
This operation attaches a Condition to the WaitSet.
A supertype of all DDS classes and interfaces.
Definition: DDSObject.java:25
A span of elapsed time expressed with nanosecond precision.
Definition: Duration.java:35
DDS implementations are rooted in this class, a concrete subclass of which can be instantiated based ...