File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Local and remote server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Local and remote server" Watch "Local and remote server" New topic
Author

Local and remote server

Sumesh Aravindan
Greenhorn

Joined: Jul 09, 2002
Posts: 14
Hi,
I want to make sure that what i have understood is right.
When we say local mode, it means that the client will access the server files directly.
If it's in network mode, the client will access the server using RMI. ie, the client will communicate to the server through the stubs that were generated for the remote object.
Thanks,
Sumesh
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451

Originally posted by sumesh_aravind:
When we say local mode, it means that the client will access the server files directly.

Well the the client will access a Data object, through an interface, which is bound to a local file.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
Originally posted by Michael Morris:

Well the the client will access a Data object, through an interface, which is bound to a local file.
Hope this helps,
Michael Morris

Hi,
I have one doubt. What will be the case when the client is not running on the same machine/JVM as the server(where the database actually resides)? Is that possible to run the databse locally if the client machine is different from the server.
Thanks,
Padmaja
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Padmaja,

What will be the case when the client is not running on the same machine/JVM as the server(where the database actually resides)? Is that possible to run the databse locally if the client machine is different from the server.

That would not be local mode, but remote mode. So in that case you would have to use either RMI or object serialization over Sockets to connect to the public Data interface. Now, you could connect to a file on a different network node in local mode for example "www.mydomain.com/~myaccount/sucertify/db.db" but that would be in the same VM.
Hope this helps,
Michael Morris
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
Originally posted by Michael Morris:
Now, you could connect to a file on a different network node in local mode for example "www.mydomain.com/~myaccount/sucertify/db.db" but that would be in the same VM.

Hi Michael,
Can you please explain this a little bit more??
Thanks,
Padmaja
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Padmaja,

Can you please explain this a little bit more??

For example:

Both db1 and db2 above are objects in the same VM. The only difference is that they just happen to be using different files on different machines for their backing store. db1's backing file just happens to be on a machine with a DNS name of "www.mydomain.com".
Hope this helps,
Michael Morris
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
Hi Maichael,
Thank you so much.. Now its clear.
Padmaja
Sumesh Aravindan
Greenhorn

Joined: Jul 09, 2002
Posts: 14
Hi Maichael ,
So basically, local mode means that I am accessing the server files using an interface defined specially for the client in non-networked mode(ie,without using RMI).
does it mean that, I don't have to start any server in local mode?
Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
The way I interpreted it was ...
LocalData implements DataAccess extends Data - so there is a direct, no network, connection to the database.
RemoteData implements DataAccess, Remote and has a reference to the Data on the server - so this connection goes over the network to talk to the database
Both ways the client is dealing with DataAccess objects to talk to the database, so it should not matter which mode it is in to write the client code...


scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi sumesh,

So basically, local mode means that I am accessing the server files using an interface defined specially for the client in non-networked mode(ie,without using RMI).

You could do it that way, but I agree with Nate that it is better to design a single interface for both local and remote modes, so the client doesn't care whether he's connected to the database locally or remotely.
Hope this helps,
Michael Morris
Sumesh Aravindan
Greenhorn

Joined: Jul 09, 2002
Posts: 14
Thanks Michael and Nate!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Local and remote server