User: ejort   
  Date: 02/03/23 13:10:59

  Modified:    src/main/org/jbossmx/cluster/watchdog/agent BaseAgent.java
  Log:
  JBoss/JBossMX integration. Also includes a fix to the cluster tests and a more 
complete ejblink test that currently fails
  
  Revision  Changes    Path
  1.6       +35 -2     
jbossmx/src/main/org/jbossmx/cluster/watchdog/agent/BaseAgent.java
  
  Index: BaseAgent.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbossmx/src/main/org/jbossmx/cluster/watchdog/agent/BaseAgent.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- BaseAgent.java    8 Oct 2001 16:52:59 -0000       1.5
  +++ BaseAgent.java    23 Mar 2002 21:10:59 -0000      1.6
  @@ -372,8 +372,7 @@
       {
           try
           {
  -            return (String) m_server.invoke(m_rmiConnectorObjectName, "getJNDIName",
  -                                            m_sEmptyObject, m_sEmptyString);
  +            return (String) m_server.getAttribute(m_rmiConnectorObjectName, 
"JNDIName");
           }
           catch(Exception e)
           {
  @@ -428,6 +427,40 @@
           {
               //LOG.warning(infe);
   
  +            throw new RemoteException("", infe);
  +        }
  +    }
  +
  +    /**
  +     * Get an attribute from an MBean.
  +     *
  +     * @param    objectName The object name of the MBean.
  +     * @param    attrName The name of the attribute.
  +     *
  +     * @return The object returned by the operation, which represents the value of 
the attribute.
  +     * @throws RemoteException
  +     */
  +    public Object getMBeanAttribute(String objectName, String attrName)
  +            throws RemoteException
  +    {
  +        try
  +        {
  +            return m_server.getAttribute(new ObjectName(objectName), attrName)
  +        }
  +        catch(MalformedObjectNameException mone)
  +        {
  +            throw new RemoteException("", mone);
  +        }
  +        catch(ReflectionException re)
  +        {
  +            throw new RemoteException("", re);
  +        }
  +        catch(MBeanException me)
  +        {
  +            throw new RemoteException("", me);
  +        }
  +        catch(InstanceNotFoundException infe)
  +        {
               throw new RemoteException("", infe);
           }
       }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to