public class Participant extends Object
Constructor and Description |
---|
Participant()
Create a Participant with domainId 0 and participantId -1.
|
Participant(int domainId)
Create a Participant with given domainId and participantId -1.
|
Participant(int domainId,
int participantId)
Create a Participant with given domainId and participantId.
|
Participant(int domainId,
int participantId,
EntityFactory ef,
Configuration cfg)
Create a Participant with given domainId and participantId.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntityListener(EntityListener el)
Adds a new EntityListener
|
void |
assertLiveliness()
Asserts liveliness of writers, whose QosLiveliness kind is MANUAL_BY_PARTICIPANT.
|
void |
close()
Close this participant.
|
<T> DataReader<T> |
createDataReader(Class<T> type)
Create a new DataReader for given type T.
|
<T> DataReader<T> |
createDataReader(Class<T> type,
QualityOfService qos)
Create a new DataReader for given type T.
|
<T> DataReader<T> |
createDataReader(String topicName,
Class<T> type,
String typeName,
QualityOfService qos)
Create a DataReader.
|
<T> DataWriter<T> |
createDataWriter(Class<T> type)
Creates a new DataWriter of given type.
|
<T> DataWriter<T> |
createDataWriter(Class<T> type,
QualityOfService qos)
Creates a new DataWriter of given type.
|
<T> DataWriter<T> |
createDataWriter(String topicName,
Class<T> type,
String typeName,
QualityOfService qos)
Create a DataWriter.
|
List<EntityListener> |
getEntityListeners()
Gets EntityListeners
|
Guid |
getGuid()
Gets the Guid of this Participant.
|
DataReader<?> |
getReader(EntityId readerId)
Finds a Reader with given entity id.
|
List<DataReader<?>> |
getReaders()
Gets DataReaders created by this Participant.
|
DataWriter<?> |
getWriter(EntityId writerId)
Finds a Writer with given entity id.
|
List<DataWriter<?>> |
getWriters()
Gets DataWriters created by this Participant.
|
void |
setEntityFactory(EntityFactory ef)
Sets the EntityFactory of this Participant to given one.
|
<T> void |
setMarshaller(Class<T> type,
Marshaller<T> m)
Sets a type specific Marshaller.
|
public Participant()
public Participant(int domainId)
domainId
- domainIdpublic Participant(int domainId, int participantId)
domainId
- Domain IDparticipantId
- Participant IDpublic Participant(int domainId, int participantId, EntityFactory ef, Configuration cfg)
Participant delegates creation of DataWriters and DataReaders to EntityFactory. By providing a custom EntityFactory, application can provide customized DataReaders and DataWriters, including entities for builtin topics.
domainId
- Domain Id of this participant.participantId
- Participant Id of this participant.ef
- EntityFactory to be used. If ef is null, a default EntityFactory will be used.cfg
- Configuration used. If config is null, default Configuration is used.public Guid getGuid()
public <T> DataReader<T> createDataReader(Class<T> type)
T
- Type of DataReadertype
- Type of the DataReader to createpublic <T> DataReader<T> createDataReader(Class<T> type, QualityOfService qos)
T
- Type of DataReadertype
- Type of the DataReader to createqos
- QualityOfService usedpublic <T> DataReader<T> createDataReader(String topicName, Class<T> type, String typeName, QualityOfService qos)
T
- Type of the readertopicName
- name of the topictype
- type of the DataReadertypeName
- name of the typeqos
- QualityOfServicepublic <T> DataWriter<T> createDataWriter(Class<T> type)
T
- Type of DataWritertype
- A class, that is used with created DataWriter.public <T> DataWriter<T> createDataWriter(Class<T> type, QualityOfService qos)
T
- Type of DataWritertype
- A class, that is used with created DataWriter.qos
- QualityOfServicepublic <T> DataWriter<T> createDataWriter(String topicName, Class<T> type, String typeName, QualityOfService qos)
T
- Type of DataWritertopicName
- name of the topictype
- type of the DataWritertypeName
- name of the type. typeName gets sent to remote readers.qos
- QualityOfServicepublic <T> void setMarshaller(Class<T> type, Marshaller<T> m)
T
- Type of Marshallertype
- a Class, that will be associated with given Marshallerm
- Marshaller associated with given typpublic void setEntityFactory(EntityFactory ef)
This method provides means to create entities by different EntityFactories. For example, one might want to create builtin entities with default EntityFactory, and application entities with customized EntityFactory.
ef
- EntityFactory to setpublic void assertLiveliness()
QosLiveliness
public void close()
public DataReader<?> getReader(EntityId readerId)
readerId
- EntityId of the Readerpublic DataWriter<?> getWriter(EntityId writerId)
writerId
- EntityId of the Writerpublic void addEntityListener(EntityListener el)
el
- EntityListener to addpublic List<EntityListener> getEntityListeners()
public List<DataReader<?>> getReaders()
public List<DataWriter<?>> getWriters()
Copyright © 2016. All rights reserved.