JEE Analyzer - 2.0

Extension ID

com.castsoftware.jee

What’s new?

See JEE Analyzer - 2.0 - Release Notes .

Isofunctionality

This release of the extension is based on the 1.3.10-funcrel release. The following support provided in previous releases of the extension has been removed from this release (and all future releases):

  • The web client part of an application is no longer analyzed, specifically this means no analysis of JavaScript files nor the JavaScript part of JSP pages. Analysis of this code is instead handled by com.castsoftware.html5 .
  • Legacy environment profiles for Hibernate, Servlet, JSF and WBS have been removed.

Description

This extension provides support for analyzing applications built with JEE related technologies: objects and links between these objects are identified and Automated Function Point values are calculated. A set of JEE specific structural rules are also available with the extension.

Technology support

See Covered Technologies and also Technology support notes for additional information.

Function Point, Quality and Sizing support

Function Points (transactions) Quality and Sizing
✔️ ✔️

CAST Imaging Core compatibility

Operating System Supported
Linux ✔️

Dependencies with other extensions

Some extensions require the presence of other extensions in order to function correctly. The JEE Analyzer extension requires that the following other extensions are also installed:

Note that when using CAST Imaging Console to install the extension, any dependent extensions are automatically downloaded and installed for you. You do not need to do anything.

Download and installation instructions

For JEE applications, the extension will be automatically installed by CAST Imaging Console:

What analysis results can you expect?

Objects - Java

Icon MetaModel name
Generic Java Class
Generic Java Constructor
Generic Java Interface
Generic Java Method
Generic Java Type Parameter
Java Annotation Type
Java Annotation Type Method
Java Block
Java Class
Java Component
Java Constructor
Java Enum
Java Enum Item
Java Field
Java File
Java Import
Java Initializer
Java Instantiated Class
Java Instantiated Constructor
Java Instantiated Interface
Java Instantiated Method
Java Interface
Java Local Variable
Java Lambda Expression
Java Method
Java Package
Servlet
Servlet Mapping
Java Properties File
Java Property Mapping
J2EE XML File

Objects - JSP (Presentation)

Icon MetaModel name
J2EE Scoped Bean
Servlet Attributes Scope
Bean Property
JSP EL Function
JSP File Template
J2EE XML Object
JSP Custom Tag
JSP Custom Tag Attribute
JSP Custom Tag Library
Xml Bean

Objects - Apache Struts

Icon MetaModel name
Struts Action / Common Struts Action
Struts Action Mapping
Struts Configuration File
Struts2 Configuration File
Struts Form Bean
Struts Forward
Struts Interceptor
Struts Interceptor Stack
Struts Package
Struts Result
Struts Validator
Validation
Validation Form Field
Validation Forms Set

Objects - STXX (Presentation)

Icon MetaModel name
STXX Pipeline
STXX Transform
STXX Transforms File

Objects - JPA (Persistence)

Icon MetaModel name
JPA Embeddable
JPA Embeddable Property
JPA Entity
JPA Entity Property
JPA Named Native Query
JPA Named Query
JPA ORM Configuration File
JPA Persistence Configuration File
JPA Persistence Unit
JPA SQL Result Set

Objects - EJB (Persistence)

Icon MetaModel name
Entity Java Bean
Message Driven Java Bean
Session Java Bean
Icon MetaModel name
Singleton Java Bean
Spring Bean
Spring Beans File
Spring Controller
Spring View
CDI Named Bean
Spring Batch Job
Spring Batch Step
Link type When is this type of link created? Example
MENTION This link is traced on following expressions (Callee always refers to a class or interface):
"instance of" operator

cast expression

class literal

this literal

class creation

array creation
- if (b instanceof A . class) ...

- A . this = 1;

- B b = (B) new A(1);

- B b [] = new A[5];
THROW, RAISE, CATCH These links are used to describe exception handling (Callee always refers to a class):

Throw link is traced on "throws" clause of method declaration towards exceptions possibly raised by the method.

Raise link is traced on "throw" statement towards type of the exception actually thrown by the method.

Catch link is traced on "try" statement towards type of the exception parameter declared in catch clause(s).
- void f () throws C1 {...}
- throw new Exception()

- try {...}
catch (Throwable e) {...)
RELY ON This link is used to describe typing. Caller uses callee to define its Java type. Callee always refers to a class or interface. - void f (A a) {...}
- A a [] = null;
ACCESS This link is used to describe run-time interactions. It may be enriched by the following sub-types:

Read

Write

Exec

Member

Array
- return x - (read)
- x = 1 - (write)

- x++ - (read and write)

- x[1] = 2 - (array not read)

- x[] = {1,2} - (read)

- f(1) - (exec)

