本文整理汇总了Java中org.apache.commons.beanutils.PropertyUtilsBean.describe方法的典型用法代码示例。如果您正苦于以下问题:Java PropertyUtilsBean.describe方法的具体用法?Java PropertyUtilsBean.describe怎么用?Java PropertyUtilsBean.describe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.beanutils.PropertyUtilsBean
的用法示例。
在下文中一共展示了PropertyUtilsBean.describe方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: listDatanode
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked" })
private List<Map<String, Object>> listDatanode(AjaxParams params) {
CobarAdapterDAO perfAccesser = cobarAccesser.getAccesser(params.getCobarNodeId());
if (!perfAccesser.checkConnection()) {
return null;
}
PropertyUtilsBean util = new PropertyUtilsBean();
List<DataNodesStatus> list = perfAccesser.listDataNodes();
;
if (null != list) {
ListSortUtil.sortDataNodesByPoolName(list);
}
List<Map<String, Object>> returnList = new ArrayList<Map<String, Object>>();
for (DataNodesStatus c : list) {
Map<String, Object> map = null;
try {
map = util.describe(c);
} catch (Exception e1) {
throw new RuntimeException(e1);
}
map.remove("class");
map.remove("executeCount");
map.put("executeCount", FormatUtil.formatNumber(c.getExecuteCount()));
map.remove("recoveryTime");
if (-1 != c.getRecoveryTime()) {
map.put("recoveryTime", FormatUtil.formatTime(c.getRecoveryTime() * 1000, 2));
} else {
map.put("recoveryTime", c.getRecoveryTime());
}
returnList.add(map);
}
return returnList;
}
示例2: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
throws Exception {
UserDO user = (UserDO) request.getSession().getAttribute("user");
List<ClusterDO> list = xmlAccesser.getClusterDAO().listAllCluster();
List<Map<String, Object>> clusterList = new ArrayList<Map<String, Object>>();
ListSortUtil.sortClusterBySortId(list);
PropertyUtilsBean util = new PropertyUtilsBean();
for (ClusterDO e : list) {
int count = xmlAccesser.getCobarDAO().getCobarList(e.getId(), ConstantDefine.ACTIVE).size();
count += xmlAccesser.getCobarDAO().getCobarList(e.getId(), ConstantDefine.IN_ACTIVE).size();
Map<String, Object> map;
try {
map = util.describe(e);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
map.remove("class");
map.remove("name");
map.remove("deployDesc");
map.put("name", CobarStringUtil.htmlEscapedString(e.getName()));
map.put("deployContact", CobarStringUtil.htmlEscapedString(e.getDeployContact()));
map.put("cobarNum", count);
clusterList.add(map);
}
return new ModelAndView("m_clusterList", new FluenceHashMap<String, Object>().putKeyValue("clusterList",
clusterList).putKeyValue("user", user));
}
示例3: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked" })
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
throws Exception {
UserDO user = (UserDO) request.getSession().getAttribute("user");
long clusterId = Long.parseLong(request.getParameter("clusterId"));
ClusterDO cluster = xmlAccesser.getClusterDAO().getClusterById(clusterId);
List<CobarDO> cobarList = xmlAccesser.getCobarDAO().getCobarList(clusterId);
List<Map<String, Object>> cobarViewList = null;
if (null != cobarList) {
ListSortUtil.sortCobarByName(cobarList);
cobarViewList = new ArrayList<Map<String, Object>>();
PropertyUtilsBean util = new PropertyUtilsBean();
for (CobarDO c : cobarList) {
Map<String, Object> map = util.describe(c);
map.remove("class");
map.remove("name");
map.put("name", CobarStringUtil.htmlEscapedString(c.getName()));
cobarViewList.add(map);
}
}
Map<String, Object> clusterView = new HashMap<String, Object>();
clusterView.put("id", cluster.getId());
clusterView.put("name", CobarStringUtil.htmlEscapedString(cluster.getName()));
return new ModelAndView("m_cobarList", new FluenceHashMap<String, Object>().putKeyValue("cobarList",
cobarViewList)
.putKeyValue("user", user)
.putKeyValue("cluster", clusterView));
}
示例4: listDatanode
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked" })
private List<Map<String, Object>> listDatanode(AjaxParams params) {
CobarAdapterDAO perfAccesser = cobarAccesser.getAccesser(params.getCobarNodeId());
if (!perfAccesser.checkConnection()) {
return null;
}
PropertyUtilsBean util = new PropertyUtilsBean();
List<DataNodesStatus> list = perfAccesser.listDataNodes();;
if (null != list) {
ListSortUtil.sortDataNodesByPoolName(list);
}
List<Map<String, Object>> returnList = new ArrayList<Map<String, Object>>();
for (DataNodesStatus c : list) {
Map<String, Object> map = null;
try {
map = util.describe(c);
} catch (Exception e1) {
throw new RuntimeException(e1);
}
map.remove("class");
map.remove("executeCount");
map.put("executeCount", FormatUtil.formatNumber(c.getExecuteCount()));
map.remove("recoveryTime");
if (-1 != c.getRecoveryTime()) {
map.put("recoveryTime", FormatUtil.formatTime(c.getRecoveryTime() * 1000, 2));
} else {
map.put("recoveryTime", c.getRecoveryTime());
}
returnList.add(map);
}
return returnList;
}
示例5: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
throws Exception {
UserDO user = (UserDO) request.getSession().getAttribute("user");
List<ClusterDO> list = xmlAccesser.getClusterDAO().listAllCluster();
List<Map<String, Object>> clusterList = new ArrayList<Map<String, Object>>();
ListSortUtil.sortClusterBySortId(list);
PropertyUtilsBean util = new PropertyUtilsBean();
for (ClusterDO e : list) {
int count = xmlAccesser.getCobarDAO().getCobarList(e.getId(), ConstantDefine.ACTIVE).size();
count += xmlAccesser.getCobarDAO().getCobarList(e.getId(), ConstantDefine.IN_ACTIVE).size();
Map<String, Object> map;
try {
map = util.describe(e);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
map.remove("class");
map.remove("name");
map.remove("deployDesc");
map.put("name", CobarStringUtil.htmlEscapedString(e.getName()));
map.put("deployContact", CobarStringUtil.htmlEscapedString(e.getDeployContact()));
map.put("cobarNum", count);
clusterList.add(map);
}
return new ModelAndView("m_clusterList", new FluenceHashMap<String, Object>().putKeyValue("clusterList",
clusterList)
.putKeyValue("user", user));
}
示例6: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked" })
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
throws Exception {
UserDO user = (UserDO) request.getSession().getAttribute("user");
long clusterId = Long.parseLong(request.getParameter("clusterId"));
ClusterDO cluster = xmlAccesser.getClusterDAO().getClusterById(clusterId);
List<CobarDO> cobarList = xmlAccesser.getCobarDAO().getCobarList(clusterId);
List<Map<String, Object>> cobarViewList = null;
if (null != cobarList) {
ListSortUtil.sortCobarByName(cobarList);
cobarViewList = new ArrayList<Map<String, Object>>();
PropertyUtilsBean util = new PropertyUtilsBean();
for (CobarDO c : cobarList) {
Map<String, Object> map = util.describe(c);
map.remove("class");
map.remove("name");
map.put("name", CobarStringUtil.htmlEscapedString(c.getName()));
cobarViewList.add(map);
}
}
Map<String, Object> clusterView = new HashMap<String, Object>();
clusterView.put("id", cluster.getId());
clusterView.put("name", CobarStringUtil.htmlEscapedString(cluster.getName()));
return new ModelAndView("m_cobarList", new FluenceHashMap<String, Object>().putKeyValue("cobarList",
cobarViewList)
.putKeyValue("user", user)
.putKeyValue("cluster", clusterView));
}
示例7: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) {
UserDO user = (UserDO) request.getSession().getAttribute("user");
long nodeId = 0;
try {
nodeId = Long.parseLong(request.getParameter("nodeId").trim());
} catch (Exception e) {
throw new IllegalArgumentException("parameter 'nodeId' is invalid: " + request.getParameter("nodeId"));
}
CobarDO cobar = xmlAccesser.getCobarDAO().getCobarById(nodeId);
if (null == cobar) {
throw new IllegalArgumentException("no cobar exsit for id : " + nodeId);
}
PropertyUtilsBean util = new PropertyUtilsBean();
Map<String, Object> cobarMap = null;
try {
cobarMap = util.describe(cobar);
} catch (Exception e1) {
throw new RuntimeException(e1);
}
cobarMap.remove("class");
cobarMap.remove("name");
cobarMap.put("name", CobarStringUtil.htmlEscapedString(cobar.getName()));
ClusterDO cluster = xmlAccesser.getClusterDAO().getClusterById(cobar.getClusterId());
Map<String, Object> clusterMap = new HashMap<String, Object>();
clusterMap.put("id", cluster.getId());
clusterMap.put("name", CobarStringUtil.htmlEscapedString(cluster.getName()));
return new ModelAndView(
"v_cobarDetail",
new FluenceHashMap<String, Object>().putKeyValue("user", user)
.putKeyValue("cluster", clusterMap)
.putKeyValue("cobarNode", cobarMap));
}
示例8: handleRequest
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
AjaxParams params = new AjaxParams(request);
String jsonRst = null;
String st = params.getValueType();
if (null == st || st.equals("")) {
throw new IllegalArgumentException("parameter 'cobarControlValueType' is unknown: " + st);
}
int type = valueTypeMap.get(st);
PropertyUtilsBean util = new PropertyUtilsBean();
switch (type) {
case TYPE_COBAR_MEMORY_USAGE:
List<Pair<Long, Integer>> mList = listCobarMemoryUsage(params);
jsonRst = JSON.toJSONString(mList);
break;
case TYPE_CLUSTER_THROUGHPUT_INFO:
List<Map<String, Object>> list1 = getClusterThroughput(params);
jsonRst = JSON.toJSONString(list1);
break;
case TYPE_CLUSTER_INFO:
AjaxResult rs = getClusterInfo(params);
Map<String, Object> map = null;
try {
map = util.describe(rs);
} catch (Exception e) {
logger.error(e);
throw new RuntimeException(e);
}
jsonRst = JSON.toJSONString(map);
break;
case TYPE_STATUS:
List<Pair<Long, String>> sList = getStatus(params);
jsonRst = JSON.toJSONString(sList);
break;
default:
throw new IllegalArgumentException("parameter 'ValueType' is known: " + params.getValueType());
}
response.setHeader("Content-Type", "text/json; charset=utf-8");
OutputStream out = response.getOutputStream();
out.write(jsonRst.getBytes("utf-8"));
out.flush();
}
示例9: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
throws Exception {
UserDO user = (UserDO) request.getSession().getAttribute("user");
long vipId = Long.parseLong(request.getParameter("vipIdK"));
VipDO vip = xmlAccesser.getVipMapDAO().getVipById(vipId);
PropertyUtilsBean util = new PropertyUtilsBean();
Set<Long> set = new HashSet<Long>();
long cobarIds[] = vip.getCobarIds();
for (int i = 0; i < cobarIds.length; i++) {
set.add(cobarIds[i]);
}
List<CobarDO> cList = xmlAccesser.getCobarDAO().listAllCobar();
List<Map<String, Object>> cobarList = new ArrayList<Map<String, Object>>();
for (CobarDO c : cList) {
Map<String, Object> map;
try {
map = util.describe(c);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
map.remove("class");
map.remove("buId");
map.remove("user");
map.remove("password");
map.remove("time_diff");
map.remove("name");
if (set.contains(c.getId())) {
map.put("choose", true);
} else {
map.put("choose", false);
}
map.put("name", CobarStringUtil.htmlEscapedString(c.getName()));
String clusterName = xmlAccesser.getClusterDAO().getClusterById(c.getClusterId()).getName();
map.put("clusterName", CobarStringUtil.htmlEscapedString(clusterName));
cobarList.add(map);
}
return new ModelAndView("m_vipCobarList", new FluenceHashMap<String, Object>().putKeyValue("user", user)
.putKeyValue("vip", vip)
.putKeyValue("cobarList", cobarList));
}
示例10: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked" })
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
throws Exception {
UserDO user = (UserDO) request.getSession().getAttribute("user");
long clusterId = Long.parseLong(request.getParameter("clusterId"));
ClusterDO cluster = xmlAccesser.getClusterDAO().getClusterById(clusterId);
List<CobarDO> cobarList = xmlAccesser.getCobarDAO().getCobarList(clusterId);
ListSortUtil.sortCobarByName(cobarList);
// int aCount =
// xmlAccesser.getCobarDAO().getCobarCountByStatus(clusterId,
// ConstantDefine.ACTIVE);
// int iCount =
// xmlAccesser.getCobarDAO().getCobarCountByStatus(clusterId,
// ConstantDefine.IN_ACTIVE);
int aCount = xmlAccesser.getCobarDAO().getCobarList(clusterId, ConstantDefine.ACTIVE).size();
int iCount = xmlAccesser.getCobarDAO().getCobarList(clusterId, ConstantDefine.IN_ACTIVE).size();
Map<String, Integer> count = new HashMap<String, Integer>();
count.put("aCount", aCount);
count.put("iCount", iCount);
count.put("tCount", (aCount + iCount));
PropertyUtilsBean util = new PropertyUtilsBean();
Map<String, Object> clusterMap;
try {
clusterMap = util.describe(cluster);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
clusterMap.remove("class");
clusterMap.remove("name");
clusterMap.remove("deployDesc");
clusterMap.put("name", CobarStringUtil.htmlEscapedString(cluster.getName()));
clusterMap.put("deployDesc", CobarStringUtil.htmlEscapedString(cluster.getDeployDesc()));
List<Map<String, Object>> cobarListMap = new ArrayList<Map<String, Object>>();
for (CobarDO c : cobarList) {
Map<String, Object> cobarMap;
try {
cobarMap = util.describe(c);
} catch (Exception e) {
throw new RuntimeException(e);
}
cobarMap.remove("class");
cobarMap.remove("name");
cobarMap.put("name", CobarStringUtil.htmlEscapedString(c.getName()));
/*
* if (c.getStatus().equals(ConstantDefine.ACTIVE)) {
* CobarAdapterDAO perf = cobarAccesser.getAccesser(c); if
* (!perf.checkConnection()) { cobarMap.remove("status");
* cobarMap.put("status", ConstantDefine.ERROR); } }
*/
cobarListMap.add(cobarMap);
}
return new ModelAndView("v_cobarList", new FluenceHashMap<String, Object>().putKeyValue("cluster", clusterMap)
.putKeyValue("cobarList", cobarListMap)
.putKeyValue("count", count)
.putKeyValue("user", user));
}
示例11: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) {
UserDO user = (UserDO) request.getSession().getAttribute("user");
long nodeId = 0;
try {
nodeId = Long.parseLong(request.getParameter("nodeId").trim());
} catch (Exception e) {
throw new IllegalArgumentException("parameter 'nodeId' is invalid: " + request.getParameter("nodeId"));
}
CobarDO cobar = xmlAccesser.getCobarDAO().getCobarById(nodeId);
if (null == cobar) {
throw new IllegalArgumentException("no cobar exsit for id : " + nodeId);
}
PropertyUtilsBean util = new PropertyUtilsBean();
Map<String, Object> cobarMap = null;
try {
cobarMap = util.describe(cobar);
} catch (Exception e1) {
throw new RuntimeException(e1);
}
cobarMap.remove("class");
cobarMap.remove("name");
cobarMap.put("name", CobarStringUtil.htmlEscapedString(cobar.getName()));
ClusterDO cluster = xmlAccesser.getClusterDAO().getClusterById(cobar.getClusterId());
Map<String, Object> clusterMap = new HashMap<String, Object>();
clusterMap.put("id", cluster.getId());
clusterMap.put("name", CobarStringUtil.htmlEscapedString(cluster.getName()));
/*
* CobarAdapterDAO perfAccesser = cobarAccesser.getAccesser(nodeId);
* String startTime = null; String version = "UNKNOWN"; String status =
* "RUNNING"; if (perfAccesser.checkConnection()) { status =
* perfAccesser.getServerStatus().getStatus(); startTime =
* perfAccesser.getStartUpTime().getFormatTime(); version =
* FormatUtil.formatVersion(perfAccesser.getVersion()); } else { status
* = "ERROR"; }
*/
return new ModelAndView("v_cobarDetail", new FluenceHashMap<String, Object>().putKeyValue("user", user)
.putKeyValue("cluster", clusterMap)
.putKeyValue("cobarNode", cobarMap));
}
示例12: handleRequest
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void handleRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException,
IOException {
AjaxParams params = new AjaxParams(request);
String jsonRst = null;
String st = params.getValueType();
if (null == st || st.equals("")) {
throw new IllegalArgumentException("parameter 'cobarControlValueType' is unknown: " + st);
}
int type = valueTypeMap.get(st);
PropertyUtilsBean util = new PropertyUtilsBean();
switch (type) {
case TYPE_COBAR_MEMORY_USAGE:
List<Pair<Long, Integer>> mList = listCobarMemoryUsage(params);
JSONArray mArray = JSONArray.fromObject(mList);
jsonRst = mArray.toString(2);
break;
case TYPE_CLUSTER_THROUGHPUT_INFO:
List<Map<String, Object>> list1 = getClusterThroughput(params);
JSONArray arrayMap = JSONArray.fromObject(list1);
jsonRst = arrayMap.toString(2);
break;
case TYPE_CLUSTER_INFO:
AjaxResult rs = getClusterInfo(params);
Map<String, Object> map = null;
try {
map = util.describe(rs);
} catch (Exception e) {
logger.error(e);
throw new RuntimeException(e);
}
jsonRst = JSONObject.fromObject(map).toString(2);
break;
case TYPE_STATUS:
List<Pair<Long, String>> sList = getStatus(params);
JSONArray sArray = JSONArray.fromObject(sList);
jsonRst = sArray.toString(2);
break;
default:
throw new IllegalArgumentException("parameter 'ValueType' is known: " + params.getValueType());
}
response.setHeader("Content-Type", "text/json; charset=utf-8");
OutputStream out = response.getOutputStream();
out.write(jsonRst.getBytes("utf-8"));
out.flush();
}
示例13: handleRequestInternal
import org.apache.commons.beanutils.PropertyUtilsBean; //导入方法依赖的package包/类
@SuppressWarnings({ "unchecked" })
@Override
protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
throws Exception {
UserDO user = (UserDO) request.getSession().getAttribute("user");
long clusterId = Long.parseLong(request.getParameter("clusterId"));
ClusterDO cluster = xmlAccesser.getClusterDAO().getClusterById(clusterId);
List<CobarDO> cobarList = xmlAccesser.getCobarDAO().getCobarList(clusterId);
ListSortUtil.sortCobarByName(cobarList);
int aCount = xmlAccesser.getCobarDAO().getCobarList(clusterId, ConstantDefine.ACTIVE).size();
int iCount = xmlAccesser.getCobarDAO().getCobarList(clusterId, ConstantDefine.IN_ACTIVE).size();
Map<String, Integer> count = new HashMap<String, Integer>();
count.put("aCount", aCount);
count.put("iCount", iCount);
count.put("tCount", (aCount + iCount));
PropertyUtilsBean util = new PropertyUtilsBean();
Map<String, Object> clusterMap;
try {
clusterMap = util.describe(cluster);
} catch (Exception ex) {
throw new RuntimeException(ex);
}
clusterMap.remove("class");
clusterMap.remove("name");
clusterMap.remove("deployDesc");
clusterMap.put("name", CobarStringUtil.htmlEscapedString(cluster.getName()));
clusterMap.put("deployDesc", CobarStringUtil.htmlEscapedString(cluster.getDeployDesc()));
List<Map<String, Object>> cobarListMap = new ArrayList<Map<String, Object>>();
for (CobarDO c : cobarList) {
Map<String, Object> cobarMap;
try {
cobarMap = util.describe(c);
} catch (Exception e) {
throw new RuntimeException(e);
}
cobarMap.remove("class");
cobarMap.remove("name");
cobarMap.put("name", CobarStringUtil.htmlEscapedString(c.getName()));
cobarListMap.add(cobarMap);
}
return new ModelAndView("v_cobarList", new FluenceHashMap<String, Object>().putKeyValue("cluster", clusterMap)
.putKeyValue("cobarList",
cobarListMap)
.putKeyValue("count", count)
.putKeyValue("user", user));
}