LISTENER
- The listener interface appropriate for this entity.QOS
- The QoS interface appropriate for this entity.public interface Entity<LISTENER extends EventListener,QOS extends EntityQos<?>> extends Closeable, DDSObject
Modifier and Type | Method and Description |
---|---|
void |
close()
Halt communication and dispose the resources held by this Entity.
|
void |
enable()
This operation enables the Entity.
|
InstanceHandle |
getInstanceHandle() |
LISTENER |
getListener()
This operation allows access to the existing Listener attached to the
Entity.
|
QOS |
getQos()
This operation allows access to the existing set of QoS policies for
the Entity.
|
Set<Class<? extends Status>> |
getStatusChanges()
This operation retrieves the list of communication statuses in the
Entity that are 'triggered.'
|
StatusCondition<?> |
getStatusCondition()
This operation allows access to the
StatusCondition associated
with the Entity. |
void |
retain()
Indicates that references to this object may go out of scope but that
the application expects to look it up again later.
|
void |
setListener(LISTENER listener)
This operation installs a Listener on the Entity.
|
void |
setListener(LISTENER listener,
Collection<Class<? extends Status>> statuses)
This operation installs a Listener on the Entity.
|
void |
setQos(QOS qos)
This operation is used to set the QoS policies of the Entity.
|
void |
setQos(String qosLibraryName,
String qosProfileName)
Set the QoS to that specified in the given QoS profile in the given
QoS library.
|
getEnvironment
LISTENER getListener()
void setListener(LISTENER listener)
void setListener(LISTENER listener, Collection<Class<? extends Status>> statuses)
getListener()
,
setListener(EventListener)
QOS getQos()
DomainParticipant
, Topic
,
Publisher
, DataWriter
, Subscriber
,
DataReader
) so that the policies meaningful to the particular
Entity are retrieved.setQos(EntityQos)
void setQos(QOS qos)
DomainParticipant
, Topic
, Publisher
,
DataWriter
, Subscriber
, 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
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 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.ImmutablePolicyException
- if an immutable policy changes
its value.InconsistentPolicyException
- if a combination of policies is
inconsistent with one another.UnsupportedOperationException
- if an unsupported policy
has a non-default value.getQos()
,
setQos(String, String)
void setQos(String qosLibraryName, String qosProfileName)
qosLibraryName
- qosProfileName
- getQos()
,
setQos(EntityQos)
void enable()
EntityFactory
on the corresponding factory for the
Entity.
The default setting of 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:
getStatusCondition()
close()
getStatusChanges()
and other get status
operations (although the status of a disabled entity never
changes)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
EntityFactory
.
Calling enable on an Entity whose factory is not enabled will fail
with PreconditionNotMetException
.
If 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. Condition
s associated with an entity that
is not enabled are "inactive," that is, have a triggerValue == false.StatusCondition<?> getStatusCondition()
StatusCondition
associated
with the Entity. The returned condition can then be added to a
WaitSet
so that the application can wait for specific status
changes that affect the Entity.Set<Class<? extends Status>> getStatusChanges()
InstanceHandle getInstanceHandle()
InstanceHandle
that represents the Entity.void close()
Topic
cannot be closed if it is still in use by any
ContentFilteredTopic
s or MultiTopic
s.DataWriter
s or
DataReader
is still using it.DataReader.read()
,
DataReader.take()
, or one of the variants thereof.
DataWriter
will automatically unregister all
instances. Depending on the settings of the
WriterDataLifecycle
, the deletion of the DataWriter
may also dispose all instances.close
in interface AutoCloseable
close
in interface Closeable
PreconditionNotMetException
- if close is called on an
Entity with unclosed dependent object(s), not including
contained objects.TopicDescription.close()
void retain()
Copyright © 2014. All rights reserved.