Package org.jmanage.core.management

Examples of org.jmanage.core.management.ServerConnection


                                 HttpServletResponse response)
            throws Exception {

        AttributeSelectionForm form = (AttributeSelectionForm)actionForm;
        String[] mbeans = form.getMbeans();
        ServerConnection serverConn = context.getServerConnection();
        ObjectName objectName = null;
        Map<String, List> mbeanAttributesListMap = new TreeMap<String, List>();
        MBeanService mbeanService = ServiceFactory.getMBeanService();
        for(int i=0; i<mbeans.length;i++){
            objectName = new ObjectName(mbeans[i]);
            ObjectInfo objInfo = serverConn.getObjectInfo(objectName);
            ObjectAttributeInfo[] objAttrInfo = objInfo.getAttributes();
            List objAttrInfoList = mbeanService.filterAttributes(
                    Utils.getServiceContext(context),
                    objectName,
                    objAttrInfo,
View Full Code Here


     * @param applicationConfig
     * @return boolean value indicating the qualifying status.
     */
    public boolean isQualified(ApplicationConfig applicationConfig) {

        ServerConnection serverConnection = null;
        try {
            serverConnection =
                    ServerConnector.getServerConnection(applicationConfig);
            String value = (String)serverConnection.getAttribute(objectName,
                    attributeName);
            return value.startsWith("1.5");
        } catch (ConnectionFailedException e){
            logger.log(Level.FINE, new StringBuilder().append(
                    "Error retrieving attributes for:").append(
View Full Code Here

    private String displayNames;
    private String objectNameFilter;

    protected void drawInternal(DashboardContext context, StringBuffer output) {
  output.append("<table class=\"plaintext\" cellspacing=\"5\" style=\"border:1;border-style:solid;border-width:1px;border-color:#C0C0C0\">");
  ServerConnection connection = context.getWebContext().getServerConnection();
  Set<ObjectName> objects = connection.queryNames(objectName);
  StringTokenizer stAttributes = new StringTokenizer(attributes, "|");
  StringTokenizer stDispNames = new StringTokenizer(displayNames, "|");
  assert stAttributes.countTokens() == stDispNames.countTokens() : "Invalid component configuration";
  String[] attribs = new String[stAttributes.countTokens()];
  output.append("<tr>");
  for(int ctr=0; stAttributes.hasMoreTokens(); ctr++){
      attribs[ctr] = stAttributes.nextToken();
      output.append("<td><b>").append(stDispNames.nextToken()).append("</b></td>");
  }
  output.append("</tr>");
  String objectNamePattern = null;
  if(objectNameFilter != null){
    objectNamePattern = objectName.getDisplayName();
    objectNamePattern = objectNamePattern.endsWith("*") ?
      objectNamePattern.substring(0, objectNamePattern.length()-1) : objectNamePattern;
    objectNamePattern += objectNameFilter.endsWith("*") ?
      objectNameFilter.substring(0, objectNameFilter.length() -1) : objectNameFilter;
      }
  for(ObjectName anObjectName : objects){
      if(objectNamePattern != null && !anObjectName.getDisplayName().startsWith(objectNamePattern))
    continue;
      output.append("<tr>");
      List attributeValues = connection.getAttributes(anObjectName, attribs);
      for(Iterator it = attributeValues.iterator(); it.hasNext();){
    ObjectAttribute objAttribute = (ObjectAttribute)it.next();
    output.append("<td>").append(objAttribute.getDisplayValue()).append("</td>");             
      }
      output.append("</tr>");
View Full Code Here

        output.append(select.draw());
    }
   
    private Map<String, String> getData(WebContext webContext){
        Map<String, String> data = new HashMap<String, String>();
        ServerConnection serverConnection = webContext.getServerConnection();
        Object value = serverConnection.getAttribute(new ObjectName(mbean), attribute);
        if(value.getClass().isArray()){
            for(int i=0; i<Array.getLength(value); i++){
                Object id = Array.get(value, i);
                data.put(id.toString(), resolveId(serverConnection, id))
            }
View Full Code Here

    /**
     *
     * @param context
     */
    protected void drawInternal(DashboardContext context, StringBuffer output) {
        ServerConnection connection = context.getWebContext().getServerConnection();
        ObjectAttribute attributeValue =
                (ObjectAttribute)connection.getAttributes(objectName, new String[]{attribute}).get(0);

        String data= displayName != null && !displayName.equals("") ?
                "<b>" +displayName+" : </b>"+ attributeValue.getDisplayValue() :
                attributeValue.getDisplayValue();
        output.append(data);
View Full Code Here

                    new ApplicationUpEvent(appConfig));
        }
    }
   
    private boolean isOpen(){
        ServerConnection connection = null;
        try {
            connection = ServerConnector.getServerConnection(appConfig);
            return connection.isOpen();
        }catch(Exception e){
            logger.info("Application is down: " + appConfig.getName());
            return false;
        } finally {
            try {
                if (connection != null)
                    connection.close();
            } catch (IOException e) {
                logger.warning(e.getMessage());
            }
        }
    }
View Full Code Here

                                            null,
                                            null,
                                            null,
                                            null,
                                            null);
        ServerConnection connection = ServerConnector.getServerConnection(appConfig);
        Set<ObjectName> objectNames = connection.queryNames(new ObjectName("*:*"));
        //Set<ObjectName> sortedObjectNames = new TreeSet<ObjectName>();
        //sortedObjectNames.addAll(objectNames);
        Document document = getDocument(connection, objectNames);
        /* write to the disc */
        XMLOutputter writer = new XMLOutputter();
        writer.output(document, new FileWriter("c:\\PlatformMBeans2.xml"));
        connection.close();
    }
View Full Code Here

TOP

Related Classes of org.jmanage.core.management.ServerConnection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.