|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor | ¸Þ¼µå | »ó¼¼: Çʵå | »ý¼ºÀÚ | ¸Þ¼µå |
java.lang.Objectjava.lang.ThreadGroup
public class ThreadGroup
thread ±×·ìÀº threadÀÇ ÁýÇÕÀ» ³ªÅ¸³À´Ï´Ù. °Ô´Ù°¡ thread ±×·ì¿¡´Â ´Ù¸¥ thread ±×·ìÀÌ Æ÷ÇԵǴ Àϵµ ÀÖ½À´Ï´Ù. thread ±×·ìÀº Æ®¸®¸¦ Çü¼ºÇØ, ÃÖÃÊÀÇ thread ±×·ìÀ» Á¦¿ÜÇØ ±× Áß¿¡ ºÎ¸ð¸¦ °¡Áý´Ï´Ù.
thread´Â ±× ÀÚüÀÇ thread ±×·ì¿¡ ´ëÇÑ Á¤º¸¿¡ ¾×¼¼½º ÇÏ´Â °ÍÀ» Çã°¡µÇ°í ÀÖ½À´Ï´Ù¸¸, ±× thread ±×·ìÀÇ Ä£thread ±×·ì ¶Ç´Â ±× ´Ù¸¥ thread ±×·ì¿¡ ´ëÇÑ Á¤º¸¿¡ ¾×¼¼½º ÇÒ ¼ö ¾ø½À´Ï´Ù.
»ý¼ºÀÚ °³¿ä | |
---|---|
ThreadGroup (String name)
»õ·Î¿î thread ±×·ìÀ» ±¸ÃàÇÕ´Ï´Ù. |
|
ThreadGroup (ThreadGroup parent,
String name)
»õ·Î¿î thread ±×·ìÀ» ÀÛ¼ºÇÕ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
int |
activeCount ()
thread ±×·ì³»ÀÇ ¾×Ƽºê threadÀÇ ´ë·«ÀÇ ¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
int |
activeGroupCount ()
ÀÌ thread ±×·ì³»ÀÇ ¾×Ƽºê ±×·ìÀÇ ´ë·«ÀÇ ¼ö¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
boolean |
allowThreadSuspension (boolean b)
ÃßõÇÏÁö ¾Ê½À´Ï´Ù. ÀÌ È£ÃâÀÇ Á¤ÀÇ´Â ÃßõµÇ¾î ÀÖÁö ¾ÊÀº suspend() ¿¡
ÀÇÁ¸ÇÕ´Ï´Ù. ¶Ç, ÀÌ È£ÃâÀÇ µ¿ÀÛÀº ÁöÁ¤µÇÁö ¾Ê½À´Ï´Ù. |
void |
checkAccess ()
ÇöÀç ½ÇÇàÁßÀÇ thread°¡ ÀÌ thread ±×·ìÀ» º¯°æÇÏ´Â Á¢±Ù ±ÇÇÑÀ» °¡Áö°í ÀÖÀ»Áö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
void |
destroy ()
ÀÌ thread ±×·ì°ú ±× ¼Ò±×·ìÀÇ ¸ðµç °ÍÀ» ÆÄ±âÇÕ´Ï´Ù. |
int |
enumerate (Thread [] list)
ÀÌ thread ±×·ì°ú ±× ¼Ò±×·ì³»ÀÇ °¢ ¾×Ƽºê thread¸¦, ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int |
enumerate (Thread [] list,
boolean recurse)
ÀÌ thread ±×·ì³»ÀÇ °¢ ¾×Ƽºê thread¸¦, ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int |
enumerate (ThreadGroup [] list)
ÀÌ thread ±×·ì³»ÀÇ °¢ ¾×Ƽºê ¼Ò±×·ì¿¡ÀÇ ÂüÁ¶¸¦, ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int |
enumerate (ThreadGroup [] list,
boolean recurse)
ÀÌ thread ±×·ì³»ÀÇ °¢ ¾×Ƽºê ¼Ò±×·ì¿¡ÀÇ ÂüÁ¶¸¦, ÁöÁ¤µÈ ¹è¿¿¡ Ä«ÇÇÇÕ´Ï´Ù. |
int |
getMaxPriority ()
ÀÌ thread ±×·ìÀÇ ÃÖ°í ¿ì¼± ¼øÀ§¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
String |
getName ()
ÀÌ thread ±×·ìÀÇ À̸§À» ¸®ÅÏÇÕ´Ï´Ù. |
ThreadGroup |
getParent ()
ÀÌ thread ±×·ìÀÇ ºÎ¸ð¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
void |
interrupt ()
ÀÌ thread ±×·ì³»ÀÇ ¸ðµç thread¿¡ ³¢¾îµì´Ï´Ù. |
boolean |
isDaemon ()
ÀÌ thread ±×·ìÀÌ demon thread ±×·ìÀÏÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
boolean |
isDestroyed ()
ÀÌ thread ±×·ìÀÌ ÆÄ±âµÇ¾ú´ÂÁö ¾î¶°Çß´ÂÁö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
void |
list ()
ÀÌ thread ±×·ì¿¡ ´ëÇÑ Á¤º¸¸¦ Ç¥ÁØ Ãâ·Â¿¡ Ãâ·ÂÇÕ´Ï´Ù. |
boolean |
parentOf (ThreadGroup g)
ÀÌ thread ±×·ìÀÌ thread ±×·ì ÀμöÀ̵簡 ȤÀº °Ô´Ù°¡ À§thread ±×·ì ÁßÀÇ 1°³ ÀÏÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÕ´Ï´Ù. |
void |
resume ()
ÃßõÇÏÁö ¾Ê½À´Ï´Ù. ÀÌ ¸Þ¼µå´Â ´ÜÁö Thread.suspend ¹× ThreadGroup.suspend¿Í Á¶ÇÕÇØ »ç¿ëµË´Ï´Ù. ¸ðµÎ µ¥µå ·ÏÀ» ¹ß»ý½ÃŰ±â ½±±â ¶§¹®¿¡ Ãßõ µÇÁö ¾Ê½À´Ï´Ù. ÀÚ¼¼ÇÑ °ÍÀº Thread.suspend() ¸¦
ÂüÁ¶ÇϽʽÿÀ. |
void |
setDaemon (boolean daemon)
ÀÌ thread ±×·ìÀÇ demon »óŸ¦ º¯°æÇÕ´Ï´Ù. |
void |
setMaxPriority (int pri)
±×·ìÀÇ ÃÖ°í ¿ì¼± ¼øÀ§¸¦ ¼³Á¤ÇÕ´Ï´Ù. |
void |
stop ()
ÃßõÇÏÁö ¾Ê½À´Ï´Ù. ÀÌ ¸Þ¼µå´Â º»ÁúÀûÀ¸·Î ¾ÈÀüÇÏÁö´Â ¾Ê½À´Ï´Ù. ÀÚ¼¼ÇÑ °ÍÀº Thread.stop() ¸¦
ÂüÁ¶ÇϽʽÿÀ. |
void |
suspend ()
ÃßõÇÏÁö ¾Ê½À´Ï´Ù. ÀÌ ¸Þ¼µå´Â º»ÁúÀûÀ¸·Î µ¥µå ·ÏÀ» ¹ß»ý½ÃŰ±â ½¬¿öÁö°í ÀÖ½À´Ï´Ù. ÀÚ¼¼ÇÑ °ÍÀº Thread.suspend() ¸¦
ÂüÁ¶ÇϽʽÿÀ. |
String |
toString ()
ÀÌ ThreadGroup ij¸¯ÅÍ ¶óÀΠǥÇöÀ» ¸®ÅÏÇÕ´Ï´Ù. |
void |
uncaughtException (Thread t,
Throwable e)
ÀÌ thread ±×·ì³»ÀÇ thread°¡ ijġµÇ¾î ÀÖÁö ¾ÊÀº ¿¹¿Ü¸¦ À§Çؼ Á¤ÁöÇØ, thread¿¡ °íÀ¯ Thread.UncaughtExceptionHandler °¡ °®ÃçÁ® ÀÖÁö ¾ÊÀ» ¶§¿¡
Java °¡»ó ¸Ó½Å¿¡ ÀÇÇØ È£ÃâÇÕ´Ï´Ù. |
Ŭ·¡½º java.lang. Object ·ÎºÎÅÍ »ó¼ÓµÈ ¸Þ¼µå |
---|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
»ý¼ºÀÚ »ó¼¼ |
---|
public ThreadGroup(String name)
Ä£thread ±×·ìÀÇ checkAccess
¸Þ¼µå´Â Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýÇÏ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
name
- »õ·Î¿î thread ±×·ìÀÇ À̸§
SecurityException
- ÇöÀçÀÇ thread°¡ ÁöÁ¤µÈ thread ±×·ì³»ÀÇ thread¸¦ ÀÛ¼ºÇÒ ¼ö ¾ø´Â °æ¿ìcheckAccess()
public ThreadGroup(ThreadGroup parent, String name)
Ä£thread ±×·ìÀÇ checkAccess
¸Þ¼µå´Â Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýÇÏ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
parent
- ºÎ¸ðÀÇ thread ±×·ìname
- »õ·Î¿î thread ±×·ìÀÇ À̸§
NullPointerException
- thread ±×·ìÀÇ Àμö°¡ null
ÀÎ °æ¿ì
SecurityException
- ÇöÀçÀÇ thread°¡ ÁöÁ¤µÈ thread ±×·ì³»ÀÇ thread¸¦ ÀÛ¼ºÇÒ ¼ö ¾ø´Â °æ¿ìSecurityException
,
checkAccess()
¸Þ¼µåÀÇ »ó¼¼ |
---|
public final String getName()
public final ThreadGroup getParent()
ºÎ¸ð°¡ null
ÀÌ ¾Æ´Ñ °æ¿ì, ÃÖÃʷΠģthread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
null
ÀÎ thread ±×·ìÀº Åé ·¹º§ÀÇ thread ±×·ì¸¸
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ìÀ» º¯°æÇÒ ¼ö ¾ø´Â °æ¿ìcheckAccess()
,
SecurityException
,
RuntimePermission
public final int getMaxPriority()
setMaxPriority(int)
public final boolean isDaemon()
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
public boolean isDestroyed()
public final void setDaemon(boolean daemon)
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
demon thread ±×·ìÀº ±× ¸¶Áö¸· thread°¡ Á¤ÁöÇÏ´Â °æ¿ì, ¶Ç´Â ±× ¸¶Áö¸· thread ±×·ìÀÌ ÆÄ±âµÇ´Â °æ¿ì¿¡ ÀÚµ¿ÀûÀ¸·Î ÆÄ±âµË´Ï´Ù.
daemon
- true
ÀÎ °æ¿ì´Â ÀÌ thread ±×·ìÀ» demon thread ±×·ìÀ¸·Î¼ ¸¶Å© ÇØ, ±×·¸Áö ¾ÊÀº °æ¿ì´Â ÀÌ thread ±×·ìÀ» ÀϹÝÀÇ °ÍÀ¸·ÎÀÇÇØ ¸¶Å© ÇÑ´Ù
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ìÀ» º¯°æÇÒ ¼ö ¾ø´Â °æ¿ìSecurityException
,
checkAccess()
public final void setMaxPriority(int pri)
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
pri
ÀμöÀÇ °ªÀÌ Thread.MIN_PRIORITY
º¸´Ù ÀÛÀºÁö, Thread.MAX_PRIORITY
º¸´Ù Å« °æ¿ì, ±×·ìÀÇ ÃÖ°í ¿ì¼± ¼øÀ§´Â º¯°æµÇÁö ¾Ê½À´Ï´Ù.
±× ¿ÜÀÇ °æ¿ì, ÀÌ ThreadGroup °´Ã¼ÀÇ ¿ì¼± ¼øÀ§´Â ÁöÁ¤µÈ pri
¹× ÀÌ thread ±×·ìÀÇ ºÎ¸ð¿¡°Ô Çã°¡µÇ´Â ÃÖ°í ¿ì¼± ¼øÀ§º¸´Ù ³·°Ô ¼³Á¤µË´Ï´Ù (ÀÌ thread ±×·ìÀÌ, ºÎ¸ð¸¦ °¡ÁöÁö ¾Ê´Â ½Ã½ºÅÛ thread ±×·ìÀÇ °æ¿ì, ±× ÃÖ°í ¿ì¼± ¼øÀ§´Â pri
ÀÎ ¸¸Å ¼³Á¤µÈ´Ù). ±× ÈÄ, ÀÌ thread ±×·ì¿¡ ¼ÓÇÏ´Â thread ±×·ì ¸¶´Ù, ÀÌ ¸Þ¼µå°¡ pri
¸¦ Àμö·Î¼ Àç±ÍÀûÀ¸·Î È£ÃâÇÕ´Ï´Ù.
pri
- thread ±×·ìÀÇ »õ·Î¿î ¿ì¼± ¼øÀ§
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ìÀ» º¯°æÇÒ ¼ö ¾ø´Â °æ¿ìgetMaxPriority()
,
SecurityException
,
checkAccess()
public final boolean parentOf(ThreadGroup g)
g
- thread ±×·ì
true
, ±×·¸Áö ¾ÊÀº °æ¿ì´Â false
public final void checkAccess()
½ÃÅ¥·¯Æ¼ ¸Å´ÏÀú°¡ Á¸ÀçÇÏ´Â °æ¿ì, ÀÌ ±×·ìÀÌ ±× Àμö·Î¼ ÁöÁ¤µÇ¾î ±× checkAccess
¸Þ¼µå°¡ È£ÃâµË´Ï´Ù. ±× °á°ú, SecurityException
°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ì¿¡ÀÇ ¾×¼¼½º°¡ ¿ë¼µÇÁö ¾ÊÀº °æ¿ìSecurityManager.checkAccess(java.lang.ThreadGroup)
public int activeCount()
°á°ú´Â º»ÁúÀûÀ¸·Î ºÎÁ¤È®ÇÑ ¼ºÁúÀ» °¡Áö±â ¶§¹®¿¡ ÀÌ ¸Þ¼µå´Â Á¤º¸ ¸ñÀûÀÎ ¸¸Å »ç¿ëÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
public int enumerate(Thread [] list)
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
¾îÇø®ÄÉÀ̼ǿ¡¼´Â ¹è¿ÀÌ ¾î´À Á¤µµÀÇ Å©±â°¡ µÉ±î¿¡ ÀÓÇØ¼ ´ë·«ÀÇ ¼ö¸¦ ¾ò´ÂÀÎ °æ¿ì activeCount
¸Þ¼µå¸¦ »ç¿ëÇÏ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. ´Ù¸¸, ¹è¿ÀÌ ³Ê¹« ÀÛ¾Æ ¸ðµç thread¸¦ º¸°ü À¯ÁöÇÒ ¼ö ¾ø´Â °æ¿ì, ¿©ºÐÀÇ thread´Â ÅëÁö¾øÀÌ ¹«½ÃµË´Ï´Ù. ÀÌ thread ±×·ì°ú ±× ¼Ò±×·ì¿¡ ÀÖ´Â ¸ðµç ¾×Ƽºê thread¸¦ ¾ò´Â °ÍÀÌ Áß¿äÇÑ °æ¿ì, È£ÃâÃøÀº ¸®ÅÏµÈ Á¤¼ö°ªÀÌ ¾ö¹ÐÇÏ°Ô list
±æÀÌ ¹Ì¸¸ÀÎ °ÍÀ» È®ÀÎÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
ÀÌ ¸Þ¼µåÀÇ º»ÁúÀûÀÎ °æÇÕ Á¶°ÇÀ̱⠶§¹®¿¡ ÀÌ ¸Þ¼µå´Â Á¤º¸ ¸ñÀûÀÎ ¸¸Å »ç¿ëÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
list
- threadÀÇ ¸®½ºÆ®ÀÇ Æ÷ÇÔóÀÎ ¹è¿
SecurityException
- ÇöÀçÀÇ thread¿¡
ÀÌ thread ±×·ìÀ» ¿°ÅÇϱâ À§ÇÑ Á¢±Ù ±ÇÇÑÀÌ ¾ø´Â °æ¿ìactiveCount()
,
checkAccess()
public int enumerate(Thread [] list, boolean recurse)
recurse
Ç÷¡±×°¡ true
ÀÎ °æ¿ì, ÀÌ threadÀÇ ¼Ò±×·ì³»ÀÇ °¢ ¾×Ƽºê thread¿¡ÀÇ ÂüÁ¶µµ Æ÷ÇԵ˴ϴÙ. ¹è¿ÀÌ ³Ê¹« ÀÛ¾Æ ¸ðµç thread¸¦ º¸°ü À¯ÁöÇÒ ¼ö ¾ø´Â °æ¿ì, ¿©ºÐÀÇ thread´Â ÅëÁö¾øÀÌ ¹«½ÃµË´Ï´Ù.
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
¾îÇø®ÄÉÀ̼ǿ¡¼´Â ¹è¿ÀÌ ¾î´À Á¤µµÀÇ Å©±â°¡ µÉ±î¿¡ ÀÓÇØ¼ ´ë·«ÀÇ ¼ö¸¦ ¾ò´ÂÀÎ °æ¿ì activeCount
¸Þ¼µå¸¦ »ç¿ëÇÏ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. ´Ù¸¸, ¹è¿ÀÌ ³Ê¹« ÀÛ¾Æ ¸ðµç thread¸¦ º¸°ü À¯ÁöÇÒ ¼ö ¾ø´Â °æ¿ì, ¿©ºÐÀÇ thread´Â ÅëÁö¾øÀÌ ¹«½ÃµË´Ï´Ù. ÀÌ thread ±×·ì¿¡ ÀÖ´Â ¸ðµç ¾×Ƽºê thread¸¦ ¾ò´Â °ÍÀÌ Áß¿äÇÑ °æ¿ì, È£ÃâÃøÀº ¸®ÅÏµÈ Á¤¼ö°ªÀÌ ¾ö¹ÐÇÏ°Ô list
±æÀÌ ¹Ì¸¸ÀÎ °ÍÀ» È®ÀÎÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
ÀÌ ¸Þ¼µåÀÇ º»ÁúÀûÀÎ °æÇÕ Á¶°ÇÀ̱⠶§¹®¿¡ ÀÌ ¸Þ¼µå´Â Á¤º¸ ¸ñÀûÀÎ ¸¸Å »ç¿ëÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
list
- threadÀÇ ¸®½ºÆ®ÀÇ Æ÷ÇÔóÀÎ ¹è¿recurse
- ÀÌ thread ±×·ìÀÇ ¼Ò±×·ìÀÎ thread ±×·ì³»ÀÇ threadµµ Æ÷ÇÔÇÒÁö ¾î¶³Áö¸¦ ³ªÅ¸³»´Â Ç÷¡±×
SecurityException
- ÇöÀçÀÇ thread¿¡
ÀÌ thread ±×·ìÀ» ¿°ÅÇϱâ À§ÇÑ Á¢±Ù ±ÇÇÑÀÌ ¾ø´Â °æ¿ìactiveCount()
,
checkAccess()
public int activeGroupCount()
°á°ú´Â º»ÁúÀûÀ¸·Î ºÎÁ¤È®ÇÑ ¼ºÁúÀ» °¡Áö±â ¶§¹®¿¡ ÀÌ ¸Þ¼µå´Â Á¤º¸ ¸ñÀûÀÎ ¸¸Å »ç¿ëÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
public int enumerate(ThreadGroup [] list)
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
¾îÇø®ÄÉÀ̼ǿ¡¼´Â ¹è¿ÀÌ ¾î´À Á¤µµÀÇ Å©±â°¡ µÉ±î¿¡ ÀÓÇØ¼ ´ë·«ÀÇ ¼ö¸¦ ¾ò´ÂÀÎ °æ¿ì activeGroupCount
¸Þ¼µå¸¦ »ç¿ëÇÏ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. ´Ù¸¸, ¹è¿ÀÌ ³Ê¹« ÀÛ¾Æ ¸ðµç thread ±×·ìÀ» º¸°ü À¯ÁöÇÒ ¼ö ¾ø´Â °æ¿ì, ¿©ºÐÀÇ thread´Â ÅëÁö¾øÀÌ ¹«½ÃµË´Ï´Ù. ÀÌ thread ±×·ì¿¡ ÀÖ´Â ¸ðµç ¾×Ƽºê ¼Ò±×·ìÀ» ¾ò´Â °ÍÀÌ Áß¿äÇÑ °æ¿ì, È£ÃâÃøÀº ¸®ÅÏµÈ Á¤¼ö°ªÀÌ ¾ö¹ÐÇÏ°Ô list
±æÀÌ ¹Ì¸¸ÀÎ °ÍÀ» È®ÀÎÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
ÀÌ ¸Þ¼µåÀÇ º»ÁúÀûÀÎ °æÇÕ Á¶°ÇÀ̱⠶§¹®¿¡ ÀÌ ¸Þ¼µå´Â Á¤º¸ ¸ñÀûÀÎ ¸¸Å »ç¿ëÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
list
- thread ±×·ìÀÇ ¸®½ºÆ®ÀÇ Æ÷ÇÔóÀÇ ¹è¿
SecurityException
- ÇöÀçÀÇ thread¿¡
ÀÌ thread ±×·ìÀ» ¿°ÅÇϱâ À§ÇÑ Á¢±Ù ±ÇÇÑÀÌ ¾ø´Â °æ¿ìactiveGroupCount()
,
checkAccess()
public int enumerate(ThreadGroup [] list, boolean recurse)
recurse
Ç÷¡±×°¡ true
ÀÎ °æ¿ì, ¼Ò±×·ìµîÀÇ ¸ðµç ¾×Ƽºê ¼Ò±×·ì¿¡ÀÇ ÂüÁ¶µµ Æ÷ÇԵ˴ϴÙ.
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
¾îÇø®ÄÉÀ̼ǿ¡¼´Â ¹è¿ÀÌ ¾î´À Á¤µµÀÇ Å©±â°¡ µÉ±î¿¡ ÀÓÇØ¼ ´ë·«ÀÇ ¼ö¸¦ ¾ò´ÂÀÎ °æ¿ì activeGroupCount
¸Þ¼µå¸¦ »ç¿ëÇÏ´Â °æ¿ì°¡ ÀÖ½À´Ï´Ù. ´Ù¸¸, ¹è¿ÀÌ ³Ê¹« ÀÛ¾Æ ¸ðµç thread ±×·ìÀ» º¸°ü À¯ÁöÇÒ ¼ö ¾ø´Â °æ¿ì, ¿©ºÐÀÇ thread´Â ÅëÁö¾øÀÌ ¹«½ÃµË´Ï´Ù. ÀÌ thread ±×·ì¿¡ ÀÖ´Â ¸ðµç ¾×Ƽºê ¼Ò±×·ìÀ» ¾ò´Â °ÍÀÌ Áß¿äÇÑ °æ¿ì, È£ÃâÃøÀº ¸®ÅÏµÈ Á¤¼ö°ªÀÌ ¾ö¹ÐÇÏ°Ô list
±æÀÌ ¹Ì¸¸ÀÎ °ÍÀ» È®ÀÎÇÒ Çʿ䰡 ÀÖ½À´Ï´Ù.
ÀÌ ¸Þ¼µåÀÇ º»ÁúÀûÀÎ °æÇÕ Á¶°ÇÀ̱⠶§¹®¿¡ ÀÌ ¸Þ¼µå´Â Á¤º¸ ¸ñÀûÀÎ ¸¸Å »ç¿ëÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
list
- threadÀÇ ¸®½ºÆ®ÀÇ Æ÷ÇÔóÀÎ ¹è¿recurse
- Æ÷ÇԵǴ ¸ðµç thread ±×·ìÀ» Àç±ÍÀûÀ¸·Î ¿°ÅÇÒÁö ¾î¶³Áö¸¦ ³ªÅ¸³»´Â Ç÷¡±×
SecurityException
- ÇöÀçÀÇ thread¿¡
ÀÌ thread ±×·ìÀ» ¿°ÅÇϱâ À§ÇÑ Á¢±Ù ±ÇÇÑÀÌ ¾ø´Â °æ¿ìactiveGroupCount()
,
checkAccess()
@Deprecated public final void stop()
Thread.stop()
¸¦
ÂüÁ¶ÇϽʽÿÀ.
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
´ÙÀ½¿¡ ÀÌ ¸Þ¼µå´Â ÀÌ thread ±×·ì°ú ±× ¸ðµç ¼Ò±×·ì³»ÀÇ ¸ðµç thread¿¡ ´ëÇØ stop
¸Þ¼µå¸¦ È£ÃâÇÕ´Ï´Ù.
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ì ¶Ç´Â thread ±×·ì³»ÀÇ thread¿¡ÀÇ ¾×¼¼½º°¡ Çã°¡µÇÁö ¾Ê´Â °æ¿ìSecurityException
,
Thread.stop()
,
checkAccess()
public final void interrupt()
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
´ÙÀ½¿¡ ÀÌ ¸Þ¼µå´Â ÀÌ thread ±×·ì°ú ±× ¸ðµç ¼Ò±×·ì³»ÀÇ ¸ðµç thread¿¡ ´ëÇØ interrupt
¸Þ¼µå¸¦ È£ÃâÇÕ´Ï´Ù.
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ì ¶Ç´Â thread ±×·ì³»ÀÇ thread¿¡ÀÇ ¾×¼¼½º°¡ Çã°¡µÇÁö ¾Ê´Â °æ¿ìThread.interrupt()
,
SecurityException
,
checkAccess()
@Deprecated public final void suspend()
Thread.suspend()
¸¦
ÂüÁ¶ÇϽʽÿÀ.
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
´ÙÀ½¿¡ ÀÌ ¸Þ¼µå´Â ÀÌ thread ±×·ì°ú ±× ¸ðµç ¼Ò±×·ì³»ÀÇ ¸ðµç thread¿¡ ´ëÇØ suspend
¸Þ¼µå¸¦ È£ÃâÇÕ´Ï´Ù.
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ì ¶Ç´Â thread ±×·ì³»ÀÇ thread¿¡ÀÇ ¾×¼¼½º°¡ Çã°¡µÇÁö ¾Ê´Â °æ¿ìThread.suspend()
,
SecurityException
,
checkAccess()
@Deprecated public final void resume()
Thread.suspend()
¸¦
ÂüÁ¶ÇϽʽÿÀ.
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
´ÙÀ½¿¡ ÀÌ ¸Þ¼µå´Â ÀÌ thread ±×·ì°ú ±× ¸ðµç ¼Ò±×·ì³»ÀÇ ¸ðµç thread¿¡ ´ëÇØ resume
¸Þ¼µå¸¦ È£ÃâÇÕ´Ï´Ù.
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ì ¶Ç´Â thread ±×·ì³»ÀÇ thread¿¡ÀÇ ¾×¼¼½º°¡ Çã°¡µÇÁö ¾Ê´Â °æ¿ìSecurityException
,
Thread.resume()
,
checkAccess()
public final void destroy()
¿ì¼±, ÀÌ thread ±×·ìÀÇ checkAccess
¸Þ¼µå°¡ Àμö¾øÀÌ È£ÃâÇÕ´Ï´Ù. ÀÌ °á°ú, ½ÃÅ¥·¯Æ¼ ¿¹¿Ü°¡ ¹ß»ýµÇ´Â ÀÏÀÌ ÀÖ½À´Ï´Ù.
IllegalThreadStateException
- thread ±×·ìÀÌ ºñ¾îÀÖÁö ¾ÊÀº °æ¿ì, ¶Ç´Â thread ±×·ìÀÌ À̹Ì
ÆÄ±âµÇ°í ÀÖ´Â °æ¿ì
SecurityException
- ÇöÀçÀÇ thread°¡ ÀÌ thread ±×·ìÀ» º¯°æÇÒ ¼ö ¾ø´Â °æ¿ìcheckAccess()
public void list()
public void uncaughtException(Thread t, Throwable e)
Thread.UncaughtExceptionHandler
°¡ °®ÃçÁ® ÀÖÁö ¾ÊÀ» ¶§¿¡
Java °¡»ó ¸Ó½Å¿¡ ÀÇÇØ È£ÃâÇÕ´Ï´Ù.
ThreadGroup
uncaughtException
¸Þ¼µå´Â ÀÌÇϸ¦ ½ÇÇàÇÕ´Ï´Ù.
uncaughtException
¸Þ¼µå´Â °°Àº 2°³ÀÇ Àμö°¡ ÁöÁ¤µÇ¾î ºÒ·Á °£´ÙuncaughtException
¸Þ¼µå°¡ ºÒ·Á °£´ÙThrowable
Àμö°¡ ThreadDeath
ÀνºÅϽºÀÏÁö ¾î¶³Áö¸¦ ÆÇÁ¤ÇÑ´Ù. ÀÌ ÀνºÅϽºÀÎ °æ¿ì´Â Ưº°ÇÑ (ÀÏ)°ÍÀº ½ÇÇàµÇÁö ¾Ê´Â´Ù. ÀÌ ÀνºÅϽº°¡ ¾Æ´Ñ °æ¿ì, Throwable
printStackTrace
¸Þ¼µå¸¦ »ç¿ëÇØ, threadÀÇ getName
¸Þ¼µå·ÎºÎÅÍ ¸®ÅϵÈ
thread¸íÀ» Æ÷ÇÔÇÑ ¸Þ¼¼Áö¿Í ½ºÅà ¹é Æ®·¹À̽º°¡Ç¥ÁØ ¿¡·¯ ½ºÆ®¸²¿¡ Ãâ·ÂµÈ´Ù
¾îÇø®ÄÉÀ̼ÇÀº, ThreadGroup
¼ºê Ŭ·¡½º¿¡¼ ÀÌ ¸Þ¼µå¸¦ ¿À¹ö¶óÀ̵å(override) ÇØ, ijġµÇ¾î ÀÖÁö ¾ÊÀº ¿¹¿Ü¸¦ ´Ù¸¥ ¹æ¹ýÀ¸·Î ó¸®ÇÒ ¼ö ÀÖ½À´Ï´Ù
.
Thread.UncaughtExceptionHandler
³»ÀÇ uncaughtException
t
- Á¾·áÇÏ·Á°í Çϰí ÀÖ´Â threade
- ijġµÇ¾î ÀÖÁö ¾ÊÀº ¿¹¿Ü@Deprecated public boolean allowThreadSuspension(boolean b)
suspend()
¿¡
ÀÇÁ¸ÇÕ´Ï´Ù. ¶Ç, ÀÌ È£ÃâÀÇ µ¿ÀÛÀº ÁöÁ¤µÇÁö ¾Ê½À´Ï´Ù.
b
- Áß´ÜÀ» °¡´É ¶Ç´Â ºÒ°¡·Î ÇÏ´Â ºÒ¸®¾ð °ª
public String toString()
Object
³»ÀÇ toString
|
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 µµ ÂüÁ¶ÇϽʽÿÀ.