Where do clients get definitions for remote classes that have not been added to registry?

前端 未结 2 850
感情败类
感情败类 2021-01-22 23:45

Ive managed to create an RMI application that does what i need it to do quite succesfully, but im having a bit of trouble getting my head around where client obtains definitions

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-23 00:32

    If you use new to create new instances of the same type (say, T) as rObj, then of course the Java compiler knew the definition of T, and your application also knows it at runtime. In this case, no RMI is involved at all.

    But maybe I misunderstood your question? How exactly do you "freely create instances of rObj"?

    Update: I'm eating my words here, of course being able to compile the file, and having the class available on the classpath at runtime or two different issues. Since you were not mentioning the classpath at all, I was assuming you'd somehow ended up having the classes on the client-side anyway.

提交回复
热议问题