- x.toString() - (member)

- x.f() - (member on x ; exec on f)

- x.y = 1 - (member on x ;write on y)
INHERIT This link is used to describe object hierarchy. It may be enriched by the following sub-types (Caller and callee always refer to classes or interfaces):

Extend:

class to super-class

interface to super-interface

Implement:

class to super-interface(s)

By extension the Inherit link is also used to describe method overriding as directly related to inheritance. In this case exclusive sub-types are available (Caller and callee always refer to methods):

Hide: for static methods;

Override: for instance methods; in addition link can be enriched by the Implement sub-type if overriding is from a non abstract overriding method to an abstract overridden one.
- class C1 extends C2 implements I
{...}
- interface I1 extends implements I2
{...}
USE This type is reserved for dynamic link resolution. It covers server side objects referencing:

Select

Insert

Update

Delete
-
PROTOTYPE This link is reserved for J2EE components' support and is used as follows (Caller and callee always refer to a component and to a class or interface):

Applet: between the applet component and its applet class.

-
Link Type Situation When is this type of link created?
USE TypLib
<!-- METADATA TYPE = "TypeLib" FILE = "TypLibFileName"-->
USE Applet
<APPLET CODE = "AppletCode" CODEBASE = "AppletCodeBase">
USE ActiveX through a variable
x = new ActiveXObject("A.B")
function f()
{
x.Method()

Use link between f and A.B

USE Dynamic data source
<OBJECT id = id_obj classid = "clsid:Sample"></OBJECT>
<A DATASRC=#id_obj datafld = "url" id=id_a>

Use link between id_a and id_obj

USE

Database object


<SCRIPT>
ExecuteSQL("select * from authors")
</SCRIPT>
USE MAP
<img src="images/cover.jpg" border=0 usemap="#covermap" ismap id=id_img>
<map name="covermap">
<area shape=rect href="whatis.htm" coords="0,0,315,198">
<area shape=rect href="signup.asp" coords="0,198,230,296">
<area shape=rect href="holdings.asp" coords="229,195,449,296">
<area shape=rect href="question.htm" coords="314,0,449,196">
</map>
MENTION Indicates the area in which the ActiveX is mentioned
function f()
{
return CreateObject("A.B")
}

Mention link between f and A.B

MENTION Indicates the area in which the class name is mentioned
function f()
{
return new g()
}

Mention link between f and g

INCLUDE Indicates the inclusion of a file
<SCRIPT LANGUAGE = "JavaScript" SRC = "inc.js">
</SCRIPT>
CALL Indicates a call to a file
<A HREF = "called_file.htm" ></A>
<SCRIPT LANGUAGE = JavaScript>
window.open("called_file.htm")
</SCRIPT>
CALL Indicates a function call
<SCRIPT>
function f()
{
return 1;
}
function g()
{
return f()
}
</SCRIPT>

Call link between g and f

ACCESS Indicates a access type link enters a property of an HTC component together with the associated PUT or GET function.
<PUBLIC:PROPERTY NAME="xmlData"
 ID="xmlDataID" 
GET="getxmlData" PUT="putxmlData"/>

ACCESS link between xmlData and the getxmlData and putxmlData functions.

ACCESS and
READ
Read only access to a file
<!--#FLASTMODE FILE = "accessed_file.htm">
ACCESS and
READ
Read only access to a variable
<SCRIPT>
function f()
{
y=x
}
</SCRIPT>

Read only access between f and x

ACCESS and
WRITE
Read and write access to a variable
<SCRIPT>
function f()
{
y=x
}
</SCRIPT>

Read and write access between f and y

ACCESS and PAGE_FORWARD Indicates a redirection. Only available for analyzed IIS applications. -
REFER Indicates that a variable refers to another variable
<SCRIPT>
x = new ActiveXObject("A.B")
Application("y")=x
</SCRIPT>

Refer link between Application("y") and x

RELY ON and INSTANCE OF Indicates that a variable is an instance of a class
<SCRIPT>
x=new ActiveXObject("A.B")
</SCRIPT>

INSTANCE_OF link between x and A.B

GO THROUGH Indicates the error file(s) used. Only available for analyzed IIS applications. -

For the dynamic references which are issued from a grep or have the caller located in a JSP script element as a declaration, expression or scriplet, a static link will be created. This new link has almost the same properties as the dynamic link, however the caller can be different. For example, when an object is located in an included file we will have a dynamic reference from the _jspService function of the JSP Page (resp. doTag method of a Tag File) and the object and a static reference from the included JSP File (resp. Tag File) and the object. Note that the main function of the generated servlet/handler class is a pure dynamic object. So, it cannot have static references and we will create them at the function’s parent (JSP Page/Tag File) level.

The following table summarizes the process of creation of the static links using the dynamic links while parsing generated servlet classes (‘Dynamic Caller’ are replace by ‘Static caller’):

Caller: Dynamic Object Link code located in Caller: Static Object
_jspService JSP page JSP page
_jspService JSP page JSP page
servlet class JSP page JSP page
servlet class JSP File (included file) JSP File (included file)
caller JSP Page or JSP File (included file) JSP Page or JSP File (included file)

Example:

fileA.jsp

<%! String redirectA; %>
<% redirectA = "/jsp/fileA.jsp"; %>

fileA.jsp/ includedA.jsp

<%@ include file="included.jsp"%>
<%! String includedA; %>
<% includedA = "/jsp/fileA.jsp"; %>

The following lists describes references that are detected by the JEE analyzer and the context in which corresponding links are traced.Links between bean and class/interfaces are flagged as “Prototype” and are oriented as follows:

  • From bean local and remote interfaces to the EJB itself,
  • From the EJB itself to its bean class and, for entity bean, primary key class.

In addition the following links are also traced:

Link Type When is this type of link created?
FIRE

1. Traced between bean class member methods that are implicitly called by the EJB Container:

Home interface
Bean class
Remote interface
create(...) --F--> ejbCreate(...) <--F-- create(...)
remove(...) --F--> ejbRemove(...) <--F-- remove(...)


< implemented business methods > <--F-- < exported business methods >
find<method>(...) --F--> ejbFind<method>(...)

2. Traced between bean class/home interface and server side objects. For example in this standard ejb-jar.xml file:

<entity>
   <ejb-name>CustomerBean</ejb-name>
   ...
   <abstract-schema-name>Customer</abstract-schema-name>
   ...
   <query>
      <query-method>
         <method-name >findByFirstName</method-name>
         <method-params>
            <method-param>java.lang.String</method-param>
         </method-params>
      </query-method>
      <ejb-ql>SELECT DISTINCT OBJECT(c) FROM Customer AS c WHERE c.firstName = ?1</ejb-ql>
   </query>
</entity>

The signature of the method is created from the values of the tags <method-name> and <method-param>. The method is searched for using the home interfaces (for the findXXX) and the bean class (for the "select methods").

The abstract schema name identified by grep in the query "EJB-QL" is used to find the associated bean (the query can reference the abstract schema name of another bean). From the bean it is possible to retrieve the associated table names and then link resolution is possible.

3. Also traced between SEI.Mi (Service Endpoint Interface) and BC.Mi (Bean Class). Mi stands for methods that have the same signature in the SEI and the BC. The EJB must be a stateless session bean:

  • SEI.Mi -- Fire --> BC.Mi

4. In addition, this link type is used for implicit invocations. They are used to reflect:

  • either the life cycle events of a component (such as creation/destruction)
  • or the interaction of an external actor such as a container (for EJBs or servlets) or a web browser (for applets)

Caller always refers to a component or a class member method. Callee always refers to a class member method.

Note: "Fire" links are never escalated.
USE SELECT, DELETE, UPDATE, INSERT

Traced between bean and server objects (tables).

Bean --Usdui--> Table (U for Use, s for Select, d for Delete, u for Update, i for Insert)
  • Finder and select Method --Us--> Table

The link Bean --Usdui--> Table is traced only with container managed persistence (cmp) beans. For Bean managed persistence (bmp) beans, this link is indirect and is represented by two links:

  • One from Bean component to its java class (traced by EJB Assistant ).
  • One from Methods of the bean class where access to database objects is coded (via jdbc) to server objects corresponding to these objects (tables in this case). This link is traced by Java Analyzer.

For example in this standard ejb-jar.xml file:

<entity id="ContainerManagedEntity_1">
   <ejb-name>PlayerEJB</ejb-name>
   ...
   <abstract-schema-name>Player</abstract-schema-name>
   ...

The bean in question is found in the ejb-jar.xml file using its name. Persistence information is identified using descriptors specific to each server type:

PROTOTYPE
This link type is reserved for J2EE components' support and is used as follows:
  • EJB: between the bean component and its implementation classes (bean class, local/remote interfaces and possibly primary key class).
  • Servlet: between the servlet component and its servlet class.
  • EJB: between the bean and the SEI (Service Endpoint Interface).

For example the Webservices.xml (must be placed in the module directory)

<webservices ...>
   <webservice-description>
      ...
      <webservice-description-name>MyHelloService</webservice-description-name>
      <jaxrpc-mapping-file>mapping.xml</jaxrpc-mapping-file> // relatif ou absolu
      <port-component>
      ...
         <port-component-name>HelloIF</port-component-name>
         <service-endpoint-interface>helloservice.HelloIF</service-endpoint-interface>
         <service-impl-bean>
            <ejb-link>HelloServiceEJB</ejb-link>
         </service-impl-bean>
      </port-component>
   </webservice-description>
</webservices>

JAX-RPC mapping file (mapping.xml in the example) indicates that the mapping information between the web service operation and the java methods can be found in mapping.xml.

<java-wsdl-mapping ...>
...
      <port-mapping>
         <port-name>HelloIFPort</port-name>
      </port-mapping>
   </service-interface-mapping>
   <service-endpoint-interface-mapping>
      <service-endpoint-interface>helloservice.HelloIF</service-endpoint-interface>
      <service-endpoint-method-mapping>
         <java-method-name>sayHello</java-method-name>
         <wsdl-operation>sayHello</wsdl-operation>
            <method-param-parts-mapping>
               <param-position>0</param-position>
               <param-type>java.lang.String</param-type>
               ...
               </method-param-parts-mapping>
   </service-endpoint-method-mapping>
   </service-endpoint-interface-mapping>
</java-wsdl-mapping>


Note: "Prototype" links are never escalated.
ACCESS
These links correspond to inter-bean references. These references are made via a logical name (declared in the ejb-jar.xml file and that specifies the target ejb) used in the bean client code. The tags containing this logical name are <ejb-ref> or <ejb-local-ref>.
  • EJB client -- Access --> EJB target

For example in this standard ejb-jar.xml file:

<entity> //ou session ou message-driven
   <ejb-name> AddressBean</ejb-name>
   <ejb-ref> //ou ejb-local-ref
      <ejb-ref-name>ejb/CustomerRef</ejb-ref-name>
      ...
      <ejb-link>CustomerBean</ejb-link>
   </ejb-ref>
</entity>

Each bean specifies the list of other beans it accesses as well as the references used to do so.

JOIN
Traced between entity beans based on the abstract schema defined in deployment descriptor (beneath the <relationships>...</relationships> tag).

An entity bean (source EJB) is linked to another entity bean (destination EJB) only if navigation is possible from source EJB to destination EJB, i.e the relation-role in which source EJB is involved contains at least one cmr (container managed relationship) field allowing access to the destination EJB.

<ejb-relation>
  <description>Team To Player</description>
  <ejb-relation-name>PlayerEJB.teams-TeamEJB.players</ejb-relation-name>
  <ejb-relationship-role>
     <ejb-relationship-role-name>TeamEJB</ejb-relationship-role-name>
     <multiplicity>many</multiplicity>
     <relationship-role-source>
         <ejb-name>TeamEJB</ejb-name>
     </relationship-role-source>
     <cmr-field>
        <cmr-field-name>players</cmr-field-name>
        <cmr-field-type>java.util.Collection</cmr-field-type>
     </cmr-field>
  </ejb-relationship-role>
 
  <ejb-relationship-role>
     <ejb-relationship-role-name>PlayerEJB</ejb-relationship-role-name>
     <multiplicity>many</multiplicity>
     <relationship-role-source>
        <ejb-name>PlayerEJB</ejb-name>
     </relationship-role-source>
     <cmr-field>
        <cmr-field-name>teams</cmr-field-name>
        <cmr-field-type>java.util.Collection</cmr-field-type>
     </cmr-field>
  </ejb-relationship-role>
</ejb-relation>

Considering the example above, the source EJB TeamEJB will be linked to the destination EJB PlayerEJB because the cmr field players makes navigation possible from source to destination EJB.

For the same reasons, PlayerEJB (now source EJB) will have Refer link to TeamEJB (destination EJB for this link).

For each Join link, the information below is retrieved from the deployment descriptor and accessible in HTML Report:

  • Relation Name

    The name of the EJB relation as found in the <ejb-relation-name> tag of the deployment descriptor (PlayerEJB.teams-TeamEJB.players in the example). If no name is provided, EJB Assistant computes a name for the relation, based on the names of the two beans involved. For instance, the computed name would be TeamEJB-PlayerEJB if PlayerEJB.teams-TeamEJB.players was missing in the example.

  • Relation Description

    The relation description as specified in the descriptor. No default value for this attribute.

  • Multiplicity

    One of the string Many, One or N/S if relation role multiplicity is not specified in the descriptor.

Structural rules

The following rules are provided in the extension:

Release Link
2.0.0-beta1 https://technologies.castsoftware.com/rules?sec=srs_jee&ref=||2.0.0-beta1

See also the following rules provided in the default CAST Assessment Model shipped with CAST Imaging Core:

Technology URL
JEE https://technologies.castsoftware.com/rules?sec=t_140029&ref=||

The following extensions also provide JEE specific rules: