• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no security manager no dynamic loading

 
lydie prevost
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi eveybody,
I am reading alll those "Must" agin and again nad I have more and more doubt each time.

I created a Contractor class to holds the record number and the data.
The Contractor class implements serializable.

Does that imply that I am doing some dynamic loading of the class?
And does that mean I need a security manager?

My assignment mention no security manger must be needed and no dynamic downloading but ....

I understood that if the client and the server are on the same machine, there is no need for a security manager to download the class ....
Can someone help me clarify this???

Should I transform my Contractor class in a String[] class?

Aother question:
I have my remote interface extending Remote and DatabaseClient
My database remote implementation extends UnicastRemoteObject and implements my remotee interface

So This implies that all my methods in my DatabaseClient must throw RemoteException.
Is this right???
So Why is it not the case in Max book?
His interface DBClient has methods which do not throw RemoteException.
I don't understand why???

Can someone help me with that too?
Thank you,
Lydie
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lydie
I created a Contractor class to holds the record number and the data.
The Contractor class implements serializable.

Does that imply that I am doing some dynamic loading of the class?
And does that mean I need a security manager?
Normally you will only be dynamically loading classes if you are using RMI and your client application does not have access to the server stubs - in this case they will be dynamically downloaded from the server. Dynamically loading the stubs in this manner may require a security manager.

Simply having serializable classes does not imply dynamic loading of classes nor does it necessarily require use of a security manager.

(Simple test - if you do not explicitly create a security manager and your code works in client-server mode, then you are safe )

So This implies that all my methods in my DatabaseClient must throw RemoteException.
Is this right???
So Why is it not the case in Max book?
His interface DBClient has methods which do not throw RemoteException.
I don't understand why???
Max's book (and mine as well as most other similar books) must be different from the real assignment in certain respects (otherwise we would give away too much of the solution). One of the ways that Max's assignment is different is that RemoteException's parent Exception (IOException) is thrown - since the remote methods are all declared to throw IOException they do not need to declare that they throw RemoteException.

Is this clear? If not, let me know.

Regards, Andrew
 
lydie prevost
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you ,
I was suspecting it (for the security manager) but I was not completly sure..
Thanks again
- Lydie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic