RMI: Java Remote Method Invocation
RMI is the Java language's native way to communicate between distributed objects, such as two different objects running on different machines. It has some interestiong features not available in RMI-IIOP, such as distributed garbage collection, object activation, and downloadable class files. But EJB and J2EE mandate that you use RMI-IIOP, not RMI. Any object that implements java.rmi.Remote is a remote object and is callable form a differnet Java Virtual Machine.
ROMI-IIOP: Java Remote Method Invocation over the Internet Inter-ORB Protocal
RMI-IIOP is an extension of RMI that can be used for CORBA integration. It is the official API that we use in J2EE. RMI-IIOP makes extensive use of the comcept of separating the interface of code form its implementation. All networking code you write is applied to interfaces, not implementation. It is impossible to perform a remote invocation derectly on an object implementation. You can operate solely on the interface to that object's class. Therefore, when using RMI-IIOP, you must build a custom interface, called a remote interface. This remote interface should extend the interface java.rmi.Remote. Your interface should hava within it a copy of each method your remote object express.
Client: interfaces, help classes, stubs
Local Client
Remote Client
Java RMI-IIOP based clients: use JNDI to look up objects, use JTA to control transactions
CORBA Clients: CORBA standard. Call EJB components using another language. Use CORBA Naming Service(Cos Naming) to look up objects. Use CORBA's object Transactiong Service(OTS) to control transactions.
How Client code works?
look up a home object => use the home object to create an EJB object => call business methods on the EJB object => remove the EJB object
We need way to publish the server and have the client locate the server. This process calles bootstrapping, is achieved via the JNDI.
JNDI: Java Naming and Directory Interface
The JNDI is a J2EE API that provide a standard interface for location users, machines, networks, objects, and services. JNDI is used in EJB, RMI-IIOP, JDBC, and more. JNDI is a system for Java-based clients to interact with naming and directory systems. It is a bridge over naming and directory services, which provides one common interface to dispareate directories.
The starting point of exporing a namespace is called an initial context using an initial context factory to acquire it. Initial context factories are used bootstrapping , or jumping-starting, your naming and directory service perations. You use an initial context factory as a bootstrapping mechanism for identifying an initial naming system. When you acquire an initial context, you must supply the necessary information for JNDI to qcquire that initial context. For example, if you're trying to access a JNDI implementation that runs within a J2EE server, you might supply:
- The IP address of the J2EE server
- The port number that the J2EE server accepts
- The starting location within the JNDI tree
- Any username/password necessary to user the J2EE server
There are essentially two uses of JNDI with RMI-IIOP:
- An RMI-IIOP server first publishes itself to a JNDI tree using the JNDI API
- A client then uses JNDI to look up an RMI-IIOP server
分享到:
相关推荐
This comprehensive coverage would also be useful to developers in smaller organisations, who might be called upon to fill several normally distinct roles. What is special about this book? Wondering ...
Iterative Solution of Nonlinear Equations in Several Variables provides a survey of the theoretical results on systems of nonlinear equations in finite dimension and the major iterative methods for ...
Hormander.-.An.introduction.to.Complex.Analysis.in.Several.Variables
1.1 In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. a. What are two such problems? b. Can we ...
肺癌诊断标志物及其检测方法,林丽泉,张希,肺癌是世界上高发病率和高死亡率的癌症。学者们研究了大量用于肺癌筛选、诊断、预后、临床实验、流行病学观察和分析的标志物。这
The concluding chapters explore several complex variables and oscillatory integrals in Fourier analysis, and illustrate applications to such diverse areas as nonlinear dispersion equations and the ...
For the past several years, I’ve been teaching a class on “Topics in Information Security.” Each time I taught this course, I’d sneak in a few more machine learning topics. For the past couple of ...
Calculus_of_Several_Variables.pdf
Docker-in-Action.pdf In 2011, I started working at Amazon.com. In that first week my life was changed as I learned how to use their internal build, dependency modeling, and deployment tool- ing. This ...
In the first edition, models initially developed to describe wave propagation in porous media saturated by heavy fluids are used to predict the acoustical performances of air saturated sound absorbing...
Concurrent applications run faster because they spread work across processor cores, performing several tasks at the same time. Modern tools and techniques on the .NET platform, including parallel ...
vc studio2010 +sqlseveral 2008 破解版
Besides Lie and Klein, the names of Bernhard Riemann, Henri Poincare ́, Hermann Weyl, E ́lie Cartan, Emmy Noether and other major mathematicians appear at several places in this volume.
Building on the foundations of its predecessor volume, Matrix Analysis, this book treats in detail several topics with important applications and of special mathematical interest in matrix theory not ...
Building on the foundations of its predecessor volume, Matrix Analysis, this book treats in detail several topics in matrix theory not included in the previous volume, but with important applications ...
require changes to several places in wxPython code to add the support for the enhancement or fix to wxPython. When it reached many tens of thousands of lines of code it became very awkward and ...
Next, he provides practical and versatile examples, which combine approaches to solve problems in several different areas, including complex scenarios like concurrency and high-performance ...
complex and faces several challenges in terms of software engineering and artificial intelligence aspects. This paper presents a computational model for developing SWBES focusing on the problem of how...
Optimization models play an increasingly important role in flnancial decisions. Many computational flnance problems ranging from asset allocation to risk management, from option pricing to model ...