Commit 4cba5690 authored by Matija Obreza's avatar Matija Obreza
Browse files

Display HZ cluster information

parent 1b7ef416
* Copyright 2015 Global Crop Diversity Trust
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* See the License for the specific language governing permissions and
* limitations under the License.
package org.genesys2.server.servlet.controller.admin;
import com.hazelcast.core.HazelcastInstance;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
* Manage caches
* @author mobreza
public class HazelcastController {
public static final Logger LOG = LoggerFactory.getLogger(HazelcastController.class);
private HazelcastInstance hazelcastInstance;
@RequestMapping(value = "/", method = RequestMethod.GET)
public String viewHzSetup(Model model) {
// LOG.debug("Got HZ = {}", hazelcastInstance);
model.addAttribute("hzConfig", hazelcastInstance.getConfig());
model.addAttribute("hzCluster", hazelcastInstance.getCluster());
return "/admin/hazelcast/index";
......@@ -38,7 +38,7 @@ import org.springframework.context.annotation.Import;
@Import({ HazelcastConfigDev.class, HazelcastConfigAWS.class, HazelcastConfigCacher.class })
@Import({ HazelcastConfigAWS.class, HazelcastConfigCacher.class })
public abstract class HazelcastConfig {
/// Interfaces on which HZ should bind
......@@ -20,7 +20,6 @@ import com.hazelcast.config.Config;
import com.hazelcast.config.GroupConfig;
import com.hazelcast.config.JoinConfig;
import com.hazelcast.config.NetworkConfig;
import com.hazelcast.config.TcpIpConfig;
import com.hazelcast.core.Hazelcast;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.ManagedContext;
......@@ -30,7 +29,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
@Profile({ "cacher" })
@Profile({ "cacher", "dev" })
public class HazelcastConfigCacher extends HazelcastConfig {
......@@ -719,6 +719,7 @@ menu.admin.usermanagement=User management
menu.admin.repository.files=Repository file manager
menu.admin.repository.galleries=Image galleries
menu.admin.hazelcast=Hazelcast list
news.archive.title=News Archive
......@@ -108,6 +108,9 @@
<a class="" href="<c:url value="/admin/logger/" />"> <spring:message code="menu.admin.loggers" />
<a class="" href="<c:url value="/admin/hazelcast/" />"> <spring:message code="menu.admin.hazelcast" /></a>
<a class="" href="<c:url value="/admin/ds2/" />"> <spring:message code="menu.admin.ds2" />
<!DOCTYPE html>
<%@ include file="/WEB-INF/jsp/init.jsp"%>
<title><spring:message code="" /></title>
<h1>Hazelcast cluster</h1>
<c:forEach items="${hzCluster.members}" var="member">
<h3>Hazelcast configuration</h3>
<c:out value="${}" />
<h4>Group configuration</h4>
<c:out value="${hzConfig.groupConfig}" />
<h4>Network configuration</h4>
<c:out value="${hzConfig.networkConfig}" />
<c:out value="${hzConfig.mapConfigs}" />
<c:out value="${hzConfig.queueConfigs}" />
<h4>Entire configuration</h4> <c:out value="${hzConfig}" />
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment