Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk3 min

EJB Local Interface: Meaning, Rules, and Legacy Differences

An EJB local interface exposes a session bean to clients in the same JVM. Modern local business interfaces differ from legacy interfaces that extend EJBLocalObject.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An EJB local interface is a session bean’s local client view: it defines business methods that a client in the same Java Virtual Machine (JVM) can call. In modern Enterprise Beans, this usually means an ordinary Java business interface designated with @Local when needed. Older EJB code uses “local interface” for a different, legacy interface that extends EJBLocalObject.

What does “EJB local interface” mean?

In modern Enterprise Beans terminology, a local business interface is a Java interface that exposes the business methods a session bean makes available to local clients. A client calls the bean through this view while both are collocated in the same JVM. The Jakarta Enterprise Beans specification states that access through a local client view “requires the collocation in the same JVM” of the client and bean (Jakarta Enterprise Beans 4.0, Core Features, §3.2.2).

As an Amazon Associate I earn from qualifying purchases.

“Local” therefore does not simply mean that the client is on the same network or hosted by the same application server. The defining requirement is JVM collocation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Modern local business interface versus legacy EJB local interface

The term varies with the age of the code. EJB 3.0 and later support a local business interface that does not need to extend EJBLocalObject. In the older EJB 2.1 client view, the local component interface extends EJBLocalObject and is used with a local home interface. These are related ways for local clients to access a bean, but they are not the same interface model. The Jakarta EE 8 API documentation for EJBLocalObject distinguishes the legacy form from the later business-interface approach.

View or model Interface form What to know
Modern local business interface (EJB 3.0 and later) Ordinary Java business interface Does not have to extend EJBLocalObject.
Legacy local component interface (EJB 2.1 and earlier) Extends EJBLocalObject; used with a local home interface Older client-view model retained for compatibility.

How a session bean declares a local business interface

The jakarta.ejb.Local annotation marks an interface as a local business interface, or can be placed on the bean class to designate its local business interfaces. The Jakarta EE Platform API documentation for @Local describes the annotation and cases where it is required.

A business interface can be local by default when neither the interface nor bean class designates it with @Local or @Remote, according to the Jakarta EE tutorial. Do not assume inference will resolve every bean’s views: explicit designation is required in documented cases such as multiple interfaces or an ambiguous no-interface view.

A local client can obtain access through dependency injection or a JNDI lookup. A no-interface view is another local client view, but it is not a local business interface: it exposes eligible public methods of the bean implementation class.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What local access means for calls and deployment

  • Same JVM: the caller and bean must be collocated in the same JVM to use the local client view.
  • Application packaging: portable required support covers local clients packaged in the same application as the bean. Access from a different application is optional and vendor-specific, even if both applications run on one server.
  • Object passing: local calls pass arguments and results by reference. Caller and bean may therefore observe shared object state, so mutable objects require care.

Remote views differ in these respects: they are location-independent and pass arguments and results by value, as described in the Enterprise Beans specification.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does an EJB local interface extend EJBLocalObject?

Only the legacy EJB 2.1-style local component interface has that requirement. A modern EJB 3.0-or-later local business interface is an ordinary business interface and need not extend EJBLocalObject. When reading older examples, check whether “local interface” refers to the legacy component interface or the modern local business interface.

Best Value
Sams Teach Yourself Ejb in 21 Days
  • Used Book in Good Condition

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.