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
肺癌是目前全球范围内最常见的癌症类型,同时也是癌症死亡的主要原因,特别是在工业化国家。肺癌的发生过程可能追溯到数年甚至数十年以前。不幸的是,超过一半的肺癌患者在晚期阶段才被诊断出病情,而在更加可治疗的...
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 ...
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 ...
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...
vc studio2010 +sqlseveral 2008 破解版
根据提供的文件信息,我们可以推断出这是一本关于多变量微积分的教科书,名为《Calculus of Several Variables》,作者是Serge Lang,属于Springer出版的“Undergraduate Texts in Mathematics”系列之一。...
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 ...
General state-space Markov chain theory has seen several developments that have made it both more accessible and more powerful to the general statistician. Markov Chain Monte Carlo in Practice ...
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 ...
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 ...
In addition, the book highlights several key topics in both theoretical and practical aspects of networking. These include wireless sensor networks, performance of TCP connections in mobile networks,...