OpenSplice Java 5 DCPS
v6.x
OpenSplice Java 5 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
IteratorImpl.java
Go to the documentation of this file.
1
/*
2
* Vortex OpenSplice
3
*
4
* This software and documentation are Copyright 2006 to 2021 ADLINK
5
* Technology Limited, its affiliated companies and licensors. All rights
6
* reserved.
7
*
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
11
*
12
* http://www.apache.org/licenses/LICENSE-2.0
13
*
14
* Unless required by applicable law or agreed to in writing, software
15
* distributed under the License is distributed on an "AS IS" BASIS,
16
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
* See the License for the specific language governing permissions and
18
* limitations under the License.
19
*
20
*/
21
package
org.opensplice.dds.sub;
22
23
import
java.lang.reflect.Field;
24
25
import
org
.
opensplice
.
dds
.
core
.
DDSExceptionImpl
;
26
import
org
.
opensplice
.
dds
.
core
.
IllegalArgumentExceptionImpl
;
27
import
org
.
opensplice
.
dds
.
core
.
OsplServiceEnvironment
;
28
29
import
DDS.SampleInfoSeqHolder;
30
31
public
class
IteratorImpl
<TYPE>
extends
AbstractIterator
<TYPE> {
32
private
TYPE[] data;
33
34
public
IteratorImpl
(
OsplServiceEnvironment
environment
,
35
DataReaderImpl<TYPE>
reader
, Object
sampleSeqHolder
,
36
Field
dataSeqHolderValue
, SampleInfoSeqHolder
infoSeqHolder
) {
37
super(environment, reader, sampleSeqHolder, dataSeqHolderValue,
38
infoSeqHolder);
39
}
40
41
@SuppressWarnings(
"unchecked"
)
42
@Override
43
protected
SampleImpl<TYPE>
[]
setupSampleList
() {
44
try
{
45
this.data = (TYPE[])
dataSeqHolderValue
.get(
sampleSeqHolder
);
46
47
}
catch
(SecurityException e) {
48
throw
new
IllegalArgumentExceptionImpl
(
environment
,
49
"Not allowed to access field "
50
+
dataSeqHolderValue
.getName() +
" in "
51
+
dataSeqHolderValue
.getClass().getName() +
"("
52
+ e.getMessage() +
")."
);
53
}
catch
(IllegalArgumentException e) {
54
throw
new
DDSExceptionImpl
(
environment
,
"Cannot find "
55
+
dataSeqHolderValue
.getName() +
" in "
56
+
dataSeqHolderValue
.getClass().getName() +
"("
57
+ e.getMessage() +
")."
);
58
}
catch
(IllegalAccessException e) {
59
throw
new
DDSExceptionImpl
(
environment
,
"No access to field "
60
+
dataSeqHolderValue
.getName() +
" in "
61
+
dataSeqHolderValue
.getClass().getName() +
"("
62
+ e.getMessage() +
")."
);
63
}
64
return
new
SampleImpl
[this.data.length];
65
}
66
67
@Override
68
protected
TYPE
getData
(
int
index) {
69
return
this.data[index];
70
}
71
}
org.opensplice.dds.core.IllegalArgumentExceptionImpl
Definition:
IllegalArgumentExceptionImpl.java:26
org.opensplice.dds.sub.AbstractIterator.environment
final OsplServiceEnvironment environment
Definition:
AbstractIterator.java:34
org.opensplice
org.opensplice.dds.core.OsplServiceEnvironment
Definition:
OsplServiceEnvironment.java:50
org.opensplice.dds.sub.IteratorImpl.IteratorImpl
IteratorImpl(OsplServiceEnvironment environment, DataReaderImpl< TYPE > reader, Object sampleSeqHolder, Field dataSeqHolderValue, SampleInfoSeqHolder infoSeqHolder)
Definition:
IteratorImpl.java:34
org.opensplice.dds.sub.AbstractIterator.reader
final AbstractDataReader< TYPE > reader
Definition:
AbstractIterator.java:33
org.opensplice.dds.core
Definition:
AlreadyClosedExceptionImpl.java:21
org.opensplice.dds.sub.AbstractIterator.sampleSeqHolder
final Object sampleSeqHolder
Definition:
AbstractIterator.java:36
org.opensplice.dds.sub.AbstractIterator.infoSeqHolder
final SampleInfoSeqHolder infoSeqHolder
Definition:
AbstractIterator.java:35
org.opensplice.dds.sub.AbstractIterator.dataSeqHolderValue
final Field dataSeqHolderValue
Definition:
AbstractIterator.java:37
org.opensplice.dds.sub.AbstractIterator
Definition:
AbstractIterator.java:32
org.opensplice.dds.sub.IteratorImpl.setupSampleList
SampleImpl< TYPE > [] setupSampleList()
Definition:
IteratorImpl.java:43
org.opensplice.dds.sub.SampleImpl
Definition:
SampleImpl.java:34
org.opensplice.dds
org.opensplice.dds.sub.IteratorImpl
Definition:
IteratorImpl.java:31
org.opensplice.dds.sub.IteratorImpl.getData
TYPE getData(int index)
Definition:
IteratorImpl.java:68
org.opensplice.dds.core.DDSExceptionImpl
Definition:
DDSExceptionImpl.java:26
org.opensplice.dds.sub.DataReaderImpl
Definition:
DataReaderImpl.java:40
org
java5
common
java
code
org
opensplice
dds
sub
IteratorImpl.java
Generated by
1.8.13