Solved

Load balancing in rmi

Posted on 2000-04-24
3
453 Views
Last Modified: 2013-12-29
Hello,
Suppose a rmi server is running and an object is instantiaated. now clients over internet can invoke methods on that object. when number of hits is low then it's ok. but when it's huge things may not work as desired. so i want to load balance. may be, more than one rmi server will be running and some one will decide which server to contact to. Is there any statnadard method to do it? any tool which can help it?
0
Comment
Question by:dipak_kr_ghosh
  • 2
3 Comments
 
LVL 3

Expert Comment

by:ovidiucraciun
ID: 2743273
You can do that on your server.
You build an dispacther server that only forward messages to child servers that do the task. When last child server created is to busy then it will create another one (with another thread of execution of course) and schedule the task to the new child server. And so on ...
0
 

Expert Comment

by:sajal_s
ID: 2743331
In Java1.2 one option is there i.e
Step 1:
Make the appropriate imports in the implementation class
import java.rmi.*;
import java.rmi.activation.*;
Step 2:
Extend your class from java.rmi.activation.Activatable

public class ActivatableImplementation extends Activatable
    implements examples.activation.MyRemoteInterface {

Step 3:
Declare a two-argument constructor in the implementation class
public ActivatableImplementation(ActivationID id, MarshalledObject data)
    throws RemoteException {
    // Register the object with the activation system
    // then export it on an anonymous port
    super(id, 0);
}

Step 4:
Implement the remote interface method(s)

public Object callMeRemotely() throws RemoteException {
    return "Success";
}



run rmid (rmi deamon) on server machine

This process uses the concept of lazy activation .
0
 

Accepted Solution

by:
sajal_s earned 100 total points
ID: 2743333
In Java1.2 one option is there i.e
Step 1:
Make the appropriate imports in the implementation class
import java.rmi.*;
import java.rmi.activation.*;
Step 2:
Extend your class from java.rmi.activation.Activatable

public class ActivatableImplementation extends Activatable
    implements examples.activation.MyRemoteInterface {

Step 3:
Declare a two-argument constructor in the implementation class
public ActivatableImplementation(ActivationID id, MarshalledObject data)
    throws RemoteException {
    // Register the object with the activation system
    // then export it on an anonymous port
    super(id, 0);
}

Step 4:
Implement the remote interface method(s)

public Object callMeRemotely() throws RemoteException {
    return "Success";
}



run rmid (rmi deamon) on server machine

This process uses the concept of lazy activation .


0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question