An in-depth understanding of Java technology EJB call principle Analysis Two

Source: Internet
Author: User
Tags abstract stub

A stub class ((Hello Bean)) of the WebLogic implementation class of the Home interface _homeimpl_wlstub (dynamically generated bytecode when deployed)

The Skeleton Class ((Hello Bean)) of the WebLogic implementation class of the Home interface _homeimpl_wlskeleton (dynamically generating bytecode when deployed)

Remote interface: Hello (user written)

Remote interface WebLogic Implementation class ((Hello Bean)) _eoimpl (EJBC generated)

A stub class ((Hello Bean)) of the WebLogic implementation class of the remote interface _eoimpl_wlstub (dynamically generated bytecode when deployed)

The Skeleton Class ((Hello Bean)) of the WebLogic implementation class of the remote interface _eoimpl_wlskeleton (dynamically generating bytecode when deployed)

The client only needs the two files Hello.class and Hellohome.class.

((Hello home)) Home = (home)

((Portable Remote Object). Narrow (Ctx.lookup ("Hello"),

((Hello Home)). Class);

This line of code is to get the home interface from Jndi, but keep in mind! The interface is abstract, so what exactly is the object instance of the Home object? Very simply, with the ToString () output to see that, the following line is the output result:

((Hello Bean)) _homeimpl_wlstub@18c458

This shows that the home this is actually an instance of the Hellobean_homeimpl_wlstub class by looking up the object obtained from the server's Jndi tree.

Next client code:

Hello h = home.create ()

Similarly, hello is just an abstract interface, so what is H object? Print:

((Hello Bean)) _eoimpl_wlstub@8fa0d1

The original is an object instance of Hellobean_eoimpl_wlstub.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.