OpenSplice Java 5 DCPS  v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
org.omg.dds.core.DomainEntity< LISTENER extends EventListener, QOS extends EntityQos<?> Interface Template Reference

DomainEntity is the abstract base class for all DCPS entities, except for the org.omg.dds.domain.DomainParticipant. More...

Inheritance diagram for org.omg.dds.core.DomainEntity< LISTENER extends EventListener, QOS extends EntityQos<?>:
Inheritance graph
Collaboration diagram for org.omg.dds.core.DomainEntity< LISTENER extends EventListener, QOS extends EntityQos<?>:
Collaboration graph

Public Member Functions

abstract void close ()
 Halt communication and dispose the resources held by this Entity. More...
 
void enable ()
 This operation enables the Entity. More...
 
InstanceHandle getInstanceHandle ()
 
LISTENER getListener ()
 This operation allows access to the existing Listener attached to the Entity. More...
 
Entity<?, ?> getParent ()
 
QOS getQos ()
 This operation allows access to the existing set of QoS policies for the Entity. More...
 
Set< Class<? extends Status > > getStatusChanges ()
 This operation retrieves the list of communication statuses in the Entity that are 'triggered. More...
 
StatusCondition<?> getStatusCondition ()
 This operation allows access to the org.omg.dds.core.StatusCondition associated with the Entity. More...
 
void retain ()
 Indicates that references to this object may go out of scope but that the application expects to look it up again later. More...
 
void setListener (LISTENER listener)
 This operation installs a Listener on the Entity. More...
 
void setListener (LISTENER listener, Collection< Class<? extends Status >> statuses)
 This operation installs a Listener on the Entity. More...
 
void setListener (LISTENER listener, Class<? extends Status >... statuses)
 This operation installs a Listener on the Entity. More...
 
void setQos (QOS qos)
 This operation is used to set the QoS policies of the Entity. More...
 

Detailed Description

DomainEntity is the abstract base class for all DCPS entities, except for the org.omg.dds.domain.DomainParticipant.

Its sole purpose is to express that DomainParticipant is a special kind of Entity, which acts as a container of all other Entity, but itself cannot contain other DomainParticipant.

Parameters
<LISTENER>The listener interface appropriate for this entity.
<QOS>The QoS interface appropriate for this entity.

Definition at line 32 of file DomainEntity.java.

Member Function Documentation

◆ close()

abstract void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.close ( )
abstractinherited

Halt communication and dispose the resources held by this Entity.

Closing an Entity implicitly closes all of its contained objects, if any. For example, closing a Publisher also closes all of its contained DataWriters.

An Entity cannot be closed if it has any unclosed dependent objects, not including contained objects. These include the following:

The deletion of a org.omg.dds.pub.DataWriter will automatically unregister all instances. Depending on the settings of the org.omg.dds.core.policy.WriterDataLifecycle, the deletion of the DataWriter may also dispose all instances.

Exceptions
PreconditionNotMetExceptionif close is called on an Entity with unclosed dependent object(s), not including contained objects.
See also
org.omg.dds.topic.TopicDescription::close()

◆ enable()

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.enable ( )
inherited

This operation enables the Entity.

Entity objects can be created either enabled or disabled. This is controlled by the value of the org.omg.dds.core.policy.EntityFactory on the corresponding factory for the Entity.

The default setting of org.omg.dds.core.policy.EntityFactory is such that, by default, it is not necessary to explicitly call enable on newly created entities.

The enable operation is idempotent. Calling enable on an already enabled Entity has no effect.

If an Entity has not yet been enabled, the following kinds of operations may be invoked on it:

  • Operations to set or get an Entity's QoS policies (including default QoS policies) and listener
  • getStatusCondition()
  • 'factory' operations and close()
  • getStatusChanges() and other get status operations (although the status of a disabled entity never changes)
  • 'lookup' operations

Other operations may explicitly state that they may be called on disabled entities; those that do not will fail with org.omg.dds.core.NotEnabledException.

It is legal to delete an Entity that has not been enabled by calling close(). Entities created from a factory that is disabled are created disabled regardless of the setting of org.omg.dds.core.policy.EntityFactory.

Calling enable on an Entity whose factory is not enabled will fail with org.omg.dds.core.PreconditionNotMetException.

If org.omg.dds.core.policy.EntityFactory#isAutoEnableCreatedEntities() is true, the enable operation on the factory will automatically enable all entities created from the factory.

The Listeners associated with an entity are not called until the entity is enabled. org.omg.dds.core.Conditions associated with an entity that is not enabled are "inactive," that is, have a triggerValue == false.

In addition to the general description, the enable operation on a org.omg.dds.sub.Subscriber has special meaning in specific usecases. This applies only to Subscribers with PresentationQoS coherent-access set to true with access-scope set to group.

In this case the subscriber is always created in a disabled state, regardless of the factory's auto-enable created entities setting. While the subscriber remains disabled, DataReaders can be created that will participate in coherent transactions of the subscriber.

See org.omg.dds.sub.Subscriber#beginAccess() and org.omg.dds.sub.Subscriber#endAccess() for more information.

All DataReaders will also be created in a disabled state. Coherency with group access-scope requires data to be delivered as a transaction, atomically, to all eligible readers. Therefore data should not be delivered to any single DataReader immediately after it's created, as usual, but only after the application has finished creating all DataReaders for a given Subscriber. At this point, the application should enable the Subscriber which in turn enables all its DataReaders.

Note that for a DataWriter which has a corresponding Publisher with a PresentationQoS with coherent-access set to true and access-scope set to topic or group that the HistoryQoS of the DataWriter should be set to KEEP_ALL otherwise the enable operation will fail. See org.omg.dds.pub.Publisher#createDataWriter(Topic, DataWriterQos, DataWriterListener, Collection)

◆ getInstanceHandle()

InstanceHandle org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getInstanceHandle ( )
inherited
Returns
the org.omg.dds.core.InstanceHandle that represents the Entity.

◆ getListener()

LISTENER org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getListener ( )
inherited

This operation allows access to the existing Listener attached to the Entity.

Returns
The attached listener if set, or null otherwise.
See also
#setListener(EventListener)
#setListener(EventListener, Collection)

◆ getParent()

◆ getQos()

QOS org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getQos ( )
inherited

This operation allows access to the existing set of QoS policies for the Entity.

This operation must be provided by each of the derived Entity classes (org.omg.dds.domain.DomainParticipant, org.omg.dds.topic.Topic, org.omg.dds.pub.Publisher, org.omg.dds.pub.DataWriter, org.omg.dds.sub.Subscriber, org.omg.dds.sub.DataReader) so that the policies meaningful to the particular Entity are retrieved.

See also
#setQos(EntityQos)

◆ getStatusChanges()

Set<Class<? extends Status> > org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getStatusChanges ( )
inherited

This operation retrieves the list of communication statuses in the Entity that are 'triggered.

' That is, the list of statuses whose value has changed since the last time the application read the status.

When the entity is first created or if the entity is not enabled, all communication statuses are in the "untriggered" state so the list returned will be empty.

The list of statuses returned refers to the statuses that are triggered on the Entity itself and does not include statuses that apply to contained entities.

Returns
a new Set containing the triggered statuses.

◆ getStatusCondition()

StatusCondition<?> org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.getStatusCondition ( )
inherited

This operation allows access to the org.omg.dds.core.StatusCondition associated with the Entity.

The returned condition can then be added to a org.omg.dds.core.WaitSet so that the application can wait for specific status changes that affect the Entity.

◆ retain()

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.retain ( )
inherited

Indicates that references to this object may go out of scope but that the application expects to look it up again later.

Therefore, the Service must consider this object to be still in use and may not close it automatically.

◆ setListener() [1/3]

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.setListener ( LISTENER  listener)
inherited

This operation installs a Listener on the Entity.

The listener will only be invoked on all communication statuses pertaining to the concrete type of this entity.

It is permitted to use null as the value of the listener. The null listener behaves as a Listener whose operations perform no action.

Only one listener can be attached to each Entity. If a listener was already set, the operation will replace it with the new one. Consequently if the value null is passed for the listener parameter, any existing listener will be removed.

Parameters
listenerthe listener to attach.
See also
getListener()
#setListener(EventListener, Collection)

◆ setListener() [2/3]

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.setListener ( LISTENER  listener,
Collection< Class<? extends Status >>  statuses 
)
inherited

This operation installs a Listener on the Entity.

The listener will only be invoked on the changes of communication status indicated by the specified mask.

It is permitted to use null as the value of the listener. The null listener behaves as a Listener whose operations perform no action.

Only one listener can be attached to each Entity. If a listener was already set, the operation will replace it with the new one. Consequently if the value null is passed for the listener parameter, any existing listener will be removed.

See also
getListener()
#setListener(EventListener)

◆ setListener() [3/3]

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.setListener ( LISTENER  listener,
Class<? extends Status >...  statuses 
)
inherited

This operation installs a Listener on the Entity.

The listener will only be invoked on the changes of communication status indicated by the specified mask.

It is permitted to use null as the value of the listener. The null listener behaves as a Listener whose operations perform no action.

Only one listener can be attached to each Entity. If a listener was already set, the operation will replace it with the new one. Consequently if the value null is passed for the listener parameter, any existing listener will be removed.

See also
getListener()
#setListener(EventListener)

◆ setQos()

void org.omg.dds.core.Entity< LISTENER extends EventListener, QOS extends EntityQos<?>.setQos ( QOS  qos)
inherited

This operation is used to set the QoS policies of the Entity.

This operation must be provided by each of the derived Entity classes (org.omg.dds.domain.DomainParticipant, org.omg.dds.topic.Topic, org.omg.dds.pub.Publisher, org.omg.dds.pub.DataWriter, org.omg.dds.sub.Subscriber, org.omg.dds.sub.DataReader) so that the policies that are meaningful to each Entity can be set.

The set of policies specified as the parameter are applied on top of the existing QoS, replacing the values of any policies previously set.

Certain policies are "immutable"; they can only be set at Entity creation time, or before the entity is made enabled. If setQos is invoked after the Entity is enabled and it attempts to change the value of an "immutable" policy, the operation will fail with org.omg.dds.core.ImmutablePolicyException.

Certain values of QoS policies can be incompatible with the settings of the other policies. The setQos operation will also fail if it specifies a set of values that once combined with the existing values would result in an inconsistent set of policies. In this case, it shall fail with org.omg.dds.core.InconsistentPolicyException.

If the application supplies a non-default value for a QoS policy that is not supported by the implementation of the service, the setQos operation will fail with UnsupportedOperationException.

The existing set of policies are only changed if the setQos operation succeeds. In all other cases, none of the policies is modified.

Exceptions
ImmutablePolicyExceptionif an immutable policy changes its value.
InconsistentPolicyExceptionif a combination of policies is inconsistent with one another.
UnsupportedOperationExceptionif an unsupported policy has a non-default value.
See also
getQos()

The documentation for this interface was generated from the following file: