UnicastRemoteObject.exportObject(Remote) But...


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]

±Û¾´ÀÌ :ÀÌ¿ø¿µ 1998³â 11¿ù 06ÀÏ 14:58:36

In Reply to: [Áú¹®] RMIÀÇ exportRemoteObject posted by °­½Åµ¿ on 1998³â 11¿ù 05ÀÏ 11:59:14:


UnicastRemoteObject.exportObject(Remote)
Method´Â Remote Interface¸¦ ImplementsÇÑ °´Ã¼À»
UnicastRemoteObject·Î ¸¸µé¾î ÁÖ´Â ±â´ÉÀ» ÇÕ´Ï´Ù.


RMI Server Implementation¸¦ ÇÒ ¶§
public class HelloImpl extends UnicastRemoteObject implements Hello
{
..
}
ÇÏÀݾƿä, Áï HelloImplÀº UnicastRemoteObject¸¦ »ó¼Ó¹Þ¾Æ»ç¿ëÇϴµ¥,
AppletÀ̳ª Frameµî°ú °°Àº object¸¦ RMI Remote Object·Î
»ç¿ëÇÒ ¼ö ÀÖµµ·Ï ¸¸µé¾î ÁÙ ¶§ À§ÀÇ method¸¦ »ç¿ëÇÕ´Ï´Ù.


¿¹)
[Node.java]
import java.rmi.*;
public interface Node extends java.rmi.Remote {
void client_method( String message ) throws java.rmi.RemoteException;
}


[NodeApplet.java]
....
public class NodeApplet extends Applet implements Node
{
....
public void init(){
....
UnicastRemoteObject.exportObject(this);
...
NodeServer server = (NodeServer)Naming.lookup(..);
server.registry(this); <=== Áï Node Interface¸¦ ±¸ÇöÇÑApplet Reference¸¦ ÀÎÀÚ·Î ³Ñ±è
..
}
public void client_method(String message) throws RemoteException{
.....
}


}


±×·¯¸é NodeServer´Â ±× Reference¸¦ ÀÌ¿ëÇØ
node1.client_method("hey...");¶ó°í ÇÊ¿äÇÒ ¶§ ¸¶´Ù AppletÀÇ
method¸¦ ºÎ¸¦ ¼ö ÀÖ°Ô µÇÁÒ.


====================================
±×·¯³ª, ±×·¯³ª.. But,
ÀÌ°ÍÀº netscape¿¡¼­´Â ¾ÆÁ÷ ¾ÈµË´Ï´Ù.
DNS¿¡ µî·ÏµÇ¾î ÀÖÁö ¾ÊÀº ¸Ó½Å¿¡¼­´Â RMI°¡
Registry¿¡ µî·ÏÇÒ ¶§ ¸Ó½Å ¸íÀ¸·Î µî·ÏÇÏ°Ô µÇ°í
IP Address·Î ÇÏÁö ¾ÊÀݽÀ´Ï±î?
RMI Server Ãø °°Àº °æ¿ì´Â
InetAddress address = InetAddress.getLocalHost();
String thisHost = address.getHostAddress();


Properties currentProperties = System.getProperties();
currentProperties.put("java.rmi.server.hostname", thisHost);
System.setProperties(currentProperties);
¿Í °°Àº ¹æ½ÄÀ¸·Î Registry¿¡ µî·ÏÇÒ ¶§ IP Address¸¦
»ç¿ëÇ϶ó°í ¸í½ÃÀûÀ¸·Î ¼³Á¤ÇÒ ¼ö ÀÖÁö¸¸
ºÒÇàÇÏ°Ôµµ(¾Æ½Ã´Ù½ÃÇÇ) System.setProperties()´Â
AppletÀÇ Security¿¡ °É¸³´Ï´Ù. AppletÀÌ À¥ºê¶ó¿ìÁ®ÀÇ
JVMÀÌ properties¸¦ º¯°æÇÒ ¼ö ¾ø´Ù´Â °ÅÁÒ..
°á±¹, HotJava³ª, Appletviewer¿¡¼­¸¸ °¡´ÉÇÕ´Ï´Ù.






´ÙÀ½ ±Ûµé:



À̾ ±Û¿Ã¸®±â(´äÇϱâ)

À̸§:
E-Mail:
Á¦¸ñ:
³»¿ë:
HTML ÅÂ±× Æ÷ÇÔ ¿©ºÎ: HTML ¹®¼­ÀÏ °æ¿ì üũ
°ü·Ã URL(¼±ÅÃ):
URL Á¦¸ñ(¼±ÅÃ):
°ü·Ã À̹ÌÁö URL:


[ ´ÙÀ½ ±Ûµé ] [ À̾ ±Û¿Ã¸®±â(´äÇϱâ) ] [ ÀÚ¹Ù ¹¯°í ´äÇϱâ ]