• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

no security manager no dynamic loading

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you ,
I was suspecting it (for the security manager) but I was not completly sure..
Thanks again
- Lydie
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic