*
The moose likes EJB and other Java EE Technologies and the fly likes is RMI supporting clustered Environment? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "is RMI supporting clustered Environment?" Watch "is RMI supporting clustered Environment?" New topic
Author

is RMI supporting clustered Environment?

Kaleeswaran Karuppasamy
Ranch Hand

Joined: Jul 19, 2007
Posts: 154
I want to develop the code for file sending and downloading using socket programming.i decided to use socket programming inside EJB ,but most of them telling dont use socket programming inside EJB business method becouse we are violating EJB specification.same time i want to follow some folder structure in server machine for file sending and receiving.

Can i use RMI for this one?

is RMI Supporting clusterd environment?
[ June 10, 2008: Message edited by: Kalees Waran ]

Judge a man by his questions rather than his answers --Voltaire
SCJP 1.5 97%
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Kalees,

Can i use RMI for this one?

I think, you can! In short with RMI you can do everything you could do with "normal" Java code except that it's possible to call methods on objects in a remote JVM, too. With the current JDK implementation there's even nothing special in the code besides opening the server and client for RMI communication. But it would be a lot more complicated with sockets.

is RMI Supporting clusterd environment?

The question is: what exactly is a clustered environment? As I already said RMI is working across JVMs (possibly on distributed hosts). So from this point you can obviously use it on multiple hosts in a clustered environment.
What RMI doesn't have is the concept of sessions or session migrating as in the web tier. To answer this question properly we should know some more details about what you're trying to achieve

Marco
Kaleeswaran Karuppasamy
Ranch Hand

Joined: Jul 19, 2007
Posts: 154
thank you for reply

what my question is suppose i used RMI to create server socket ,through this socket connection i want to send or download the file from particular machine(ip addrees which i was given).later i deployed it in clustered environment.i mensioned ip address of node1 becouse i keep particular folder structure in node one machine.in clusterd environment my request forwareded into node 2 that machine there no possible to have the file and folder structure.

can we restrict particular bean call particular machine ? or else how we do folder structure replication in from node 1 to node 2..
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

What I can see from your description of the problem is, that it's not really the socket/RMI connections which are difficult. The real problem is, that you need to maintain a replicated file system or a way to know what files and directories are located on which machine. Is this correct?

Because I don't know your project infrastructure, exact requirements and budget etc., I can only give you some suggestions what I think about it.

1.) If it's possible just use a central file server. Do you really need to distribute files across multiple file systems? Is it for performance reasons? There are also some distributed file systems which can be expanded over multiple hosts but behave like a single file system on one machine. So you would have the same view on it from every EJB in every JVM on every node.

2.) If you have to use multiple file systems (on multiple hosts), you'll most probably have to maintain one central data structure to keep track of where your files are stored. You could use a database system to keep a mapping between files/filenames(hashes) and physical locations. Of course you could be interested in any kind of mapping but I guess you'll have some kind of mapping in order to locate and retrieve the stored files later.

3.) Depending on the size and number of files you can perhaps simply use some kind of in-memory data structure instead of a DBMS.

4.) If you need a real cluster with transparent access to all data distributed across several hosts and JVMs than perhaps the terracotta cluster could be an option. But this seems to be a bit overkill for what you've described.

I hope this helps a little in finding a decision

Marco
Kaleeswaran Karuppasamy
Ranch Hand

Joined: Jul 19, 2007
Posts: 154
i find google i dont get anything about file server.can i get details about any open source file server?
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

With "file server" I didn't think of something specific to Java!

I just talked about a machine with a file system accessible via network. I'm pretty sure you know this from MS Windows shares or Linux NFS shares which you can easily access from your client machine almost as if they were a local hard disk in your computer

If you'd use something like this you could just mount the file system on the machines running your EJB code and access it transparently from all machines like a local hard disk. For this you wouldn't even have to use special code in your application. The remote file systems are managed on the OS level and therefore are accessible via ordinary file I/O libraries in Java.

But as I already mentioned this depends on your needs! Locking or concurrent access _COULD_ be an issue. If you use a non-distributed network file system on a single machine it could become a performance bottleneck etc. You should also take care about possible collisions of filenames and directory structures if you share a common file system across multiple machines, too. There's surely not only one best concept for distributed applications of any kind. You have to decide what you really need and which approach will be most sufficient for your requirements. There is a wide range of possible solutions from a small central server machine with open source (Linux, BSD, ...) ranging to a highly scalable (and expensive) SAN (storage area network).

Marco
Kaleeswaran Karuppasamy
Ranch Hand

Joined: Jul 19, 2007
Posts: 154
i am working medical transcription domain and we are handling all file in the particular folder structure and there is no chance for naming collision.we maintain some folder structure which is only accessible by allocated member.
in my point of view which adopt my requirement.

thank you so much to your detailed reply
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: is RMI supporting clustered Environment?
 
Similar Threads
Servlet push to Applet
Java Project but not Web Project...
difference between socket programming and rmi in java??
rmi with big object?
is EJB(stateful and stateles) and JMS connection oriented(TCP/IP) or connectionless?