Skip to content

Commit b7e32c3

Browse files
Merge pull request #29 from mathieucarbou/improvements
oss management is working too if jars are here
2 parents 5ad8da7 + 22ad105 commit b7e32c3

File tree

2 files changed

+30
-20
lines changed

2 files changed

+30
-20
lines changed

src/main/java/org/terracotta/tinypounder/CacheManagerBusinessReflectionImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,16 @@ public void initializeCacheManager(String terracottaServerUrl, String cmName, St
239239
cacheManagerPersistenceConfiguration = null;
240240
}
241241
Object cacheManager;
242+
Object defaultManagementRegistryConfiguration;
243+
try {
244+
defaultManagementRegistryConfiguration = constructDefaultManagementRegistryConfiguration(cmName);
245+
} catch (Exception e) {
246+
defaultManagementRegistryConfiguration = null;
247+
}
242248
if (kitAwareClassLoaderDelegator.isEEKit()) {
243-
Object defaultManagementRegistryConfiguration = constructDefaultManagementRegistryConfiguration(cmName);
244249
cacheManager = constructCacheManagerBuilder(clusteringServiceConfigurationBuilder, cacheManagerPersistenceConfiguration, defaultManagementRegistryConfiguration);
245250
} else {
246-
cacheManager = constructCacheManagerBuilder(clusteringServiceConfigurationBuilder, cacheManagerPersistenceConfiguration, null);
251+
cacheManager = constructCacheManagerBuilder(clusteringServiceConfigurationBuilder, cacheManagerPersistenceConfiguration, defaultManagementRegistryConfiguration);
247252
}
248253
ehCacheManagerClass = loadClass("org.ehcache.core.EhcacheManager");
249254
Method initMethod = ehCacheManagerClass.getMethod("init");

src/main/java/org/terracotta/tinypounder/TinyPounderMainUI.java

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,9 @@ private void addVoltronCommandsControls() {
273273
serverControls = new GridLayout();
274274
serverControls.setWidth(50, Unit.PERCENTAGE);
275275
voltronControlLayout.addComponentsAndExpand(serverControls);
276-
276+
277277
HorizontalLayout row1 = new HorizontalLayout();
278-
278+
279279
Button clusterStartBtn = new Button();
280280
clusterStartBtn.setCaption("Start all servers");
281281
clusterStartBtn.addStyleName("align-bottom");
@@ -325,9 +325,9 @@ private void addVoltronCommandsControls() {
325325

326326
row1.addComponents(clusterNameTF, clusterConfigBtn, clusterReConfigBtn, clusterBackupBtn, clusterDumpBtn, clusterStopBtn);
327327
}
328-
328+
329329
voltronControlLayout.addComponentsAndExpand(row1);
330-
330+
331331
consoles = new TabSheet();
332332
mainConsole = addConsole("Main", "main");
333333
voltronControlLayout.addComponentsAndExpand(consoles);
@@ -558,7 +558,7 @@ private void addVoltronConfigControls() {
558558
displayWarningNotification("Folder deleted with success");
559559
changeTrashButtonStatus(baseLocation.getValue());
560560
} catch (IOException e) {
561-
displayErrorNotification("Could not delete the folder", ExceptionUtils.getRootCauseMessage(e));
561+
displayErrorNotification("Could not delete the folder", e);
562562
}
563563
} else {
564564
displayErrorNotification("Could not delete the folder", "Either folder does not exist or does not have logs/ nor data/ in it");
@@ -1113,7 +1113,7 @@ private void addCacheControls() {
11131113
cacheNameField.clear();
11141114
displayWarningNotification("Cache added with success !");
11151115
} catch (RuntimeException e) {
1116-
displayErrorNotification("Cache could not be added !", ExceptionUtils.getRootCauseMessage(e));
1116+
displayErrorNotification("Cache could not be added !", e);
11171117
}
11181118
});
11191119

@@ -1145,7 +1145,7 @@ private void addCacheControls() {
11451145
refreshCacheStuff(listDataProvider);
11461146
displayWarningNotification("Cache removed with success !");
11471147
} catch (RuntimeException e) {
1148-
displayErrorNotification("Cache could not be removed !", ExceptionUtils.getRootCauseMessage(e));
1148+
displayErrorNotification("Cache could not be removed !", e);
11491149
refreshCacheStuff(listDataProvider);
11501150
}
11511151
});
@@ -1158,7 +1158,7 @@ private void addCacheControls() {
11581158
refreshCacheStuff(listDataProvider);
11591159
displayWarningNotification("Cache destroyed with success !");
11601160
} catch (Exception e) {
1161-
displayErrorNotification("Cache could not be destroyed !", ExceptionUtils.getRootCauseMessage(e));
1161+
displayErrorNotification("Cache could not be destroyed !", e);
11621162
refreshCacheStuff(listDataProvider);
11631163
}
11641164
});
@@ -1189,6 +1189,11 @@ private void displayWarningNotification(String caption) {
11891189
notification.show(Page.getCurrent());
11901190
}
11911191

1192+
private void displayErrorNotification(String caption, Throwable e) {
1193+
e.printStackTrace();
1194+
displayErrorNotification(caption, ExceptionUtils.getRootCauseMessage(e));
1195+
}
1196+
11921197
private void displayErrorNotification(String caption, String message) {
11931198
Notification notification = new Notification(caption,
11941199
message,
@@ -1293,7 +1298,7 @@ private void addCacheManagerControls() {
12931298
cacheManagerConfigTextArea.setValue(cacheManagerBusiness.retrieveHumanReadableConfiguration());
12941299
refreshCacheManagerControls();
12951300
} catch (Exception e) {
1296-
displayErrorNotification("CacheManager could not be initialized!", ExceptionUtils.getRootCauseMessage(e));
1301+
displayErrorNotification("CacheManager could not be initialized!", e);
12971302
}
12981303
});
12991304

@@ -1304,7 +1309,7 @@ private void addCacheManagerControls() {
13041309
refreshCacheControls();
13051310
refreshCacheManagerControls();
13061311
} catch (Exception e) {
1307-
displayErrorNotification("CacheManager could not be closed!", ExceptionUtils.getRootCauseMessage(e));
1312+
displayErrorNotification("CacheManager could not be closed!", e);
13081313
}
13091314
});
13101315
Button destroyCacheManager = new Button("Destroy CacheManager");
@@ -1315,7 +1320,7 @@ private void addCacheManagerControls() {
13151320
refreshCacheManagerControls();
13161321
displayWarningNotification("CacheManager destroyed with success !");
13171322
} catch (Exception e) {
1318-
displayErrorNotification("CacheManager could not be destroyed!", ExceptionUtils.getRootCauseMessage(e));
1323+
displayErrorNotification("CacheManager could not be destroyed!", e);
13191324
}
13201325
});
13211326

@@ -1385,7 +1390,7 @@ private void addKitControls() {
13851390
if (e.getCause() instanceof NoSuchFileException) {
13861391
displayErrorNotification("Kit path could not update !", "Make sure the path points to a kit !");
13871392
} else {
1388-
displayErrorNotification("Kit path could not update !", ExceptionUtils.getRootCauseMessage(e));
1393+
displayErrorNotification("Kit path could not update !", e);
13891394
}
13901395
}
13911396
});
@@ -1428,7 +1433,7 @@ private void addDatasetManagerControls() {
14281433
datasetManagerBusiness.initializeDatasetManager(!clusteredCheckBox.getValue() ? null : terracottaUrlField.getValue());
14291434
refreshDatasetManagerControls();
14301435
} catch (Exception e) {
1431-
displayErrorNotification("DatasetManager could not be initialized!", ExceptionUtils.getRootCauseMessage(e));
1436+
displayErrorNotification("DatasetManager could not be initialized!", e);
14321437
}
14331438
});
14341439

@@ -1439,7 +1444,7 @@ private void addDatasetManagerControls() {
14391444
refreshDatasetControls();
14401445
refreshDatasetManagerControls();
14411446
} catch (Exception e) {
1442-
displayErrorNotification("DatasetManager could not be closed!", ExceptionUtils.getRootCauseMessage(e));
1447+
displayErrorNotification("DatasetManager could not be closed!", e);
14431448
}
14441449
});
14451450

@@ -1519,7 +1524,7 @@ private void addDatasetControls() {
15191524
datasetNameField.clear();
15201525
displayWarningNotification("Dataset added with success !");
15211526
} catch (RuntimeException e) {
1522-
displayErrorNotification("Dataset could not be added !", ExceptionUtils.getRootCauseMessage(e));
1527+
displayErrorNotification("Dataset could not be added !", e);
15231528
}
15241529
});
15251530

@@ -1534,7 +1539,7 @@ private void addDatasetControls() {
15341539
refreshDatasetStuff(listDataProvider);
15351540
displayWarningNotification("Dataset instance " + datasetInstanceName + " created with success !");
15361541
} catch (Exception e) {
1537-
displayErrorNotification("Dataset instance could not be created !", ExceptionUtils.getRootCauseMessage(e));
1542+
displayErrorNotification("Dataset instance could not be created !", e);
15381543
refreshDatasetStuff(listDataProvider);
15391544
}
15401545
});
@@ -1547,7 +1552,7 @@ private void addDatasetControls() {
15471552
refreshDatasetStuff(listDataProvider);
15481553
displayWarningNotification("Dataset destroyed with success !");
15491554
} catch (Exception e) {
1550-
displayErrorNotification("Dataset could not be destroyed !", ExceptionUtils.getRootCauseMessage(e));
1555+
displayErrorNotification("Dataset could not be destroyed !", e);
15511556
refreshDatasetStuff(listDataProvider);
15521557
}
15531558
});
@@ -1570,7 +1575,7 @@ private void addDatasetControls() {
15701575
refreshDatasetStuff(listDataProvider);
15711576
displayWarningNotification("Dataset instance closed with success !");
15721577
} catch (Exception e) {
1573-
displayErrorNotification("Dataset instance could not be closed !", ExceptionUtils.getRootCauseMessage(e));
1578+
displayErrorNotification("Dataset instance could not be closed !", e);
15741579
refreshDatasetStuff(listDataProvider);
15751580
}
15761581
});

0 commit comments

Comments
 (0)