This documentation is not maintained. Please refer to doc.castsoftware.com/technologies to find the latest updates.

Summary: This document provides information about the extension providing EJB (Enterprise Java Bean) support for interactions between Interfaces and Beans in Java code.

Extension ID

com.castsoftware.ejb

What's new?

Please see EJB - 1.0 - Release Notes for more information.

Description

This extension provides support for EJB (Enterprise Java Beans).

In what situation should you install this extension?

If your JEE application contains source code which uses EJB and you want to view these object types and their links with other objects, then you should install this extension. The main purpose of this extension is to enable linking between matching methods of Java Remote Interfaces to Bean Java Classes based on information provided in the ejb-jar.xml deployment descriptor file or via annotations.

Supported EJB releases

EJB ≤ 2.x (via deployment descriptor ejb-jar.xml )(tick)

This extension handles links between Java Remote Interfaces to Beans operated by the ejb-jar.xml <session> block. All .xml file ending with ejb-jar.xml are analyzed: please see the following non-exhaustive list of supported filenames for the ejb-jar.xml file:

  • orion-ejb-jar.xml
  • weblogic-ejb-jar.xml
  • sun-ejb-jar.xml
  • ibm-ejb-jar.xml
EJB  3.x (via annotations)(tick)-

Function Point, Quality and Sizing support

Feature

Supported?

Comments

Function Points
(transactions)

(tick)Indicates whether the extension provides support for OMG Function Point counting and Transaction Risk Index.
Quality and Sizing(error)Indicates whether the extension can measure size and whether a minimum set of Quality Rules exist.

AIP Core compatibility

CAST AIP release

Supported

8.3.x(tick)

Supported DBMS servers

DBMS

Supported

CAST Storage Service / PostgreSQL(tick)

Prerequisites

(tick)

An installation of any compatible release of AIP Core (see table above)

Download and installation instructions

For JEE applications using Enterprise Java Beans (EJB), the extension will be automatically installed by CAST Console:

What results can you expect?

Supported packageSupported API Methods
javax.ejb.*

javax.ejb.Remote

javax.ejb.Stateless

javax.ejb.Stateful

javax.ejb.EJBObject

javax.ejb.SessionBean

jakarta.ejb.*

jakarta.ejb.Remote

jakarta.ejb.Stateless

jakarta.ejb.Stateful

jakarta.ejb.EJBObject

jakarta.ejb.SessionBean

Basic support for Remote to Bean communication via the ejb-jar.xml deployment descriptor file (EJB ≤ 2.x)

Given the following ejb-jar.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
  <display-name>MyEJB </display-name>
  <enterprise-beans>
		<session id="MyFacade">
			<ejb-name>MyFacade</ejb-name>
			<home>*.MyFacadeHome</home>
			<remote>*.MyFacade</remote>
			<ejb-class>*.MyFacadeBean</ejb-class>
			<session-type>Stateless</session-type>
			<transaction-type>Bean</transaction-type>
		</session>
	</enterprise-beans>
  <ejb-client-jar>AWDControllerEJBClient.jar</ejb-client-jar> 
 </ejb-jar>

Assuming that the java interface *.MyFacade and the java class *.MyFacadeBean are declared correctly, the extension will produce callLink links between matching methods as follows: 

Click to enlarge

Basic support for Remote to Bean communication via annotations (EJB  3.x)


Case 1: When both the Interface and Class are annotated

Given the following code snippets from the annotated interface :

package com.tuto.ejb;
import java.util.Map;
import javax.ejb.Remote;

@Remote
public interface ExampleService {
	public String greet(String name);

	public Map<Object, Object> getSystemProperties();
}

And the annotated class:

package com.tuto.ejb;
import java.util.HashMap;
import java.util.Map;
import javax.ejb.Stateless;


@Stateless
public class ExampleServiceImpl implements ExampleService {

	@Override
	public String greet(String name) {
		return "Hello " + name + "!";
	}

	@Override
	public Map<Object, Object> getSystemProperties() {
		return new HashMap<>(System.getProperties());
	}
}

...the extension will create the following callLink:

Case 2: When only the class is annotated

Given the following code snippets from the annotated interface:

package com.tuto.ejb;
import java.util.Map;

public interface ExampleService2 {
	public String greet(String name);

	public Map<Object, Object> getSystemProperties();

	public String greet_toto(String name);
}

And the annotated class:

package com.tuto.ejb;
import java.util.HashMap;
import java.util.Map;
import javax.ejb.Stateless;
import javax.ejb.Remote;

@Remote(ExampleService2.class)
@Stateless
public class ExampleServiceImpl2 implements ExampleService2 {

	@Override
	public String greet(String name) {
		return "Hello " + name + "!";
	}

	@Override
	public Map<Object, Object> getSystemProperties() {
		return new HashMap<>(System.getProperties());
	}

	@Override
	public String greet_toto(String name) {
		return "Hello Toto !";
	}

}

...the extension will create the following callLink:

Case 3: Extension of the Remote Interface with the business logic

Following the same pattern as in case 2, except that methods are declared in an inherited interface of the Remote Interface: