Spawning threads from within a UnicastRemoteObject

I have a question regarding spawning threads from within a class that extends UnicastRemoteObject. Would it be okay to spawn new thread(s) in the constructor/ remote methods of the class that extends UnicastRemoteObject .? Are there any pitfalls to doing so? Is it against the suggested practice of writing RMI server code?

rajkumar

[345 byte] By [rajk75a] at [2007-10-3 4:40:38]
# 1

You can do anything you like in the Class that extends URO.

The classic problem of doing anything within a constructor is that the object under construction may not be available to the threads you are spawning. That is, since the object is not fully constructed, any fields the new threads need may not be available. There have been discussions on this subject in the forums before. You might give a look and see.

cooper6a at 2007-7-14 22:44:39 > top of Java-index,Core,Core APIs...