Analysis results
Objects
Language / Framework | Icon | MetaModel name | |
---|---|---|---|
Java |
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 | |||
Presentation layer frameworks
|
Java Server Faces (JSF) |
JSF Faces Config File | |
JSF Converter | |||
JSF Input Field | |||
JSF Managed Bean | |||
JSF Outcome | |||
JSF Validator | |||
JSF View Id Pattern | |||
JSP |
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 | |||
Apache Struts |
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 | |||
STXX | STXX Pipeline | ||
STXX Transform | |||
STXX Transforms File | |||
Persistence layer frameworks |
Hibernate |
Hibernate Configuration File | |
Hibernate Entity | |||
Hibernate Entity Property | |||
Hibernate Mapping File | |||
Hibernate HQL Named Query | |||
Hibernate SQL Named Query | |||
JPA | 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 Result Set | |||
EJB | Entity Java Bean | ||
Message Driven Java Bean | |||
Session Java Bean | |||
Other frameworks | Spring IoC |
Singleton Java Bean | |
Spring Bean | |||
Spring Beans File | |||
Spring Controller | |||
Spring View | |||
CDI |
CDI Named Bean | ||
Spring Batch |
Spring Batch Job | ||
Spring Batch Step |
Links
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 | ||||||||
MENTION | This 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. |
|
||||||||
INCLUDE | This 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. |
|
||||||||
INHERIT | This 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. |
|
||||||||
THROW | This 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. |
|
||||||||
ACCESS | This link is used to describe run-time interactions. It may be enriched by the following sub-types:
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. |
|
||||||||
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. 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. |
|
||||||||
USE | This 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. |
|
||||||||
PROTOTYPE | This 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 DEFINED | These 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:
|
|||||||||
ESCALATED | When two objects are linked via a third object. | Denoted by the square brackets around the link type in CAST Enlighten: [U] | ||||||||
INTERNAL ESCALATED | Created 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 type | When is this type of link created? | Example | |
---|---|---|---|
MENTION | This 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, CATCH | These links are used to describe exception
handling.
Callee always refers to a class. |
- void f () throws C1 {...}
- throw new Exception() - try {...} |
|
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
- 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 |
INHERIT | This link is used to describe object hierarchy.
It may be enriched by the following sub-types:
- Extend:
- Implement:
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 |
|
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. |
- |
- “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 Type | When is this type of link created? | |
USE | TypLib |
|
Applet |
|
|
ActiveX through a variable |
Use link between f and A.B |
|
Dynamic data source |
Use link between id_a and id_obj |
|
Database object
|
|
|
MAP |
|
|
MENTION | Indicates the area in which the ActiveX is mentioned |
Mention link between f and A.B |
Indicates the area in which the class name is mentioned |
Mention link between f and g |
|
INCLUDE | Indicates the inclusion of a file |
|
CALL | Indicates a call to a file |
|
Indicates a function call |
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. |
ACCESS link between xmlData and the getxmlData and putxmlData functions. |
ACCESS and READ |
Read only access to a file |
|
Read only access to a variable |
Read only access between f and x |
|
ACCESS and WRITE |
Read and write access to a variable |
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 |
Refer link between Application("y") and x |
RELY ON and INSTANCE OF | Indicates that a variable is an instance of a class |
INSTANCE_OF link between x and A.B |
GO THROUGH | Indicates 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 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) |
Code sample
file a.jsp
|
|
file a.jsp
file included.jsp
|
EJB links
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 Type | When is this type of link created? | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FIRE | 1. Traced between bean class member methods that are implicitly called by the EJB Container:
2. Traced between bean class/home interface and server side objects. For example in this standard ejb-jar.xml file:
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:
4. In addition, this link type is used for implicit invocations. They are used to reflect:
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 |
Traced between bean and server objects (tables).
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:
For example in this standard ejb-jar.xml file:
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:
For example the Webservices.xml (must be placed in the module directory)
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.
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>.
For example in this standard ejb-jar.xml file:
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.
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:
|
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.