Analysis results

Objects

Java

Icon ImageIDDescriptionConcept
iconJV_APPLETAppletClass
iconJV_CLASSJava ClassClass
iconJV_GENERIC_CLASSGeneric Java ClassClass
iconJV_GENERIC_INTERFACEGeneric Java InterfaceClass
iconJV_INST_CLASSJava Instantiated ClassClass
iconJV_INST_INTERFACEJava Instantiated InterfaceClass
iconJV_INTERFACEJava InterfaceClass
iconJV_CTORJava ConstructorClass Constructor
iconJV_GENERIC_CTORGeneric Java ConstructorClass Constructor
iconJV_INST_CTORJava Instantiated ConstructorClass Constructor
iconJV_EJB_ENTITYEntity Java BeanData Entity
iconJV_EJB_SESSIONSession Java BeanData Object
iconJV_JDOJava Data ObjectData Object
iconJV_RECORDJava RecordData Object
iconJV_RECORD_COMPONENTJava Record ComponentData Object
iconJV_ENUMJava EnumEnumeration
iconJV_ENUM_ITEMJava Enum ItemEnumeration
iconJV_FILEJava FileFile
iconJV_GENERIC_METHODGeneric Java MethodFunction
iconCAST_Java_LambdaJava Lambda ExpressionFunction
iconJV_INITJava InitializerFunction
iconJV_INST_METHODJava Instantiated MethodFunction
iconJV_METHODJava MethodFunction
iconJV_PACKAGEJava PackagePackage
iconJV_IMPORTJava ImportProject
iconJV_EJB_MESSAGEMessage Driven Java BeanService Interface
iconJV_FIELDJava FieldVariable
iconJV_TYPEPARAMGeneric Java Type ParameterVariable
iconCAST_Java_AnnotationTypeJava Annotation Type
iconCAST_Java_AnnotationTypeMethodJava Annotation Type MethodFunction
iconCAST_JAVA_AnonymousMethodMethod of Anonymous ClassFunction

JSF (Java Server Face)

Icon ImageIDDescriptionConcept
iconJSF_MANAGED_BEANJSF Managed BeanBean
iconJSF_FACES_CONFIG_FILEJSF Faces Config FileConfiguration
iconJSF_CONVERTERJSF ConverterFunction
iconJSF_OUTCOMEJSF OutcomeFunction
iconJSF_VALIDATORJSF ValidatorFunction
iconJSF_INPUT_FIELDJSF Input FieldUI
iconJSF_VIEW_ID_PATTERNJSF View Id PatternUI

JSP (Java Server Page)

Icon ImageIDDescriptionConcept
iconJSP_PROPERTY_MAPPINGJava Property Mapping
iconJSP_SERVLETServlet
iconJSP_SERVLET_MAPPINGServlet Mapping
iconJSP_STXX_PIPELINESTXX Pipeline
iconJSP_TAGJSP Custom Tag
iconJSP_TAG_ATTRJSP Custom Tag Attribute
iconJSP_TAG_LIBJSP Custom Tag Library
iconJSP_BEANJ2EE Scoped BeanBean
iconJSP_BEAN_TILES_DEFTiles DefinitionBean
iconJSP_ACTION_MAPPINGStruts Action MappingConfiguration
iconJSP_FORWARDStruts ForwardConfiguration
iconJSP_GENERICJ2EE XML ObjectConfiguration
iconJSP_STXX_TRANSFORMS_FILESTXX Transforms FileConfiguration
iconCAST_HTML5_JSP_ContentJSP ContentFile
iconJSP_PROPERTIES_FILEJava Properties FileFile
iconJSP_TILES_DEF_FILETiles Configuration FileFile
iconJSP_XMLCONFIG_FILEJ2EE XML FileFile
iconJSP_APPDESCRIPTORJ2EE Web Application DescriptorFunction
iconJSP_ELFUNCTIONJSP EL FunctionFunction
iconJSP_STXX_TRANSFORMSTXX TransformService Invocation
iconJSP_ATTRIBUTES_SCOPEServlet Attributes ScopeVariable
iconJSP_BEAN_PROPBean PropertyVariable
iconJSP_BEAN_PROP_TILES_DEF_ATTRIBUTETiles Definition AttributeVariable

JEE Servlet

Icon ImageIDDescriptionConcept
iconJSP_SERVLETServlet
iconJSP_SERVLET_MAPPINGServlet Mapping
iconCAST_Servlet_AnyOperationServlet Any OperationExposed Web Services
iconCAST_Servlet_DeleteOperationServlet Delete OperationExposed Web Services
iconCAST_Servlet_GetOperationServlet Get OperationExposed Web Services
iconCAST_Servlet_PostOperationServlet Post OperationExposed Web Services
iconCAST_Servlet_PutOperationServlet Put OperationExposed Web Services
iconCAST_HTML5_JEE_Servlet_Mapping_AccessJEE Servlet Mapping CallService Interface

Struts

Icon ImageIDDescriptionConcept
iconSTRUTS_FORM_BEANStruts Form BeanBean
iconCAST_JEE_Struts2_ConfigurationFileStruts2 Configuration FileConfiguration
iconCAST_JEE_StrutsActionStruts ActionConfiguration
iconCAST_JEE_StrutsFilterStruts FilterConfiguration
iconCAST_JEE_StrutsInterceptorStruts InterceptorConfiguration
iconCAST_JEE_StrutsInterceptorStackStruts Interceptor StackConfiguration
iconCAST_JEE_StrutsResultStruts ResultConfiguration
iconSTRUTS_CONFIG_FILEStruts Configuration FileConfiguration
iconCAST_Struts_GetOperationStruts Get OperationExposed Web Services
iconCAST_Struts_OperationStruts OperationExposed Web Services
iconCAST_Struts_PostOperationStruts Post OperationExposed Web Services
iconCAST_JEE_StrutsValidatorStruts ValidatorFunction
iconCAST_Struts_FormValidatorStruts Validate OperationFunction
iconCAST_Struts_ParamInterceptorStruts ParameterInterceptorFunction
iconCAST_JEE_StrutsPackageStruts PackagePackage
iconCAST_HTML5_JEE_Struts_Action_AccessJEE Struts Action CallService Interface

JPA/Hibernate

Icon ImageIDDescriptionConcept
iconJPA_EMBEDDABLEJPA Embeddable
iconJPA_PERSISTENCE_UNITJPA Persistence Unit
iconJPA_SQL_RESULT_SETJPA Result Set
iconJPA_ORM_CONFIG_FILEJPA ORM Configuration FileConfiguration
iconJPA_PERS_CONFIG_FILEJPA Persistence configuration FileConfiguration
iconCAST_Java_JPA_EntityJPA EntityData Entity
iconCAST_Java_JPA_Entity_OperationJPA Entity OperationData Entity
iconCAST_Java_Unknown_JPA_EntityJPA Unknown EntityData Entity
iconCAST_Java_Unknown_JPA_Entity_OperationJPA Unknown Entity OperationData Entity
iconJPA_ENTITYJPA EntityData Entity
iconCAST_Java_JPA_JPQLQueryJPQL QueryData Query
iconCAST_Java_JPA_SQLQueryJPA SQL QueryData Query
iconCAST_Java_Unknown_JPA_SQLQueryJPA Unknown SQL QueryData Query
iconCAST_SpringData_JPA_SQLQuerySpring Data JPQL QueryData Query
iconJPA_NAMED_NATIVE_QUERYJPA Named Native QueryData Query
iconJPA_NAMED_QUERYJPA Named QueryData Query
iconJPA_EMBEDDABLE_PROPERTYJPA Embeddable PropertyVariable
iconJPA_ENTITY_PROPERTYJPA Entity PropertyVariable

Program Call

Icon ImageIDDescriptionConcept
iconCAST_Java2Program_GeneralCallJava Call to Generic ProgramRun Service
iconCAST_Java2Program_JarProgramJava JAR ProgramRun Service
iconCAST_Java2Program_JavaCallJava Call to Java ProgramRun Service

The following is a non-exhaustive list of links that may be identified between objects saved in the CAST Analysis Service:

References that are detected by the analyzer while analyzing JSP Pages and static references 

Click here to expand…

Link Type

When is this type of link created?Example
MENTIONThis link is created for the taglib directive.

The caller is the JSP File where the directive is defined.

The callee is the Tag Library identified by the "uri" attribute.

<%@ taglib uri="/examples-taglib" prefix="eg"%>
INCLUDEThis link is created for the include directive.

The caller is the JSP File where the directive is defined.

The callee is a JSP File, Static File or a JSP Mapping as specified by the "file" attribute.

<%@ include file="URL"%>
INHERITThis link is used to describe object hierarchy. It is created for the page directive.

It is always enriched by the sub-type Extend (class to super-class).

The caller is the JSP File where the directive is defined.

The callee is a Java Class as specified by the "extends" attribute.

<%@ page extends="com.cast.SuperClass"%>
THROWThis link is used to describe exception handling. It is created for the page directive.

The caller is the JSP File where the directive is defined.

The callee is a File (JSP or static) or a JSP Mapping as specified by the "errorPage" attribute.

<%@ page errorPage="URL"%>
ACCESS

This link is used to describe run-time interactions. It may be enriched by the following sub-types:

  • Read
  • Write
  • Forward
  • Include

In the "example" column you will find a list of all cases when these links are created. If omitted, the caller is the JSP File where the standard or custom action is defined.

Read
<jsp:getProperty name="clock" property="dayOfMonth"/>

The callee is the Bean Property as specified by the "property" attribute.

Write
<jsp:setProperty name="clock" property="dayOfMonth" value="13"/>

The callee is the Bean Property as specified by the "property"attribute.>

<eg:foo attr1="value"/>

The callee is the Tag Attribute as specified by the name of an attribute of the custom action.

Forward
<jsp:forward page="URL"/>

The callee is a File (JSP or static) or a JSP Mapping.

Definition of a servlet mapping: the caller is the Servlet Mapping and the callee is the associated Servlet.

Definition of a property mapping: the caller is the Property Mapping and the callee is a File (JSP or static), a JSP Mapping or a Java Type.

Include
<jsp:include page="file"/>

The callee is a File (JSP or static) or a JSP Mapping.

RELY ONThis link is used to describe typing.

Caller uses callee to define its Java type. Callee always refers to a class or interface.

In our case the caller is a Bean and the callee is its class as specified by either "class" or "beanName" attribute.

Note that for all beans created from a XML Configuration file, a link of this type is automatically created.

<jsp:useBean id="clock" class="beans.clockBean" ... />
USEThis link is created for the jsp:useBeanstandard action.

The caller is the JSP File where the action is defined.

The callee is a Bean as specified by the "id" attribute.

This type is also used for dynamic link resolution. It covers server side objects referencing.

<jsp:useBean id="clock" class="beans.clockBean" ... />
PROTOTYPEThis link is used as follows:

Servlet: between the servlet component and its servlet class or JSP File as specified in the application descriptor via "servlet-class" or "jsp-file" XML element.

Custom Tag: between the tag object and its class or tei-class as specified in the tag library descriptor via "tag-class" and "tei-class" xml elements.


USER DEFINEDThese links are entirely specified by the user in the application's additional XML configuration files.

Users can use the following string values to specify the link type:

access (Access), call (Call), catch (Catch), fire (Fire), include (Include), inherit (Inherit), issonof (Is Son Of), lock (Lock ), mention (Mention), prototype (Prototype), raise (Raise), refer (Refer), relyon (Rely On), throw (Throw) or use (Use).

The following table shows a non exhaustive list of these types of links:


CallerCallee
XML Configuration File
  • Java Type (class or interface)
  • Java Method
  • JSP Mapping
  • File (JSP or static)

  • Bean

Action Mapping
  • Java Type (class or interface)
  • JSP Mapping
  • File (JSP or static)
  • Bean

ESCALATEDWhen two objects are linked via a third object.Denoted by the square brackets around the link type in CAST Enlighten: [U]
INTERNAL ESCALATEDCreated when the calling object is not saved in the CAST Knowledge Base (i.e. a variable that is local to a function). As a result the analyzer will save the link and associate it with the parent of the calling object.Denoted by the curly brackets (or braces) around the link type in CAST Enlighten: {U}

References detected by the analyzer when carrying out a pure Java analysis

Click here to expand…

Link typeWhen is this type of link created?Example
MENTIONThis link is traced on following expressions:

- "instance of" operator

- cast expression

- class literal

- this literal

- class creation

- array creation

Callee always refers to a class or interface.

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

- A . this = 1;

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

- B b [] = new A[5];

THROW, RAISE, CATCHThese links are used to describe exception handling.
  • 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).

Callee always refers to a class.

- void f () throws C1 {...}

- throw new Exception()

- try {...}
catch (Throwable e) {...)

RELY ONThis 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;

ACCESSThis link is used to describe run-time interactions.

It may be enriched by the following sub-types:

- Read

- Write

- Exec

- Member

- Array

- return x

- x = 1

- x++

- x[1] = 2

- x[] = {1,2}

- f(1)

- x.toString()

- x.f()

- x.y = 1

- read

- write

- read and write

- array not read

- read

- exec

- member

- member on x ; exec on f

- member on x ;write on y

INHERITThis link is used to describe object hierarchy. It may be enriched by the following sub-types:

- Extend:

  • class to super-class
  • interface to super-interface

- Implement:

  • class to super-interface(s)

Caller and callee always refer to classes or interfaces.

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:

- 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.

Caller and callee always refer to methods.

- class C1 extends C2 implements I
{...}

- interface I1 extends implements I2
{...}

USEThis type is reserved for dynamic link resolution. It covers server side objects referencing:

- Select

- Insert

- Update

- Delete

-
PROTOTYPEThis link is reserved for J2EE components' support and is used as follows:
  • Applet: between the applet component and its applet class.

Caller and callee always refer to a component and to a class or interface.

-
  • “Exec access” links can be thought of as invocation calls.
  • To avoid redundancy with a corresponding escalated link, a “member access” link is not traced on a qualifier if this one matches the member parent.
  • “Prototype” links are never escalated.

References that are detected by the analyzer while analyzing JSP pages and Tag Files as client files

Click here to expand…

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

Use link between f and A.B

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

Database object


<SCRIPT>
ExecuteSQL("select * from authors")
</SCRIPT>
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>
MENTIONIndicates the area in which the ActiveX is mentioned
function f()
{
return CreateObject("A.B")
}

Mention link between f and A.B

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

Mention link between f and g

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

Call link between g and f

ACCESSIndicates 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">
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_FORWARDIndicates a redirection. Only available for analyzed IIS applications.-
REFERIndicates 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 OFIndicates 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 THROUGHIndicates the error file(s) used. Only available for analyzed IIS applications.-

References that are detected by the analyzer while analyzing the JSP page implementation class and/or Tag Handlers are dynamic references

Click here to expand…

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 ObjectLink code located inCaller: Static Object
_jspServiceJSP pageJSP page
_jspServiceJSP pageJSP page
servlet classJSP pageJSP page
servlet classJSP File (included file)JSP File (included file)
callerJSP Page or JSP File (included file)JSP Page or JSP File (included file)
Code sample

file a.jsp

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

file a.jsp

<%@ include file="included.jsp"%>

file included.jsp

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

Click here to expand…

The following lists describes references that are detected by the JEE analyzer and the context in which corresponding links are traced and stored in the CAST Analysis Service:

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 TypeWhen 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.
USESELECT
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:

DELETE
UPDATE
INSERT
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>

Link example:

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.

How are references traced?

The names of underlying tables for each entity bean are retrieved from descriptors containing persistence information (that map beans to database tables or other devices). These names are then compared to the selected  server objects’ names. If the names match each other then a link is created  between the entity bean and the server objects (tables).

For bean class and/or interface methods, links with server objects are traced based on a string search of the entity bean’s Abstract schema name from the method’s EJB-QL statement in the ejb-jar.xml file. Once the abstract schema name is found, the methods are then linked to the underlying tables of the entity bean.

The examples below give an overview of the mapping process:

  • Common file (ejb-jar.xml)
 <entity id="ContainerManagedEntity_1">>
       <ejb-name>PlayerEJB</ejb-name>
    ...
       <abstract-schema-name>Player</abstract-schema-name>
    ...
    ...
       <query>
         <query-method>
           <method-name>ejbSelectLeagues</method-name>
           <method-params>
             <method-param>team.LocalPlayer</method-param>
           </method-params>
         </query-method>
         <ejb-ql> select distinct t.league from Player p, in (p.teams) as t where p = ?1 </ejb-ql>
       </query>
    ...
  • Weblogic application server (weblogic-cmp20-rdbms-jar.xml)
 <weblogic-rdbms-bean>
     <ejb-name>PlayerEJB</ejb-name>
    ...
     <table-map>
       <table-name>localplayers</table-name>
       <field-map>
         <cmp-field>name</cmp-field>
         <dbms-column>name</dbms-column>
       </field-map>
    ...
    ...
  • Borland enterprise server (ejb-borland.xml)
