?
Solved

Load balancing in rmi

Posted on 2000-04-24
3
Medium Priority
?
463 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 200 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month13 days, 16 hours left to enroll

800 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