Noah Le

+ Follow
since Aug 12, 2003
Merit badge: grant badges
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Noah Le

Hi, for a remote connection, I want to have just one Data instance running on the server that all remote clients get a reference to. Can anyone advise me the best way to do this? Right now I'm just creating new instances of Data every time, and I don't want that.
Off the top of my head, I'm thinking about creating a new class (like DBServer) that has a static Data member (let's call it 'db'). The main() method will instantiate db as a new Data object. Then I will have a getConnection() method that returns db.
And then in my DBAdapter class, I will use DBServer.getConnection() to get my reference. Does any of this sound ok? But I'm not sure how to get DBServer to persist. Should I include an infinite loop in the main() method so that it never dies? Does that violate any principles?
Please help! I'd really appreciate it!
you can cast 0x8000 to a short and use a file channel or a stream to write it to output. or you could use RandomAccessFile's writeShort(int) method.
Does this look ok?
In Suncertify.db:
  • interface DB - provided by Sun
  • class Data implements DB - provided by Sun
  • interface DataClient - will have all the methods of DB, except lock/unlock
  • class DataAdapter implements DataClient - threadsafe wrapper class for Data. holds an internal reference to a Data object, wraps modification calls between lock and unlock calls.

  • In Suncertify.remote:
  • interface DataRemote extends DataClient, Remote - the remote object
  • class DataRemoteImpl extends UnicastRemoteObject, implements DataRemote
  • class DataConnector - client-side class that determines whether to return a new DataAdapter instance (for local mode), or a reference to the existing remote object (for network mode)
  • class DataRemoteObjReg - creates and registers the remote object on the server.

  • Does this look ok? I've never done RMI before, or anything network-related for that matter. It's kinda confusing for me.
    [ August 19, 2003: Message edited by: Noah Le ]
    I can't remember the term. Can anyone tell me? It's when you take 2 sets of data and only keep data that's in both sets. also, does Java have a function that performs this action?
    19 years ago