|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjavax.management.NotificationBroadcasterSupport
public class NotificationBroadcasterSupport
NotificationEmitter
ÀÎÅÍÆäÀ̽ºÀÇ ±¸ÇöÀ» Á¦°øÇÕ´Ï´Ù. À̰ÍÀº ÅëÁö¸¦ ¼Û½ÅÇÏ´Â MBean
½´ÆÛ Ŭ·¡½º·Î¼ »ç¿ë °¡´ÉÇÕ´Ï´Ù.
ÅëÁö µð½ºÆÐÄ¡¸ðµ¨ÀÌ µ¿±â ¸ðµ¨ÀÏ±î ºñµ¿±â ¸ðµ¨Àϱî´Â ÁöÁ¤µÇÁö ¾Ê½À´Ï´Ù. thread°¡ sendNotification
¸¦
È£ÃâÇßÀ» ¶§, °¢ ¸®½º³ÊÀÇ NotificationListener.handleNotification
¸Þ¼µå°¡ ±× thread³»¿¡¼ ºÒ·Á°¡
¸é µ¿±â ¸ðµ¨, ´Ù¸¥ thread³»¿¡¼ ºÒ·Á°¡
¸é ºñµ¿±â ¸ðµ¨À̶ó´Â °ÍÀÌ µË´Ï´Ù.
¾îÇø®ÄÉÀ̼ÇÀº ÅëÁö µð½ºÆÐ°ªÀÌ µ¿±â ¶Ç´Â ºñµ¿±âÀϱ Á¸ÇØ µÇÁö ¾Ê½À´Ï´Ù.
sendNotification
¸Þ¼µåÀÇ Á¾·á½Ã±îÁö, ¸ðµç ¸®½º³ÊÀÇ handleNotification
¸Þ¼µå°¡ È£ÃâµÇ´Â °ÍÀº ¾Æ´Ï´Ù. ¶Ç, ¸®½º³Ê´Â ÅëÁö°¡ »ý¼ºµÈ ¼ø¼¿¡ ¼ö½ÅÇÑ´Ù°í´Â ÇÒ ¼ö ¾ø´Ù. Â÷·Ê·Î
ÀÇÁ¸µÈ ¸®½º³Ê´Â ÅëÁö ¼ø¼ ¹øÈ£¸¦ »ç¿ëÇØ, ¼ö½ÅÇÑ ÅëÁöÀÇ ÁÙ ¼ø¼¸¦ È®ÀÎÇÏ´Â (Notification.getSequenceNumber()
¸¦
ÂüÁ¶)
sendNotification
È£ÃâÇØ ¿ø·¡·ÎÀÇ ÀÀ´äÀÇ Áö¿¬À» ȸÇÇÇϱâ À§ÇØ, ´Ù¸¥ thread·Î ¾×¼ÇÀ» ½ÇÇàÇÑ´Ù
»ý¼ºÀÚ °³¿ä | |
---|---|
NotificationBroadcasterSupport ()
|
¸Þ¼µå °³¿ä | |
---|---|
void |
addNotificationListener (NotificationListener listener,
NotificationFilter filter,
Object handback)
¸®½º³Ê¸¦ Ãß°¡ÇÕ´Ï´Ù. |
MBeanNotificationInfo [] |
getNotificationInfo ()
ÀÌ MBean°¡ ÅëÁö¸¦ ¼Û½ÅÇÒ ¶§¸¶´Ù, ±× ÅëÁöÀÇ Java Ŭ·¡½º¸í°ú ÅëÁöÇüÀ» ³ªÅ¸³»´Â ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
protected void |
handleNotification (NotificationListener listener,
Notification notif,
Object handback)
ÀÌ ¸Þ¼µå´Â ¸®½º³Ê¿¡°Ô ÅëÁö¸¦ ¼Û½ÅÇϱâ À§ÇØ, sendNotification ¿¡ ÀÇÇØ È£ÃâÇÕ´Ï´Ù. |
void |
removeNotificationListener (NotificationListener listener)
ÀÌ MBean ·ÎºÎÅÍ ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
removeNotificationListener (NotificationListener listener,
NotificationFilter filter,
Object handback)
ÀÌ MBean ·ÎºÎÅÍ ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù. |
void |
sendNotification (Notification notification)
ÅëÁö¸¦ ¼Û½ÅÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
»ý¼ºÀÚ »ó¼¼ |
---|
public NotificationBroadcasterSupport()
¸Þ¼µåÀÇ »ó¼¼ |
---|
public void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
NotificationBroadcaster
³»ÀÇ addNotificationListener
listener
- ÅëÁö¸¦ ¹Þ´Â ¸®½º³Êfilter
- ÇÊÅÍ °´Ã¼. ÇÊÅͰ¡ nullÀÎ °æ¿ì, ÅëÁö ó¸®Àü¿¡ ÇÊÅÍ´Â Àû¿ëµÇÁö ¾Ê´Âhandback
- ÅëÁöÀÇ ¹ßÇà½Ã¿¡ ¸®½º³Ê¿¡°Ô ¼Û½ÅµÇ´Â ºÒÅõ¸íÇÑ °´Ã¼. Notification ºê·Îµå ij½ºÅÍ °´Ã¼´Â ÀÌ °´Ã¼¸¦ »ç¿ëÇÒ ¼ö ¾ø´Ù. ÀÌ °´Ã¼´Â ¼Õº¸Áö ¾Ê´Â »óÅ·ΠÅëÁö¿Í ÇÔ²² ¸®½º³Ê¿¡°Ô µ¹·Á º¸³»ÁöÁö ¾ÊÀ¸¸é ¾È µÈ´Ù
IllegalArgumentException
- ¸®½º³Ê°¡ nullÀÎ °æ¿ìremoveNotificationListener(javax.management.NotificationListener)
public void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
NotificationBroadcaster
񃬣:
NotificationBroadcaster
³»ÀÇ removeNotificationListener
listener
- ÀÌÀü¿¡ ÀÌ MBean¿¡ Ãß°¡µÈ ¸®½º³Ê
ListenerNotFoundException
- ¸®½º³Ê°¡ MBean¿¡ µî·ÏµÇÁö ¾ÊÀº °æ¿ìNotificationBroadcaster.addNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
,
NotificationEmitter.removeNotificationListener(javax.management.NotificationListener, javax.management.NotificationFilter, java.lang.Object)
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
NotificationEmitter
±â¼ú: ÀÌ MBean ·ÎºÎÅÍ ¸®½º³Ê¸¦ »èÁ¦ÇÕ´Ï´Ù. MBean´Â
ÁöÁ¤µÈ listener
, filter
¹× handback
ÆÄ¶ó¹ÌÅÍ¿Í Á¤È®ÇÏ°Ô ÀÏÄ¡ÇÏ´Â ¸®½º³Ê¸¦ °¡Áö°í ÀÖÀ» Çʿ䰡 ÀÖ½À´Ï´Ù. ÇØ´çÇÏ´Â ¸®½º³Ê°¡ º¹¼ö Á¸ÀçÇÏ´Â °æ¿ì, ±× ÁßÀÇ 1°³
¸¸ÀÌ »èÁ¦µË´Ï´Ù.
»èÁ¦µÇ´Â ¸®½º³Ê³»¿¡¼ nullÀÌ °¡¸®Å°´Â °æ¿ì, filter
¹× handback
ÆÄ¶ó¹ÌÅÍ´Â nullÀÌ µË´Ï´Ù.
NotificationEmitter
³»ÀÇ removeNotificationListener
listener
- ÀÌÀü¿¡ ÀÌ MBean¿¡ Ãß°¡µÈ ¸®½º³Êfilter
- ¸®½º³ÊÀÇ Ãß°¡½Ã·Î ÁöÁ¤µÈ ÇÊÅÍhandback
- ¸®½º³ÊÀÇ Ãß°¡½Ã·Î ÁöÁ¤µÈ ÇÚµå¹é
ListenerNotFoundException
- ¸®½º³Ê°¡ MBean¿¡ µî·ÏµÇÁö ¾ÊÀº °æ¿ì, ¶Ç´Â ÁöÁ¤µÈ ÇÊÅÍ ¹× ÇÚµå¹éÀ¸·Î µî·ÏµÇÁö ¾ÊÀº °æ¿ìpublic MBeanNotificationInfo [] getNotificationInfo()
NotificationBroadcaster
±â¼ú: ÀÌ MBean°¡ ÅëÁö¸¦ ¼Û½ÅÇÒ ¶§¸¶´Ù, ±× ÅëÁöÀÇ Java Ŭ·¡½º¸í°ú ÅëÁöÇüÀ» ³ªÅ¸³»´Â ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù.
MBean °¡ ÀÌ ¹è¿¿¡ ±â¼úµÇ¾î ÀÖÁö ¾ÊÀº ÅëÁö¸¦ ¼Û½ÅÇÒ ¼ö ¾ø½À´Ï´Ù. ´Ù¸¸, ÀϺÎÀÇ MBean ¼¹ö Ŭ¶óÀÌ¾ðÆ®´Â ÇöÀçÀÇ ±â´É¿¡ ÀÇÇØ ¿Ï¼ºÇÏ´Â ¹è¿¿¡ Á¸Çϰí ÀÖ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù.
NotificationBroadcaster
³»ÀÇ getNotificationInfo
public void sendNotification(Notification notification)
notification
- ¼Û½ÅÇÏ´Â ÅëÁöprotected void handleNotification(NotificationListener listener, Notification notif, Object handback)
ÀÌ ¸Þ¼µå´Â ¸®½º³Ê¿¡°Ô ÅëÁö¸¦ ¼Û½ÅÇϱâ À§ÇØ, sendNotification
¿¡ ÀÇÇØ È£ÃâÇÕ´Ï´Ù. ÅëÁöÀÇ Àü´Þ ¹æ¹ýÀ» º¯°æÇÏ°í ½ÍÀº °æ¿ì, ¿¹¸¦ µé¾î ÅëÁö¸¦ ´Ù¸¥ thread·Î Àü´ÞÇÏ°í ½ÍÀº °æ¿ì µîÀº ¼ºê Ŭ·¡½º³»¿¡¼ ¿À¹ö¶óÀ̵å(override) ÇÒ ¼ö ÀÖ½À´Ï´Ù.
ÀÌ ¸Þ¼µå´Â sendNotification
¸¦
È£ÃâÇÑ thread¿¡ ÀÇÇØ ºÒ·Á °£´Ù°í´Â ÇÒ ¼ö ¾ø½À´Ï´Ù.
ÀÌ ¸Þ¼µåÀÇ µðÆúÆ® ±¸ÇöÀº ¾Æ·¡¿Í µ¿µîÇÕ´Ï´Ù.
listener.handleNotification(notif, handback);
listener
- ÅëÁöÀÇ Àü´Þó ¸®½º³Ênotif
- ¸®½º³Ê¿¡°Ô Àü´ÞµÇ´Â ÅëÁöhandback
- ¸®½º³ÊÀÇ Ãß°¡½Ã·Î ÁöÁ¤µÈ ÇÚµå¹é °´Ã¼
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.