|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor¡¡ ¡¡ | ¸Þ¼µå | »ó¼¼: Çʵå | constructor¡¡ ¡¡ | ¸Þ¼µå |
public interface Registry
Registry
´Â
´Ü¼øÇÑ ¸®¸ðÆ® °´Ã¼ ·¹Áö½ºÆ®¸®¿¡ ´ëÇÑ ¸®¸ðÆ® ÀÎÅÍÆäÀ̽º·Î ÀÓÀÇÀÇ Ä³¸¯ÅÍ ¶óÀÎ¸í¿¡ ¹ÙÀÎµå µÈ ¸®¸ðÆ® °´Ã¼ ÂüÁ¶¸¦ Æ÷ÇÔ ¹× ÃëµæÇϱâ À§ÇÑ ¸Þ¼µå¸¦ Á¦°øÇÕ´Ï´Ù. bind
, unbind
¹× rebind
¸Þ¼µå´Â ·¹Áö½ºÆ®¸®³»ÀÇ ³×ÀÓ ¹ÙÀεùÀ» º¯°æÇÒ °æ¿ì¿¡ »ç¿ëÇØ, lookup
¹× list
¸Þ¼µå´Â ÇöÀçÀÇ ³×ÀÓ ¹ÙÀεùÀ» Á¶È¸ÇÒ °æ¿ì¿¡ »ç¿ëÇÕ´Ï´Ù.
Registry
´Â º¸Åë, RMI Ŭ¶óÀ̾ðÆ®ÀÇ bootstrap¸¦ À¯È¿ÇÏ°Ô ÇÕ´Ï´Ù. Ŭ¶óÀÌ¾ðÆ®´Â ¸®¸ðÆ® °´Ã¼¿¡ÀÇ Ãʱâ ÂüÁ¶¸¦ ½ÃÀ۽ÿ¡ ÃëµæÇÕ´Ï´Ù. ÀÌ ¶§¹®¿¡
·¹Áö½ºÆ®¸®ÀÇ ¸®¸ðÆ® °´Ã¼ ±¸ÇöÀº º¸Åë, ±âÁ¸ÀÇ ÁÖ¼Ò (±âÁ¸ÀÇ ObjID
µî) ¹× TCP Æ÷Æ® ¹øÈ£ (µðÆúÆ®´Â 1099
)¿Í ÇÔ²² export µË´Ï´Ù.
LocateRegistry
Ŭ·¡½º¿¡¼´Â ¸®¸ðÆ® ÁÖ¼Ò¿¡ ÀÖ´Â Registry
¿¡
ÀÇ bootstrap ÂüÁ¶¸¦ ±¸ÃàÇÏ´Â API (static getRegistry
¸Þ¼µå¸¦ ÂüÁ¶)¿Í ÇöÀçÀÇ VM¿¡ Registry
¸¦ ÀÛ¼ºÇØ Æ¯Á¤ÀÇ ·ÎÄà ÁÖ¼Ò¿¡ export ÇÏ´Â API (static createRegistry
¸Þ¼µå¸¦ ÂüÁ¶)¸¦ ÀÌ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù.
Registry
±¸Çö¿¡¼´Â ÀϺΠ¶Ç´Â ¸ðµç ¸Þ¼µå¿¡ ´ëÇÑ ¾×¼¼½º¸¦ Á¦ÇÑÇÒ ¼ö ÀÖ½À´Ï´Ù. ¿¹¸¦ µé¾î
·¹Áö½ºÆ®¸®ÀÇ ¹ÙÀεùÀ» º¯°æÇÏ´Â ¸Þ¼µå´Â ·ÎÄà ȣ½ºÆ®·ÎºÎÅÍÀÇ È£Ãâ¿¡ Á¦ÇÑÇÒ ¼ö ÀÖ½À´Ï´Ù. ƯÁ¤ÀÇ Registry
¸Þ¼µå°¡ ƯÁ¤ÀÇ È£ÃâÀÇ ¾×¼¼½º¸¦ °ÅºÎÇßÀ» °æ¿ì, AccessException
À» ¹ß»ý½Ãŵ´Ï´Ù. ÀÌ ¿¹¿Ü´Â RemoteException
È®ÀåÀ̱⠶§¹®¿¡
¸®¸ðÆ® Ŭ¶óÀÌ¾ðÆ®¿¡ ijġ µÇ¸é ServerException
¿¡ ·¦ µË´Ï´Ù.
Registry
·Î
¹ÙÀεù¿¡ »ç¿ëÇÏ´Â À̸§Àº ¼ø¼öÇÑ Ä³¸¯ÅÍ ¶óÀÎÀ¸·Î ÇØ¼®µÇÁö ¾Ê½À´Ï´Ù. Registry
¿¡ ¼ºñ½º¿¡ÀÇ ¸®¸ðÆ® ÂüÁ¶¸¦ Æ÷ÇÔÇÒ ¶§´Â ·¹Áö½ºÆ®¸®³»¿¡¼ÀÇ À̸§ÀÇ Áߺ¹À» ÁÙÀ̱â À§Çؼ
³×ÀÓ ¹ÙÀεùÀÇ Á¢µÎ»ç·Î¼ ÆÐŰÁö¸íÀ» »ç¿ëÇÏ´Â °ÍÀ» ÃßõÇÕ´Ï´Ù.
LocateRegistry
ÇÊµå °³¿ä | |
---|---|
static int |
REGISTRY_PORT
·¹Áö½ºÆ®¸®¿¡ ÀÚÁÖ »ç¿ëµÇ´Â Æ÷Æ®ÀÔ´Ï´Ù. |
¸Þ¼µå °³¿ä | |
---|---|
void |
bind (String name,
Remote obj)
¸®¸ðÆ® ÂüÁ¶¸¦, ÀÌ ·¹Áö½ºÆ®¸®³»ÀÇ Æ¯Á¤ÀÇ name ¿¡ ¹ÙÀεå ÇÕ´Ï´Ù. |
String [] |
list ()
ÀÌ ·¹Áö½ºÆ®¸®³»¿¡ ¹ÙÀÎµå µÈ À̸§ÀÇ ¹è¿À» ¸®ÅÏÇÕ´Ï´Ù. |
Remote |
lookup (String name)
ÀÌ ·¹Áö½ºÆ®¸®³»ÀÇ Æ¯Á¤ÀÇ name ¿¡ ¹ÙÀÎµå µÇ°í ÀÖ´Â ¸®¸ðÆ® ÂüÁ¶¸¦ ¸®ÅÏÇÕ´Ï´Ù. |
void |
rebind (String name,
Remote obj)
ÀÌ ·¹Áö½ºÆ®¸®³»ÀÇ Æ¯Á¤ÀÇ name ¿¡
ÀÇ ¹ÙÀεùÀ» ƯÁ¤ÀÇ ¸®¸ðÆ® ÂüÁ¶¿¡ ¿Å°Ü³õ½À´Ï´Ù. |
void |
unbind (String name)
ÀÌ ·¹Áö½ºÆ®¸®ÀÇ Æ¯Á¤ÀÇ name ¿¡
ÀÇ ¹ÙÀεùÀ» »èÁ¦ÇÕ´Ï´Ù. |
ÇʵåÀÇ »ó¼¼ |
---|
static final int REGISTRY_PORT
¸Þ¼µåÀÇ »ó¼¼ |
---|
Remote lookup(String name) throws RemoteException, NotBoundException, AccessException
name
¿¡ ¹ÙÀÎµå µÇ°í ÀÖ´Â ¸®¸ðÆ® ÂüÁ¶¸¦ ¸®ÅÏÇÕ´Ï´Ù.
name
- °Ë»öÇÏ´Â ¸®¸ðÆ® ÂüÁ¶ÀÇ À̸§
NotBoundException
- name
°¡ ¹ÙÀεåµÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì
RemoteException
- ·¹Áö½ºÆ®¸®¿ÍÀÇ ¸®¸ðÆ® Åë½Å¿¡ ½ÇÆÐÇßÀ» °æ¿ì. AccessException
À»
Æ÷ÇÔÇÑ ServerException
¿¹¿ÜÀÇ °æ¿ì, ·¹Áö½ºÆ®¸®´Â ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇÑ´Ù
AccessException
- ·ÎÄà ·¹Áö½ºÆ®¸®°¡ ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇßÀ» °æ¿ì
NullPointerException
- name
°¡ null
ÀÎ °æ¿ìvoid bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException
name
¿¡ ¹ÙÀεå ÇÕ´Ï´Ù.
name
- ¸®¸ðÆ® ÂüÁ¶¿¡ °ü·ÃÁþ´Â À̸§obj
- ¸®¸ðÆ® °´Ã¼¿¡ÀÇ ÂüÁ¶ (ÀϹÝÀûÀ¸·Î ½ºÅÓ)
AlreadyBoundException
- name
°¡ À̹Ì
¹ÙÀÎµå µÇ°í ÀÖ´Â °æ¿ì
RemoteException
- ·¹Áö½ºÆ®¸®¿ÍÀÇ ¸®¸ðÆ® Åë½Å¿¡ ½ÇÆÐÇßÀ» °æ¿ì. AccessException
À»
Æ÷ÇÔÇÑ ServerException
¿¹¿ÜÀÇ °æ¿ì, ·¹Áö½ºÆ®¸®´Â ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇÑ´Ù (·ÎÄÃÀÌ ¾Æ´Ñ È£½ºÆ®·ÎºÎÅÍ ¾×¼¼½º ÇÏ·Á°í ÇßÀ» °æ¿ì µî)
AccessException
- ·ÎÄà ·¹Áö½ºÆ®¸®°¡ ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇßÀ» °æ¿ì
NullPointerException
- name
°¡ null
, ¶Ç´Â obj
°¡ null
ÀÎ °æ¿ìvoid unbind(String name) throws RemoteException, NotBoundException, AccessException
name
¿¡
ÀÇ ¹ÙÀεùÀ» »èÁ¦ÇÕ´Ï´Ù.
name
- »èÁ¦ÇÏ´Â ¹ÙÀεùÀÇ À̸§
NotBoundException
- name
°¡ ¹ÙÀεåµÇ¾î ÀÖÁö ¾ÊÀº °æ¿ì
RemoteException
- ·¹Áö½ºÆ®¸®¿ÍÀÇ ¸®¸ðÆ® Åë½Å¿¡ ½ÇÆÐÇßÀ» °æ¿ì. AccessException
À»
Æ÷ÇÔÇÑ ServerException
¿¹¿ÜÀÇ °æ¿ì, ·¹Áö½ºÆ®¸®´Â ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇÑ´Ù (·ÎÄÃÀÌ ¾Æ´Ñ È£½ºÆ®·ÎºÎÅÍ ¾×¼¼½º ÇÏ·Á°í ÇßÀ» °æ¿ì µî)
AccessException
- ·ÎÄà ·¹Áö½ºÆ®¸®°¡ ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇßÀ» °æ¿ì
NullPointerException
- name
°¡ null
ÀÎ °æ¿ìvoid rebind(String name, Remote obj) throws RemoteException, AccessException
name
¿¡
ÀÇ ¹ÙÀεùÀ» ƯÁ¤ÀÇ ¸®¸ðÆ® ÂüÁ¶¿¡ ¿Å°Ü³õ½À´Ï´Ù. ±× name
¿¡ À̹Ì
¹ÙÀεùÀÌ ¼³Á¤µÇ¾î ÀÖ´Â °æ¿ì´Â ÆÄ±âµË´Ï´Ù.
name
- ¸®¸ðÆ® ÂüÁ¶¿¡ °ü·ÃÁþ´Â À̸§obj
- ¸®¸ðÆ® °´Ã¼¿¡ÀÇ ÂüÁ¶ (ÀϹÝÀûÀ¸·Î ½ºÅÓ)
RemoteException
- ·¹Áö½ºÆ®¸®¿ÍÀÇ ¸®¸ðÆ® Åë½Å¿¡ ½ÇÆÐÇßÀ» °æ¿ì. AccessException
À»
Æ÷ÇÔÇÑ ServerException
¿¹¿ÜÀÇ °æ¿ì, ·¹Áö½ºÆ®¸®´Â ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇÑ´Ù (·ÎÄÃÀÌ ¾Æ´Ñ È£½ºÆ®·ÎºÎÅÍ ¾×¼¼½º ÇÏ·Á°í ÇßÀ» °æ¿ì µî)
AccessException
- ·ÎÄà ·¹Áö½ºÆ®¸®°¡ ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇßÀ» °æ¿ì
NullPointerException
- name
°¡ null
, ¶Ç´Â obj
°¡ null
ÀÎ °æ¿ìString [] list() throws RemoteException, AccessException
RemoteException
- ·¹Áö½ºÆ®¸®¿ÍÀÇ ¸®¸ðÆ® Åë½Å¿¡ ½ÇÆÐÇßÀ» °æ¿ì. AccessException
À»
Æ÷ÇÔÇÑ ServerException
¿¹¿ÜÀÇ °æ¿ì, ·¹Áö½ºÆ®¸®´Â ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇÑ´Ù
AccessException
- ·ÎÄà ·¹Áö½ºÆ®¸®°¡ ÀÌ Á¶ÀÛÀ» ½ÇÇàÇϴ ȣÃâÃø ¾×¼¼½º¸¦ °ÅºÎÇßÀ» °æ¿ì
|
JavaTM 2 Platform Standard Ed. 5.0 |
|||||||||
ÀÌÀü Ŭ·¡½º ´ÙÀ½ Ŭ·¡½º | ÇÁ·¹ÀÓÀ¸·Î ÇÁ·¹ÀÓ ¾øÀÌ | |||||||||
°³¿ä: NESTED | Çʵå | constructor¡¡ ¡¡ | ¸Þ¼µå | »ó¼¼: Çʵå | constructor¡¡ ¡¡ | ¸Þ¼µå |
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy µµ ÂüÁ¶ÇϽʽÿÀ.