Skip to content

Package: MemoryProbe$Adapter

MemoryProbe$Adapter

nameinstructionbranchcomplexitylinemethod
MemoryProbe.Adapter()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onBufferAllocateEvent(int)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onBufferAllocateFromPoolEvent(int)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
onBufferReleaseToPoolEvent(int)
M: 1 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 2010, 2020 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package org.glassfish.grizzly.memory;
18:
19: /**
20: * {@link MemoryManager} monitoring probe.
21: *
22: * @author Alexey Stashok
23: */
24: public interface MemoryProbe {
25: /**
26: * Called by {@link MemoryManager}, when new buffer gets allocated
27: *
28: * @param size buffer size
29: */
30: void onBufferAllocateEvent(int size);
31:
32: /**
33: * Called by {@link MemoryManager}, when buffer gets allocated from some pool
34: *
35: * @param size buffer size
36: */
37: void onBufferAllocateFromPoolEvent(int size);
38:
39: /**
40: * Called by {@link MemoryManager}, when buffer gets released into a buffer pool
41: *
42: * @param size buffer size
43: */
44: void onBufferReleaseToPoolEvent(int size);
45:
46: // ---------------------------------------------------------- Nested Classes
47:
48: /**
49: * {@link MemoryProbe} adapter that provides no-op implementations for all interface methods allowing easy extension by
50: * the developer.
51: *
52: * @since 2.1.9
53: */
54: @SuppressWarnings("UnusedDeclaration")
55: class Adapter implements MemoryProbe {
56:
57: // -------------------------------------------- Methods from MemoryProbe
58:
59: /**
60: * {@inheritDoc}
61: */
62: @Override
63: public void onBufferAllocateEvent(int size) {
64: }
65:
66: /**
67: * {@inheritDoc}
68: */
69: @Override
70: public void onBufferAllocateFromPoolEvent(int size) {
71: }
72:
73: /**
74: * {@inheritDoc}
75: */
76: @Override
77: public void onBufferReleaseToPoolEvent(int size) {
78: }
79:
80: } // END Adapter
81: }