advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

Tutorials : An Introduction to Remote Method Activation (ROA) :

Persistent And non-Persistent References To Remote Objects

Perhaps you already know that remote objects based on UnicastRemoteObject contain references to themselves. You may also know that a client can get a reference to a remote object only if that object is running inside a JVM. This reference is non-persistent because its life cycle is equal to the life cycle of the referenced object.

In the case of activable objects, the problem is radically different, because a client can receive a reference to an activable object even if that object is not currently running. This reference is a persistent because its life cycle is independent from the life cycle of the referenced object. As a consequence, you can register an activable object to the RMI registry even if it wasn't instantiated.

Note: An activable object is not running when it hasn't been "built", its JVM was closed, it was collected by the Garbage Collector, etc.

An important difference between activatable remote objects and simple remote objects is that you can make a remote reference to an activable remote object even if the activable remote object is not running. You may ask: "How can I call the remote methods of a remote object if it is not running?What should I do in this case ?"

First of all, it's important to know that the client is acting in the same exact way as it would in the case of a RMI application based on simple remote objects. The client receives a stub object that can be used for calling remote methods. The bulk of the work is done by the activation system that listens for any remote method call and resolves the call to the client's benefit. An activable remote object becomes active when the client makes its first remote method call (this is known as "lazy" activation). In other words, when the activation system intercepts the first remote method call, it checks to see if the activable remote object is active. If it is not, then the activation system activates it. During the activation process, the activation system ensures that the activable remote object has a JVM and it uses the activable remote object information (provided in the moment of registration in the activation system) to activate the object.

After the activable remote object is successfully activated, the process is the same as that of a simple RMI application. This happens until the activable remote object is deactivated. If the activable remote object is not running, the RMI application supports other remote methods calls—only after it's been reactivated by the activation system. This demonstrates the power of persistent references—their usefulness extends beyond the life of the referenced activable remote objects.

How Does an Activable Remote Object Work?

Because of ROA's complexity, it's fundamental to have a basic idea about what steps an activable remote object follows—from the moment of a remote method call to the moment when the activable remote object is ready to deal the respective call.

This chain of events is called "activation protocol." Figure 1 is a graphical representation of this chain of events:

There are seven steps involved in activation protocol (note: the following explanation presumes that the client already contains the stub object and that the activable remote object is not active):

  1. The client uses its stub to call a remote method. The stub checks for an active (or, "live") reference to the corresponding remote object. If it gets a null (meaning, there is no such reference), it will contact the activator. The activator, which performs two tasks: first, it is a database that maps the activation identifiers to the information needed for activation.; second, it manages the JVM's currently running (it also has the power to create JVMs for activation groups). Step 1 ends when the stub passes the activation identifier to the activator for the desired activable remote object.
  2. The activator uses the activation identifier it has received from the stub to access the activation descriptor associated with the activable remote object. The activation descriptor was created when the activable remote object was registered to the activation system and it contains information about it's parent activable remote object.
  3. The activator determines whether the activable remote object belongs to any existing activation group. To do this, the activator uses the activation descriptor which in turn uses the group descriptor. Groups descriptors contain information necessary to create/recreate a group as well as information about system properties and options used to run the JVM. If the activator determines that the activable remote object belongs to an existing activation group, it will pass the activation request to that group.
  4. If the activable remote object does not belong to an existing activation group, the group descriptor will create new group especially for this object. The activator will also provide a JVM for the new group.
  5. The activation request is now passed to the new group, whichuses the activation descriptor associated to this activable remote object to load the corresponding class and to create an instance of it using a special constructor, theactivation/reactivation constructor. One of the activation/reactivation constructor arguments is the activation descriptor.
  6. After the activation procedure is ends, the activation group returns a reference to the active remote object to the activator.
  7. The last word belongs to the activator which registers the reference received from the activation group, associates to this reference the corresponding activation identifier, and returns this reference to the stub. Now the stub finally has a "live" reference with which is can call the remote methods for that activable remote object.

Home / Articles / An Introduction to Remote Method Activation (ROA) / 1 / 2 / Next Page

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

 Avaya DevConnect Center
 Service Component Architecture/Service Data Objects Solution Center
 Intel Go Parallel Portal
 Internet.com eBook Library
 IBM Software Construction Toolbox
 Microsoft RIA Development Center
 Destination .NET
XML error: not well-formed (invalid token) at line 53
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

Red Hat Takes on HPC Market, Microsoft
Python's New Release Bridges the Gap
No Flash Seen on iPhone Horizon
Apple Yields to Complaints Over iPhone NDA
Microsoft Shows Some Ankle With Visual Studio
Gentoo Linux Cancels Distribution
It's Official: Windows 7 at PDC, WinHEC
Oracle Keeps Building on Spoils From BEA
Intel, Oracle Head For 'The Cloud'
Oracle Focuses on Grid, Developer Tools

eCryptfs: Single-File Encryption in Linux
CCXML in Action: A CCXML Auto Attendant
Ballmer: Current Woes Won't Halt Tech, Microsoft
Microsoft Uses VMworld to Hype Its Hypervisor
Microsoft Charges Ahead in Virtualization
Microsoft Shows Some Ankle With Visual Studio
Top 5 Reasons to Adopt SQL Server 2008
Make Application Development Easy With Software Plus Services
SharePoint Applied: 10 Things You Wish They Had Told You?Part 2
Introducing Zend_Search_Lucene

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES