Skip to content
This repository was archived by the owner on Mar 21, 2022. It is now read-only.

Commit f016691

Browse files
author
Christian Zirkelbach
committed
Adapted to change in Kieker
1 parent 8b4f8a6 commit f016691

File tree

1 file changed

+39
-51
lines changed
  • explorviz-backend-kiekeradapter/src/main/java/net/explorviz/kiekeradapter/filter/teetime

1 file changed

+39
-51
lines changed

explorviz-backend-kiekeradapter/src/main/java/net/explorviz/kiekeradapter/filter/teetime/Connection.java

Lines changed: 39 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,22 @@
33
/***************************************************************************
44
* Copyright (C) 2016 iObserve Project (https://www.iobserve-devops.net)
55
*
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
6+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
7+
* in compliance with the License. You may obtain a copy of the License at
98
*
10-
* http://www.apache.org/licenses/LICENSE-2.0
9+
* http://www.apache.org/licenses/LICENSE-2.0
1110
*
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.
11+
* Unless required by applicable law or agreed to in writing, software distributed under the License
12+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13+
* or implied. See the License for the specific language governing permissions and limitations under
14+
* the License.
1715
***************************************************************************/
1816

1917
import java.nio.ByteBuffer;
2018
import java.nio.channels.SocketChannel;
21-
2219
import kieker.common.record.io.BinaryValueDeserializer;
2320
import kieker.common.record.io.IValueDeserializer;
24-
import kieker.common.util.registry.IRegistry;
25-
26-
import teetime.stage.io.network.util.GetValueAdapter;
27-
import teetime.stage.io.network.util.ReaderRegistry;
21+
import kieker.common.registry.reader.ReaderRegistry;
2822

2923
/**
3024
* Represents one connection to read records from.
@@ -34,47 +28,41 @@
3428
*/
3529
public class Connection {
3630

37-
/** String registry for one connection. */
38-
private final ReaderRegistry<String> registry = new ReaderRegistry<>();
39-
/** The connection channel for in and output. */
40-
private final SocketChannel channel;
41-
/** String registy wrapper. */
42-
private final IRegistry<String> stringRegistryWrapper;
43-
/** Byte buffer for reading the channel. */
44-
private final ByteBuffer buffer;
45-
/** Deserializer setup. */
46-
private final IValueDeserializer deserializer;
31+
/** The connection channel for in and output. */
32+
private final SocketChannel channel;
33+
/** String registy wrapper. */
34+
private final ReaderRegistry<String> registry = new ReaderRegistry<>();
35+
/** Byte buffer for reading the channel. */
36+
private final ByteBuffer buffer;
37+
/** Deserializer setup. */
38+
private final IValueDeserializer deserializer;
4739

48-
/**
49-
* Create a connection for the given channel and utilizing the specified buffer
50-
* size.
51-
*
52-
* @param channel
53-
* connection channel used to read data
54-
* @param bufferSize
55-
* buffer size for reading information
56-
*/
57-
public Connection(final SocketChannel channel, final int bufferSize) {
58-
this.channel = channel;
59-
this.stringRegistryWrapper = new GetValueAdapter<>(this.registry);
60-
this.buffer = ByteBuffer.allocateDirect(bufferSize);
61-
this.deserializer = BinaryValueDeserializer.create(this.buffer, this.stringRegistryWrapper);
62-
}
40+
/**
41+
* Create a connection for the given channel and utilizing the specified buffer size.
42+
*
43+
* @param channel connection channel used to read data
44+
* @param bufferSize buffer size for reading information
45+
*/
46+
public Connection(final SocketChannel channel, final int bufferSize) {
47+
this.channel = channel;
48+
this.buffer = ByteBuffer.allocateDirect(bufferSize);
49+
this.deserializer = BinaryValueDeserializer.create(this.buffer, this.registry);
50+
}
6351

64-
public ReaderRegistry<String> getRegistry() {
65-
return this.registry;
66-
}
52+
public ReaderRegistry<String> getRegistry() {
53+
return this.registry;
54+
}
6755

68-
public SocketChannel getChannel() {
69-
return this.channel;
70-
}
56+
public SocketChannel getChannel() {
57+
return this.channel;
58+
}
7159

72-
public ByteBuffer getBuffer() {
73-
return this.buffer;
74-
}
60+
public ByteBuffer getBuffer() {
61+
return this.buffer;
62+
}
7563

76-
public IValueDeserializer getValueDeserializer() {
77-
return this.deserializer;
78-
}
64+
public IValueDeserializer getValueDeserializer() {
65+
return this.deserializer;
66+
}
7967

8068
}

0 commit comments

Comments
 (0)