Skip to content

Commit a38ad7e

Browse files
authored
prepare for next release (#70)
1 parent fec799a commit a38ad7e

File tree

15 files changed

+77
-50
lines changed

15 files changed

+77
-50
lines changed

.github/workflows/test-against-snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
fail-fast: false
4545
matrix:
4646
coherenceVersion:
47-
- 23.03.1-SNAPSHOT
47+
- 23.03.2-SNAPSHOT
4848
- 22.06.6-SNAPSHOT
4949

5050
steps:

coherence-visualvm-plugin/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<parent>
3434
<groupId>com.oracle.coherence.plugin.visualvm</groupId>
3535
<artifactId>coherence-visualvm-main</artifactId>
36-
<version>1.6.1-SNAPSHOT</version>
36+
<version>1.6.2-SNAPSHOT</version>
3737
<relativePath>../pom.xml</relativePath>
3838
</parent>
3939

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/CoherenceApplicationType.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2023 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -56,6 +56,7 @@ public CoherenceApplicationType(Application app, Jvm jvm, String sMainClass)
5656
+ " (" + sMainClass + ")"
5757
+ "\nCommand Line:" + jvm.getJvmArgs();
5858
this.f_sIconPath = IMAGE_PATH;
59+
this.f_app = app;
5960
}
6061

6162
// ----- accessors ------------------------------------------------------
@@ -101,6 +102,11 @@ public Image getIcon()
101102
*/
102103
private final String f_sIconPath;
103104

105+
/**
106+
* Application.
107+
*/
108+
private final Application f_app;
109+
104110
/**
105111
* {@link Map} of possible classes to detect.
106112
*/

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/CoherenceOptionsPanel.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ public String analyze(boolean fVerbose)
548548
e.getValue()));
549549
setMetrics.stream()
550550
.filter(m->m.getServiceName().equals(s) && m.getPartitionId() == nPartitionId)
551-
.forEach(m->sb.append(String.format(" %s%n", mapLines.get(m.getLineId()))));
551+
.forEach(m->sb.append(String.format(FORMAT, mapLines.get(m.getLineId()))));
552552
});
553553

554554
sb.append("\nOutput by partition and event for ").append(s).append('\n');
@@ -563,10 +563,10 @@ public String analyze(boolean fVerbose)
563563
sb.append("- Partition ").append(p).append('\n');
564564
// retrieve the initial partition assign which has been marked with partition of -1
565565
setMetrics.stream().filter(m -> m.getServiceName().equals(s) && m.getPartitionId() == -1)
566-
.forEach(m -> sb.append(String.format(" %s%n", mapLines.get(m.getLineId()))));
566+
.forEach(m -> sb.append(String.format(FORMAT, mapLines.get(m.getLineId()))));
567567
setMetrics.stream()
568568
.filter(m -> m.getServiceName().equals(s) && m.getPartitionId() == p)
569-
.forEach(m -> sb.append(String.format(" %s%n", mapLines.get(m.getLineId()))));
569+
.forEach(m -> sb.append(String.format(FORMAT, mapLines.get(m.getLineId()))));
570570
});
571571
}
572572
});
@@ -608,6 +608,7 @@ private String formatLine(String sFormat, long nTotalMillis, String sServiceName
608608
private static final String MIN = " Min (ms)";
609609
private static final String TOTAL = " Total (ms)";
610610
private static final String PERCENT = " Percent";
611+
private static final String FORMAT = " %s%n";
611612

612613
// ----- data members -----------------------------------------------
613614

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/VisualVMModel.java

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -382,15 +382,8 @@ private boolean shouldRetrieveData(DataType type)
382382
return false;
383383
}
384384

385-
if (!isExecutorConfigured() &&
386-
(
387-
clazz.equals(DataType.EXECUTOR.getClassName())
388-
))
389-
{
390-
return false;
391-
}
392-
393-
return true;
385+
return isExecutorConfigured() ||
386+
(!clazz.equals(DataType.EXECUTOR.getClassName()));
394387
}
395388

396389
/**
@@ -1343,8 +1336,8 @@ public enum DataType
13431336

13441337
private DataType(Class<?> clz, String[] asMeta)
13451338
{
1346-
clazz = clz;
1347-
asMetadata = asMeta;
1339+
f_clazz = clz;
1340+
f_asMetadata = asMeta;
13481341
}
13491342

13501343
/**
@@ -1354,7 +1347,7 @@ private DataType(Class<?> clz, String[] asMeta)
13541347
*/
13551348
public Class<?> getClassName()
13561349
{
1357-
return clazz;
1350+
return f_clazz;
13581351
}
13591352

13601353
/**
@@ -1364,18 +1357,18 @@ public Class<?> getClassName()
13641357
*/
13651358
public String[] getMetadata()
13661359
{
1367-
return asMetadata;
1360+
return f_asMetadata;
13681361
}
13691362

13701363
/**
13711364
* The {@link Class} associated with this enum.
13721365
*/
1373-
private final Class<?> clazz;
1366+
private final Class<?> f_clazz;
13741367

13751368
/**
13761369
* The column name associated with this enum.
13771370
*/
1378-
private final String[] asMetadata;
1371+
private final String[] f_asMetadata;
13791372
}
13801373

13811374
/**
@@ -1393,6 +1386,8 @@ public String[] getMetadata()
13931386
private static final String LBL_SIZE = "LBL_size";
13941387
private static final String LBL_CACHE_HITS = "LBL_cache_hits";
13951388
private static final String LBL_CACHE_MISSES = "LBL_cache_misses";
1389+
private static final String LBL_TOTAL_GETS = "LBL_total_gets";
1390+
private static final String LBL_TOTAL_PUTS = "LBL_total_puts";
13961391

13971392
/**
13981393
* Labels for service table.
@@ -1472,8 +1467,8 @@ public String[] getMetadata()
14721467
private static final String[] CACHE_DETAIL_LABELS = new String[]
14731468
{
14741469
Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText(LBL_SIZE),
1475-
Localization.getLocalText(LBL_MEMORY_BYTES), Localization.getLocalText("LBL_total_gets"),
1476-
Localization.getLocalText("LBL_total_puts"), Localization.getLocalText(LBL_CACHE_HITS),
1470+
Localization.getLocalText(LBL_MEMORY_BYTES), Localization.getLocalText(LBL_TOTAL_GETS),
1471+
Localization.getLocalText(LBL_TOTAL_PUTS), Localization.getLocalText(LBL_CACHE_HITS),
14771472
Localization.getLocalText(LBL_CACHE_MISSES), Localization.getLocalText("LBL_hit_probability")
14781473
};
14791474

@@ -1483,7 +1478,7 @@ public String[] getMetadata()
14831478
private static final String[] CACHE_FRONT_DETAIL_LABELS = new String[]
14841479
{
14851480
Localization.getLocalText(LBL_NODE_ID), Localization.getLocalText(LBL_SIZE),
1486-
Localization.getLocalText("LBL_total_gets"), Localization.getLocalText("LBL_total_puts"),
1481+
Localization.getLocalText(LBL_TOTAL_GETS), Localization.getLocalText(LBL_TOTAL_PUTS),
14871482
Localization.getLocalText(LBL_CACHE_HITS), Localization.getLocalText(LBL_CACHE_MISSES),
14881483
Localization.getLocalText("LBL_hit_probability")
14891484
};
@@ -1684,8 +1679,8 @@ public String[] getMetadata()
16841679
*/
16851680
private static final String[] JCACHE_STATS_LABELS = new String[]
16861681
{
1687-
Localization.getLocalText("LBL_config_cache"), Localization.getLocalText("LBL_total_puts"),
1688-
Localization.getLocalText("LBL_total_gets"), Localization.getLocalText("LBL_removals"),
1682+
Localization.getLocalText("LBL_config_cache"), Localization.getLocalText(LBL_TOTAL_PUTS),
1683+
Localization.getLocalText(LBL_TOTAL_GETS), Localization.getLocalText("LBL_removals"),
16891684
Localization.getLocalText(LBL_CACHE_HITS), Localization.getLocalText(LBL_CACHE_MISSES),
16901685
Localization.getLocalText("LBL_evictions"), Localization.getLocalText("GRPH_average_get_time"),
16911686
Localization.getLocalText("GRPH_average_put_time"), Localization.getLocalText("GRPH_average_remove_time"),

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/HttpRequestSender.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ public Set<ObjectName> getAllServiceMembers()
515515

516516
// the type attribute returned in the response is the service type, but in the object name,
517517
// type is always Service
518-
mapKeysProps.put("type", "Service");
518+
mapKeysProps.put("type", SERVICE_CC);
519519
setObjectNames.add(new ObjectName(COHERENCE, mapKeysProps));
520520
}
521521
}
@@ -799,7 +799,7 @@ public Object executeSubscriberOperation(Pair<String, String> topic, long nSubsc
799799
{
800800
case CoherenceTopicPanel.RETRIEVE_HEADS:
801801
sRealOperation = "heads";
802-
sKey = "links";
802+
sKey = LINKS;
803803
break;
804804
case CoherenceTopicPanel.NOTIFY_POPULATED:
805805
sRealOperation = "notifyPopulated";
@@ -865,7 +865,7 @@ public Set<ObjectName> getMembersOfService(String sServiceName, String sDomainPa
865865

866866
Hashtable<String, String> mapKeysProps = new Hashtable<>();
867867
serviceMember.fields().forEachRemaining(e -> mapKeysProps.put(e.getKey(), e.getValue().asText()));
868-
mapKeysProps.put("type", "Service");
868+
mapKeysProps.put("type", SERVICE_CC);
869869
setObjectNames.add(new ObjectName(COHERENCE, mapKeysProps));
870870
}
871871
}
@@ -1617,7 +1617,7 @@ private URLBuilder modifyTarget(ObjectName objectName, URLBuilder urlBuilder)
16171617
.addPathSegment(encodeServiceName(getKeyPropertyFromObjName(objectName, SERVICE)))
16181618
.addPathSegment(CACHES).addPathSegment(objectName.getKeyProperty("cache"))
16191619
.addPathSegment(MEMBERS).addPathSegment(getKeyPropertyFromObjName(objectName, NODE_ID));
1620-
case "Service":
1620+
case SERVICE_CC:
16211621
return urlBuilder.addPathSegment(SERVICES)
16221622
.addPathSegment(encodeServiceName(getKeyPropertyFromObjName(objectName, "name")))
16231623
.addPathSegment(MEMBERS).addPathSegment(getKeyPropertyFromObjName(objectName, NODE_ID))
@@ -1676,8 +1676,9 @@ private URLBuilder modifyTarget(ObjectName objectName, URLBuilder urlBuilder)
16761676
return urlBuilder.addPathSegment("operatingSystem");
16771677
}
16781678
}
1679+
default:
1680+
return null;
16791681
}
1680-
return null;
16811682
}
16821683

16831684
/**
@@ -2003,6 +2004,7 @@ private void initSSL()
20032004
private static final String SUBSCRIBERS = "subscribers";
20042005
private static final String SUBGROUPS = "subscriberGroups";
20052006
private static final String SERVICE = "service";
2007+
private static final String SERVICE_CC = "Service";
20062008
private static final String MEMBERS = "members";
20072009
private static final String CACHES = "caches";
20082010
private static final String PERSISTENCE = "persistence";
@@ -2037,11 +2039,13 @@ public java.security.cert.X509Certificate[] getAcceptedIssuers()
20372039
@Override
20382040
public void checkClientTrusted(X509Certificate[] certs, String authType)
20392041
{
2042+
// empty as we want a way for user to connect using invalid cer
20402043
}
20412044

20422045
@Override
20432046
public void checkServerTrusted(X509Certificate[] certs, String authType)
20442047
{
2048+
// empty as we want a way for user to connect using invalid cert
20452049
}
20462050
}
20472051
};

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/JMXRequestSender.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ public Set getCacheMembers(String sServiceName, String sCacheName, String sDomai
138138
throws Exception
139139
{
140140
return f_connection.queryNames(new ObjectName("Coherence:type=Cache,service=" + sServiceName
141-
+ (sDomainPartition != null ? ",domainPartition=" + sDomainPartition : "")
142-
+ ",name=" + sCacheName + ",*"), null);
141+
+ (sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "")
142+
+ NAME + sCacheName + ",*"), null);
143143
}
144144

145145
@Override
@@ -148,15 +148,15 @@ public Set<ObjectName> getCacheStorageMembers(String sServiceName, String sCache
148148
{
149149

150150
return f_connection.queryNames(new ObjectName("Coherence:type=StorageManager,service="
151-
+ sServiceName + (sDomainPartition != null ? ",domainPartition=" + sDomainPartition : "")
151+
+ sServiceName + (sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "")
152152
+ ",cache=" + sCacheName + ",*"), null);
153153
}
154154

155155
@Override
156156
public Set<ObjectName> getAllClusters()
157157
throws Exception
158158
{
159-
return f_connection.queryNames(new ObjectName("Coherence:type=Cluster,*"), null);
159+
return f_connection.queryNames(new ObjectName(CLUSTER), null);
160160
}
161161

162162
@Override
@@ -232,7 +232,7 @@ public Set<ObjectName> getMembersOfService(String sServiceName, String sDomainPa
232232
throws Exception
233233
{
234234
return f_connection.queryNames(new ObjectName("Coherence:type=Service,name=" + sServiceName +
235-
(sDomainPartition != null ? ",domainPartition=" + sDomainPartition : "") + ",*"), null);
235+
(sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "") + ",*"), null);
236236
}
237237

238238
@Override
@@ -261,7 +261,7 @@ public Set<ObjectName> getPartitionAssignmentObjectName(String sService, String
261261
throws Exception
262262
{
263263
String sQuery = "Coherence:type=PartitionAssignment,service="
264-
+ sService + (sDomainPartition != null ? ",domainPartition=" + sDomainPartition : "")
264+
+ sService + (sDomainPartition != null ? DOMAIN_PARTITION + sDomainPartition : "")
265265
+ ",responsibility=DistributionCoordinator,*";
266266
return f_connection.queryNames(new ObjectName(sQuery), null);
267267
}
@@ -304,13 +304,13 @@ public void invokeDisconnectAll(String sService, String sTopic, String sSubscrib
304304
if (sSubscriberGroup == null)
305305
{
306306
// topic only
307-
objectName = new ObjectName("Coherence:type=PagedTopic,service=" + sService + ",name=" + sTopic + ",*");
307+
objectName = new ObjectName("Coherence:type=PagedTopic,service=" + sService + NAME + sTopic + ",*");
308308
}
309309
else
310310
{
311311
// subscriber group
312312
objectName = new ObjectName("Coherence:type=PagedTopicSubscriberGroup,service=" + sService + ",topic=" + sTopic +
313-
",name=" + sSubscriberGroup + ",*");
313+
NAME + sSubscriberGroup + ",*");
314314
}
315315

316316

@@ -380,7 +380,7 @@ public void dumpClusterHeap(String sRole) throws Exception
380380
{
381381
// look up the full name of the MBean in case we are in container
382382
Set<ObjectName> setResult = getCompleteObjectName(
383-
new ObjectName("Coherence:type=Cluster,*"));
383+
new ObjectName(CLUSTER));
384384

385385
String sFQN = getFirstResult(setResult);
386386

@@ -491,7 +491,7 @@ public int getLocalMemberId()
491491

492492
try
493493
{
494-
memberId = (Integer) JMXUtils.runJMXQuerySingleResult(f_connection, "Coherence:type=Cluster,*",
494+
memberId = (Integer) JMXUtils.runJMXQuerySingleResult(f_connection, CLUSTER,
495495
new JMXUtils.Attribute("LocalMemberId"));
496496
}
497497
catch (Exception e)
@@ -618,6 +618,10 @@ private String getFirstResult(Set<ObjectName> setResult)
618618
*/
619619
private static final Logger LOGGER = Logger.getLogger(JMXRequestSender.class.getName());
620620

621+
private static final String DOMAIN_PARTITION = ",domainPartition=";
622+
private static final String NAME = ",name=";
623+
private static final String CLUSTER = "Coherence:type=Cluster,*";
624+
621625
// ------ data members --------------------------------------------------
622626

623627
/**

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/helper/JMXUtils.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@
4242
*/
4343
public class JMXUtils
4444
{
45+
// ----- constructors ---------------------------------------------------
46+
47+
/**
48+
* Private constructor.
49+
*/
50+
private JMXUtils()
51+
{
52+
}
4553

4654
// ----- helpers --------------------------------------------------------
4755

@@ -188,7 +196,7 @@ public Attribute(String sName)
188196
/**
189197
* A representation of a JMX Field request which can be an Attribute or Key.
190198
*/
191-
protected static abstract class JMXField
199+
protected abstract static class JMXField
192200
{
193201
/**
194202
* Construct a new field request for a given name.

coherence-visualvm-plugin/src/main/java/com/oracle/coherence/plugin/visualvm/impl/CoherenceClusterProvider.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2022 Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2023 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -54,6 +54,15 @@
5454
*/
5555
public class CoherenceClusterProvider
5656
{
57+
// ----- constructors ---------------------------------------------------
58+
59+
/**
60+
* Private constructor.
61+
*/
62+
private CoherenceClusterProvider()
63+
{
64+
}
65+
5766
// ----- CoherenceClusterProvider methods -------------------------------
5867

5968
/**

coherence-visualvm-tests/coherence-visualvm-tests-ce/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<parent>
3434
<groupId>com.oracle.coherence.plugin.visualvm</groupId>
3535
<artifactId>coherence-visualvm-tests</artifactId>
36-
<version>1.6.1-SNAPSHOT</version>
36+
<version>1.6.2-SNAPSHOT</version>
3737
<relativePath>../pom.xml</relativePath>
3838
</parent>
3939

0 commit comments

Comments
 (0)