Examples of ServerConnection


Examples of org.jmanage.core.management.ServerConnection

     * @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

Examples of org.jmanage.core.management.ServerConnection

    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

Examples of org.jmanage.core.management.ServerConnection

        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

Examples of org.jmanage.core.management.ServerConnection

    /**
     *
     * @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

Examples of org.jmanage.core.management.ServerConnection

                    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

Examples of org.jmanage.core.management.ServerConnection

                                            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

Examples of org.openbp.guiclient.remote.ServerConnection

    // Add these plugins first, they will create menu items for the global menu
    pm.createInstance(ErrorDialogPlugin.class, this);

    // Try to connect to the server
    // By default, use an anonymous login
    ServerConnection connection = ServerConnection.getInstance();
    connection.setLoginInfo(new ClientLoginInfo("Anonymous", null));
    try
    {
      connection.connect(true);
    }
    catch (OpenBPException e)
    {
      // Show dialog box if the user has not chose to skip it before
      if (! SettingUtil.getBooleanSetting("openbp.cockpit.connectionwarning.hide", false))
      {
        // Hide splash screen.
        if (splashScreen != null)
        {
          splashScreen.setVisible(false);
        }

        int response = JMsgBox.show(null, getPluginResourceCollection().getRequiredString(
          "connectionerror.title"), ResourceCollectionUtil.formatMsg(getPluginResourceCollection(),
          "connectionerror.description", new Object[]
          {
            connection.getConnectionInfo().getRmiServerHost(),
            new Integer(connection.getConnectionInfo().getRmiServerPort()), e.getMessage()
          }), JMsgBox.ICON_INFO | JMsgBox.TYPE_OK | JMsgBox.DEFAULT_OK | JMsgBox.TYPE_DO_NOT_SHOW_AGAIN);

        if ((response & JMsgBox.TYPE_DO_NOT_SHOW_AGAIN) != 0)
        {
          // Skip this dialog the next time
View Full Code Here

Examples of org.openbravo.utils.ServerConnection

  @Override
  public void execute() throws BuildException {
    final File f = new File("src-diagnostics/build.xml");
    final String fileName = f.getAbsolutePath();
    log4j.info("Checking tomcat's user file permissions...");
    final String result = new ServerConnection().getCheck("ant", "&file=" + fileName
        + "&task=check.permissions");
    if (result.equals("OK"))
      log4j.info("Tomcat's user permissions. OK");
    else
      throw new BuildException("Tomcat's user do not have read/write permissions in all files");
View Full Code Here

Examples of org.openrdf.http.server.helpers.ServerConnection

    // Currently, we don't use method annotations in Sesame
    setAnnotated(false);
  }

  protected CacheInfo getCacheInfo() {
    ServerConnection connection = getConnection();
    if (connection != null) {
      return connection.getCacheInfo();
    }

    ServerRepository repository = getRepository();
    if (repository != null) {
      return repository.getCacheInfo();
View Full Code Here

Examples of org.openrdf.http.server.helpers.ServerConnection

  @Override
  protected int beforeHandle(Request request, Response response) {
    ServerRepository repository = RequestAtt.getRepository(request);

    try {
      ServerConnection connection = repository.getConnection();
      connection.addRequest(request);
      RequestAtt.setConnection(request, connection);
      return Filter.CONTINUE;
    }
    catch (StoreException e) {
      logger.error("Failed to open a connection on the repository", e);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.