glassfish
  1. glassfish
  2. GLASSFISH-12774

Use server.getHost instead of server.getNode in MQAddressList getNodeAgentHostName

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1_ms07
    • Component/s: jms
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      12,774

      Description

      I started moving some code over from using node agent to node.

      I update the MQAddressList and ActiveJmsResourceAdapter.java.

      Index:
      jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/MQAddressList.java
      ===================================================================

      jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/MQAddressList.java
      (revision 38793)
      +++
      jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/MQAddressList.java
      (working copy)
      @@ -136,7 +136,7 @@
      }
      }
      public String getNodeAgentHostName(final Server as) throws Exception{

      • return as.getNodeAgentRef();
        + return as.getNode();
        /*Domain domain = Globals.get(Domain.class);
        NodeAgents nodeAgents = domain.getNodeAgents();
        List nodeAgentsList = nodeAgents.getNodeAgent();
        Index:
        jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java
        ===================================================================

        jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java
        (revision 38793)
        +++
        jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java
        (working copy)
        @@ -1436,7 +1436,7 @@
        for (int i =0; i < serversList.size(); i++) { Server aserver = (Server) serversList.get(i); if (getServerContext().getInstanceName().equals(aserver.getName())) - return (aserver.getNodeAgentRef() == null); + return (aserver.getNode() == null); }

        return false;
        }

      from
      public String getNodeAgentHostName(final Server as) throws Exception{
      return as.getNodeAgentRef();

      to
      public String getNodeAgentHostName(final Server as) throws Exception{
      return as.getNode();
      However, getNode will return the node name which may or may not be the name of
      the machine. I think what you need is node host.
      I added the duck-typed method getHost() on Server config-api, so you can do the
      following. If it sounds right can you make that change?

      public String getNodeAgentHostName(final Server as) throws Exception{
      return as.getHost();

      For ActiveJmsResourceAdapter...

      Instead of relying on getNode...(I guess it will work though)

      private boolean isDAS()
      {
      List serversList = getServers().getServer();
      for (int i =0; i < serversList.size(); i++)

      { Server aserver = (Server) serversList.get(i); if (getServerContext().getInstanceName().equals(aserver.getName())) return (aserver.getNode() == null); }

      return false;
      }

      You may want to make use of...SystemPropertyConstants.DAS_SERVER_NAME. For example,
      private boolean notDas(String name) {
      return !SystemPropertyConstants.DAS_SERVER_NAME.equals(name);

        Activity

        Hide
        Satish Kumar added a comment -

        Setting target milestone ...

        Show
        Satish Kumar added a comment - Setting target milestone ...
        Hide
        Satish Kumar added a comment -

        Verified and ensured that all the changes are made ...

        Show
        Satish Kumar added a comment - Verified and ensured that all the changes are made ...

          People

          • Assignee:
            Satish Kumar
            Reporter:
            Jennifer Chou
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: