Solved

Load balancing in rmi

Posted on 2000-04-24
3
450 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
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…

947 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now