<ejb-jar>
     <enterprise-beans>
         <entity>
             <ejb-name>PlayerEJB</ejb-name>
             <bean-home-name>PlayerEJBRemote</bean-home-name>
             <cmp2-info>
                 <cmp-field>
                     <field-name>playerId</field-name>
                 </cmp-field>
        ...
                 <table-name>localplayers</table-name>
             </cmp2-info>
         </entity>
     </enterprise-beans>
    ...
    ...
  • Websphere application server (Map.mapxmi)
<ejbrdbmapping:EjbRdbDocumentRoot xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
 xmlns:ejbrdbmapping="ejbrdbmapping.xmi" xmlns:Mapping="Mapping.xmi" xmlns:ejb="ejb.xmi"
 xmlns:RDBSchema="RDBSchema.xmi" xmlns:java="java.xmi" xmi:id="EjbRdbDocumentRoot_1"
 outputReadOnly="false" topToBottom="true">
    ...
   <nested xsi:type="ejbrdbmapping:RDBEjbMapper" xmi:id="RDBEjbMapper_1">
    ...
     <inputs xsi:type="ejb:ContainerManagedEntity" href="META-INF/ejb-jar.xml#ContainerManagedEntity_1"/>
     <outputs xsi:type="RDBSchema:RDBTable" href="META-INF/Schema/Schema.dbxmi#Player"/>
  • Websphere application server (Schema.dbxmi)
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:RDBSchema="RDBSchema.xmi">
    ...
   <RDBSchema:RDBTable xmi:id="Player" name="localplayers" primaryKey="playerId" database="MyDB_ID">
     <namedGroup xsi:type="RDBSchema:SQLReference" xmi:id="SQLReference_1" members="RDBColumn_1"
     table="Player" constraint="Constraint_HistoryPK"/>

In the ejb-jar.xml file of the above Webspheres example, there is an entity bean, PlayerEJB, whose abstract schema name is Player that has a method called ejbSelectLeagues. This method references the abstract schema name (Player) of PlayerEJB in its EJB-QL statement.

Every server specific deployment descriptor (listed above) maps PlayerEJB to the table localplayers. For websphere format: In ejb-jar.xml, PlayerEJB is given the Id ContainerManagedEntity_1. The Map.mpaxmi file maps ContainerManagedEntity_1 to the Id Player and this Id is mapped in Schema.dbxmi to the table localPlayers.

From this information, the following links are created:

  • PlayerEJB ==> localplayers (the server object has a name matching the string “localplayers”. If none, no link will be created).
  • ejbSelectLeagues ==> localplayers (this is done via PlayerEJB and its abstract schema name).

Example below shows how the mapping (bean-table) process is carried out when a Weblogic Application server delegates persistence management to TopLink:

  • weblogic-ejb-jar.xml
 <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
        <ejb-name>Employee</ejb-name>
        <entity-descriptor>
            <persistence>
                <persistence-use>
                    <type-identifier>TopLink_CMP_2_0</type-identifier>
                    <type-version>4.5</type-version>
                    <type-storage>META-INF/toplink-ejb-jar.xml</type-storage>
                </persistence-use>
            </persistence>
        </entity-descriptor>
        ...
    </weblogic-enterprise-bean>
    ...
 </weblogic-ejb-jar>
  • META-INF/toplink-ejb-jar.xml (referenced above)
<toplink-ejb-jar>
   <session>
       <name>ejb20_EmployeeDemo</name>
       <project-xml>Employee.xml</project-xml>
       ...
   </session>
 </toplink-ejb-jar>
  • Employee.xml (referenced in META-INF/toplink-ejb-jar.xml)
<project>
    <project-name>Employee</project-name>
    ...
    <descriptors>
        <descriptor>
            <java-class>examples.ejb.cmp20.advanced.EmployeeBean</java-class>
            <tables>
                <table>Employee</table>
            </tables>
            ...
        </descriptor>
    </descriptors>
</project>
  • For the <type-identifier> tag in weblogic-ejb-jar.xml file, only identifiers TopLink_CMP and  WebLogic_CMP_RDBMS are recognized.
  • From toplink-ejb-jar.xml file, <session> tags are scanned until we meet the project file (considering bean class fully qualified name) that provide persistent information for the given bean (Employee in the example above) .
  • If the project file path(Employee.xml) is not a full path, then it is supposed to be relative to the module directory (in general, this directory corresponds to the one containing the META-INF folder).
  • Only references to server objects that have been previously registered in the Analysis Service can be traced. When a reference to an unregistered object is detected, CAST will first try to register the object. If it fails, a warning message is issued and the reference will not be saved.