geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service GeronimoMBeanContext.java
Date Sat, 08 Nov 2003 22:21:45 GMT
dain        2003/11/08 14:21:45

  Modified:    modules/kernel/src/java/org/apache/geronimo/kernel/service
                        GeronimoMBeanContext.java
  Log:
  Added getTarget so targets can communicate with each other directly
  
  Revision  Changes    Path
  1.3       +23 -2     incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service/GeronimoMBeanContext.java
  
  Index: GeronimoMBeanContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/kernel/src/java/org/apache/geronimo/kernel/service/GeronimoMBeanContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GeronimoMBeanContext.java	6 Nov 2003 19:56:00 -0000	1.2
  +++ GeronimoMBeanContext.java	8 Nov 2003 22:21:45 -0000	1.3
  @@ -161,11 +161,32 @@
       }
   
       /**
  -     * Sends the specified notification .
  +     * Sends the specified notification.
        * The norification must be declared in the a GeronimoNotificationInfo.
        * @param notification the notification to send
        */
       public void sendNotification(Notification notification) {
           geronimoMBean.sendNotification(notification);
  +    }
  +
  +    /**
  +     * Gets the default target object from the GeronimoMBean.  This allows
  +     * targets within the same MBean to communicate with each other.
  +     * @return the default target or null if there is no default target
  +     */
  +    public Object getTarget() {
  +        GeronimoMBeanInfo mbeanInfo = (GeronimoMBeanInfo) geronimoMBean.getMBeanInfo();
  +        return mbeanInfo.targets.get(GeronimoMBeanInfo.DEFAULT_TARGET_NAME);
  +    }
  +
  +    /**
  +     * Gets the named target object from the GeronimoMBean.  This allows
  +     * targets within the same MBean to communicate with each other.
  +     * @param name name of the target to get
  +     * @return the named target or null if there is no default target
  +     */
  +    public Object getTarget(String name) {
  +        GeronimoMBeanInfo mbeanInfo = (GeronimoMBeanInfo) geronimoMBean.getMBeanInfo();
  +        return mbeanInfo.targets.get(name);
       }
   }
  
  
  

Mime
View raw message