Page tree
Skip to end of metadata
Go to start of metadata

On this page:

Summary: this pages describes native castscript functions.

Note that the CAST Script / FlexFramework feature described in this page is deprecated. You should instead consider using the Extension SDK to handle XML configuration files.

What are Native Functions?

Native Functions are provided by CAST to provide a basic set of functions that can be called by your own castscript functions. See FlexFramework - Description of the castscript language  for more information about writing your own castscript functions.

Native Function limitations

  • Never call a native function with an input parameter null (e.g: findSymbol("MyMethod", "JV_GENERIC_CTOR",null) will generate a runtime error and current CAST Script execution will be terminated);
  • Limitation of native function findOrCreateSymbol:
    • cannot handle files (Java ou JSP metamodel files types are not handled by this function, ex. XML Spring Files). File type objects will be automatically created by the analyzer when they are selected in the analysis source files via CAST Analysis Manager.
    • cannot handle Java objects: Java objects are created by the analyzer itself andcannot be created through a castscript.
  • Limitation of native function setProperty(symbol caller,symbol callee,string linkType, string propertyName, string  propertyValue)  - caller type can only be a JAVA type

Miscellaneous

  • Function signatures can be overridden
  • There are no optional parameters
  • To find or create symbols for castscript functions you might need to know the parent symbol of the object you want to find or create. To find this parent symbol, you need to know its type and name. You can find the parent type of any object by looking at the Object Tree in CAST Enlighten. However, some J2EE objects are available for castscript, but are not visible in the CAST Enlighten Object Tree - these are Java Annotations and Java Annotation Parameters. Here is how their parentship is represented in memory: FlexFramework - Hidden JEE Objects parent tree.

String manipulation

Native functions declarationDescriptionCastScript file
native string concat(string word_1,string word_2)Description: Concat the two strings

Input Parameters:

word_1, word_2: string parameters to be concat

Output Parameters:

concatenation of the two string parameters, word_1 & word_2

Core\String.castscript
native string substring(string word, int index_begin)Description: Return the substring from the index

Input Parameters:

word : original string;
index_begin : beginning index, 0 based

Output Parameters:

substring of word parameter beginning from left to right

Core\String.castscript
native string substring(string word, int index_begin, int length)Description: Return the substring between the two indexes

Input Parameters:

word : original string;
index_begin : beginning index, begin from 0
length : substring length

Output Parameters:

substring of word parameter beginning from left to right and of specified length

Core\String.castscript
native int getLength(string word)Description: Return the string length

Input Parameters:

word : original string

Output Parameters:

string length

Core\String.castscript
native string toUpper(string word)Description: Return the string with upper case letters

Input Parameters:

word : original string

Output Parameters:

word to upper case letters

Core\String.castscript
native string toLower(string word)Description: Return the string with lower case letters

Input Parameters:

word : original string

Output Parameters:

word to lower case letters

Core\String.castscript
native int getFirstIndex(string word,string substring)Description: Look for the substring in the word. If found, return the first index, -1 otherwise.

Input Parameters:

word : original string substring : string to find

Output Parameters:

first index where the specified substring is found in word , -1 if the substring is not not found in word

Core\String.castscript
native string substringMatch(string word,string regexp)Description: Look for the regular expression in the word. If found, return the matching substring, -1 otherwise.

Input Parameters:

word : original string
regexp : regular expression to match

Output Parameters:

matching substring, -1 if no match

Core\String.castscript
native string toString(boolean value)Description: Convert boolean to string value

Input Parameters:

value : input boolean value

Output Parameters:

boolean parameter converted to string value

Core\String.castscript
native string toString(int value)Description: Convert int to string value

Input Parameters:

value : input integer value

Output Parameters:

integer parameter converted to string value

Core\String.castscript

Log native functions

Log

Native functions declarationDescriptionCastScript file
native void log(int level, string logMessage)Description: output the log Message in CAST Analysis Manager with the specified log level.

Input Parameters:

- logMessage

- level error level value: 5 constants have been defined to specify the log level: INFO, WARNING, ERROR, FATAL_ERROR and DEBUG. When DEBUG is used, the logMessage will be logged in CAST Analysis Manager as an information message with the prefix "DEBUG: ". Enabled only if the Activate CAST Scripts trace checkbox when using the Run analysis only option is selected (see JEE Analyzer - Packaging, delivering and analyzing your source code).

- (function call log(debugMessage, DEBUG) )

Output Parameters:

N/A

Core\Log.castscript

exit

native void exit(string errorMessage)Description: Exit current castscript, log errorMessage, continue with the following castscripts

Input Parameters:

errorMessage

Output Parameters:

N/A

Core\Error.castscript

Bookmark native functions

Native functions declarationDescriptionCastScript file
native bookmark createBookmark( string fileFullPath, int startLine, int startCol, int endLine, int endCol )Description: Create a bookmark object

Input Parameters:

- fileFullPath : full path of the file

- startLine : beginning line

- startCol : beginning column

- endLine : ending line

- endCol : ending column

Output Parameters:

bookmark object created

Core\Bookmark.castscript
native void setBookmark(symbol object,bookmark mark)Description: Set the bookmark of an object, if the bookmark exists it will be replaced

Input Parameters:

- object  (only for JEE Types)

- mark

Output Parameters:

N/A

Core\Bookmark.castscript
native bookmark getBookmark( symbol bookmarkedSymbol)Description: Return the bookmark of the object

Input Parameters:

bookmarkedSymbol: bookmarked object

Output Parameters:

bookmark found

Core\Bookmark.castscript
native list(int) getBookmarkPositions(bookmark mark)Description: Return the bookmark position as a list (list items in order: startLine, startCol, endLine, endCol )

Input Parameters:

mark

Output Parameters:

a list representing the bookmark position

Core\Bookmark.castscript
int getBookmarkBeginningRow(bookmark mark)Description: Return the bookmark's first position (first row)

Input Parameters: 

mark

Output Parameters:

bookmark first position (first row)

Core\Bookmark.castscript
int getBookmarkBeginningColumn(bookmark mark)Description: Return the bookmark (first column)

Input Parameters: 

mark

Output Parameters:

bookmark position (first column)

Core\Bookmark.castscript
int getBookmarkEndingRow(bookmark mark)Description: Return the bookmark (last row)

Input Parameters:

mark

Output Parameters:

bookmark position (last row)

Core\Bookmark.castscript
int getBookmarkEndingColumn(bookmark mark)Description: Return the bookmark (last column)

Input Parameters:

mark

Output Parameters:

bookmark position (last column)

Core\Bookmark.castscript
int getBookmarkNthPosition(bookmark mark, int index)Description: Return the bookmark (Nth position)

Input Parameters:

- mark

- index (if 1 then coresponds to getBookmarkBeginningRow, if 2 coresponds to getBookmarkBeginningColumn, if 3 to getBookmarkEndingRow, if 4 to getBookmarkEndingColumn)

Output Parameters:

bookmark position (Nth position)

Core\Bookmark.castscript
native string getBookmarkFilePath(bookmark mark)Description: Return the file full path

Input Parameters:

bookmark.

Output Parameters:

file full path

Core\Bookmark.castscript

Annotation manipulation

Native functions declarationDescriptionCastScript file
native list(symbol) getSymbolsAnnotatedWith( symbol annotationType, string metatypeOrCategory)Description: Return a list of symbol that are annotated with an annotation by indicating an annotation type otherwise return null

Input Parameters: annotationFullName: An annotation type; metatypeOrCategory: Metatype or category of symbols that can be returned by this method.

Output Parameter: List of symbols annotated with the indicated annotation type and that are of the corresponding metatype or category.

Core\Annotations.castscript
native list(symbol) getSymbolsAnnotatedWith( symbol annotationType, list(string) metatypeOrCategories )Description: Return a list of symbol that are annotated with an annotation by indicating an annotation type

Input Parameters:annotationFullName: An annotation type; metatypeOrCategories: List of metatype or categories of symbol that can be returned by this method.

Output Parameter: List of symbols annotated with the indicated annotation type and that are of the corresponding metatypes or categories.

Core\Annotations.castscript
native boolean hasAnnotation( symbol object,string annotation )Description: Verify if object has the specified annotation (verify also inherited annotations, those annotated with @Inherited, when the symbol is a Java Class)

Note that for "hasAnnotation( aClass, aAnnotation)", in the case of Inherited meta-annotation on the aAnnotation type declaration, if a superclass of the aClass class is annoted with the aAnnotation  annotation than the function return true (for details, see http://java.sun.com/j2se/1.5.0/docs/api/java/lang/annotation/Inherited.html)  ; annotation parameter  value must be an annotation fullname such as javax.ejb.Stateless; return true or false)

Input Parameters:

object: annotated object; annotation

Output Parameters:

true if object parameter has the specified annotation, false otherwise

Core\Annotations.castscript
native list(symbol) getAnnotations( symbol object )Description: Return the annotations list applied on the specified object or its parents (also returns inherited annotations when the symbol is a Java Class, like hasAnnotation function if the Inherited meta-annotation is present)

Input Parameters:

object: annotated object

Output Parameters:

list of annotations applied to the object

Core\Annotations.castscript
native boolean isDefaultParameter( symbol annotationParameter )Description: Indicates whether a annotation parameter is obtained via a default value.

Input Parameters:

annotationParameter

Output Parameters:

true if the annotation parameter is obtained via a default value, false otherwise

Core\Annotations.castscript

JSP Beans manipulation

 

Native functions declarationDescriptionCastScript file
native symbol createScopedBean(string name,string scope)Description: Create and return the bean in the expected scope

Input Parameters:

name: bean name; scope: bean scope

Output Parameters:

created bean

Core\JEE\JEE.castscript
native symbol findScopedBean(string name,string scope)Description: Return the bean if existing in the expected scope

Input Parameters:

name: bean name; scope: bean scope

Output Parameters:

found bean, null if the bean is not found

Core\JEE\JEE.castscript
symbol findOrCreateScopedBean(string name,string scope)Description: Return the bean in the expected scope which can be: request, session or application.

Input Parameters:

name: bean name; scope: bean scope

Output Parameters:

found or created bean

Core\JEE\JEE.castscript

Symbol manipulation

findSymbols

When using findSymbols:

  • you should use categories over a list of types. When you use a list of type to get a Java type from a full name, you may forget to include all the types from the metamodel that can be a Java type such as JV_CLASS, JV_INTERFACE, JV_GENERIC_CLASS, JV_GENERIC_INTERFACE etc. while the category JAVA_ALL_CLASSES is the correct definition.
  • To find symbols for castscript functions you might need to know the parent symbol of the object you want to find or create. To find this parent symbol, you need to know its type and name. You can find the parent type of any object by looking at the Object Tree in CAST Enlighten. However, some JEE objects are available for castscript, but are not visible in the CAST Enlighten Object Tree - these are Java Annotations and Java Annotation Parameters. Here is how their parentship is represented in memory: FlexFramework - Hidden JEE Objects parent tree.

Native functions declarationDescriptionCastScript file
native list(symbol) findSymbols(string name,list(string) types)Description: Find objects of a given full name; objects to find can be of several types defined in types

Input Parameters: 

name: fullname of the object to find types

Output Parameters:

list of found objects

Core\JEE\JEE.castscript
native list(symbol) findSymbols(string name,list(string) types,symbol parent)Description: Find object of a given short name and that belong to a specific parent

Input Parameters: 

- name: fullname of the object to find

- types: object to find can be of several types defined in 'types' parent

Output Parameters:

list of found objects

Core\JEE\JEE.castscript
native list(symbol) findSymbols(list(string) types,symbol parent)Description: Find all child objects that belong to object specified in 'parent'
* Objects to find can be of several types specified in 'types'

Input Parameters:

- types: list of possible types of the object to find

- parent

Output Parameters:

list of found objects

Core\JEE\JEE.castscript

findOrCreateSymbol

  • To find or create symbols for castscript functions you might need to know the parent symbol of the object you want to find or create. To find this parent symbol, you need to know its type and name. You can find the parent type of any object by looking at the Object Tree in CAST Enlighten. However, some JEE objects are available for castscript, but are not visible in the CAST Enlighten Object Tree - these are Java Annotations and Java Annotation Parameters. Here is how their parentship is represented in memory: FlexFramework - Hidden JEE Objects parent tree  

  • Please note that this native function cannot handle files (Java or JSP metamodel files types are not handled by this function, e.g. XML Spring Files).

Native functions declarationDescriptionCastScript file
native symbol findOrCreateSymbol(string name,string type)Description: Verify if object of specified fullname and type exists. If not, create a symbol of specified fullname and type

Input Parameters:

- name: fullname of the symbol

- type

Output Parameters:

found or created object

Core\JEE\JEE.castscript
native symbol findOrCreateSymbol(string name,string type,symbol parent)Description: Verify if object of specified short name, type and parent exists. If not, create symbol of specified short name, type and parent

Input Parameters:

- short name of the object to find

- type

- parent

Output Parameters:

found or created object

Core\JEE\JEE.castscript

findReturnedSymbols

Native functions declarationDescriptionCastScript file
native list(symbol) findReturnedSymbols(symbol method)

Description: Retrieve the actual types returned by a method. I the sample below, this new function would return Test1 and Test2 for the method myMethod:

interface ITest { ... }

class Test1 implements ITest { ... }

class Test2 implements ITest { ... }

class User {
ITest myMethod()
{ 
if (true)
return new Test1 ();
else
return new Test2 ();
}
}

Input Parameters:

- short name of the object to find

- type

- parent

Output Parameters:

found or created object

Core\JEE\JEE.castscript
Native functions declarationDescriptionCastScript file
native boolean createLink(symbol caller,symbol callee, string linkType)Description: Create a link between caller and callee of type linkType, linkType is Metamodel linkType

Input Parameters:

caller, callee, linkType

Output Parameter:

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript
native boolean createLink(symbol caller, symbol callee, string linkType, bookmark mark)Description: Create a link between caller and callee of type linkType, linkType is Metamodel linkType and mark is the bookmark

Input Parameters:

caller, callee, targetTypeOrCategory, linkType, mark

Output Parameter:

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript
native boolean createLink(symbol caller, string target, string targetTypeOrCategory, string linkType, bookmark mark)Description:  Create a link between caller and callee of type linkType, linkType is Metamodel linkType. Callee name is found in string and mark is the bookmark

Input Parameters:

caller, target, targetTypeOrCategory, linkType , mark 

Output Parameter:

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript
native boolean createLinkFromReturnedString( symbol caller, string targetTypeOrCategory, string linkType );Description: Create a link between caller and callee whose name is returned by caller in a string. For example a Java method that returns a java.lang.String.

Input Parameters:

caller, targetTypeOrCategory (Metamodel type or category), linkType (Metamodel linkType)

Output Parameter:

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript
native boolean createLinkFromReturnedString( symbol caller, string targetTypeOrCategory, symbol targetParent, string linkType );Description: Create a link between caller and callee that is a direct child of targetParent and whose name is returned by caller in a string. For example a Java method that returns a java.lang.String.

Input Parameters:

caller, targetTypeOrCategory (Metamodel type or category), targetParent, linkType (Metamodel linkType)

Output Parameter:

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript

addProperty

Native functions declarationDescriptionCastScript file
native void addProperty(symbol object, string property, string value)Description: Add a given value to a property of type list. It is an extender (applies only to string list properties)

Input Parameters: object; property: metamodel property name;
value: property value

Output Parameters:

N/A

Core\JEE\JEE.castscript

setProperty

 Please note that this native function has some limitations for EJB, Spring and J2EE:

  • any integer or boolean parameter is converted into a string - property is saved as a string property
  • propertyName is full name: category must be included
Native functions declarationDescriptionCastScript file
native boolean setProperty(symbol object,string propertyName,string value)Description: Set the property 'propertyName' with the value specified by 'propertyValue' on the object specified by the first parameter (object). 

Input Parameters:

object - property is set on this symbol, propertyName , propertyValue

Output Parameter:

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript
native boolean setProperty(symbol object,string propertyName,boolean value)Description:  Set the property 'propertyName' with the value specified by 'propertyValue' on the object specified by the first parameter (object). 

Input Parameters:

object - property is set on this symbol, propertyName , value

Output Parameter:

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript
native boolean setProperty(symbol object,string propertyName,int propertyValue)Description: Set the property 'propertyName' with the value specified by 'propertyValue' on the object specified by the first parameter (object). 
 //Metamodel PropertyName

Input Parameters:

object - property is set on this symbol, propertyName , propertyValue

Output Parameter:

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript
native boolean setProperty(symbol caller,symbol callee,string linkType, string propertyName, string  propertyValue)Description:  Set the property 'propertyName' with the value specified by 'propertyValue' on the link between caller and callee specified in the first two parameters

Input Parameters:

@param caller (only for JAVA types), callee, linkType: link type, propertyName: property name, propertyValue: property value

Output Parameter: 

boolean (indicate if operation succeeded or not)

Core\JEE\JEE.castscript

getAnnotatedInheritImplementParents

Native functions declarationDescriptionCastScript file
string getAnnotatedInheritImplementParents(symbol class, string annotationName)Description: Get full name of the interface implemented by the given class and annotated with annotationName

Input Parameters:

class, annotationName

Output Parameter:

full name of the interface

Core\JEE\JEE.castscript

getSuperTypes

Native functions declarationDescriptionCastScript file
native list(symbol) getSuperTypes(symbol classOrInterface)Description: Get the list of objects that a specific symbol is extending; One level of inheritance

Input Parameters:

Class Or Interface

Output Parameter:

list of Inherited Parent Objects

Core\JEE\JEE.castscript

getInterfaces

Native functions declarationDescriptionCastScript file
native list(symbol) getInterfaces(symbol interface)Description: Get the list of objects that a specific symbol is implementing; One level of inheritance

Input Parameters:

interface

Output Parameter:

list of Inherited Parent Objects

Core\JEE\JEE.castscript

getStringProperty

Native functions declarationDescriptionCastScript file
native string getStringProperty (symbol object, stringmetamodelProperty)Description: Return full name or short name type of given object (if metamodelProperty equals identification.fullName or identification.name; see file: MetaModel\SavingFrameworkMetaModel.xml)

Input Parameters:

object, metamodelProperty

Output Parameter:

Object full name or object short name

Core\JEE\JEE.castscript

getMetaType

Native functions declarationDescriptionCastScript file
native string getMetaType (symbol object)Description: Return Metamodel type of given object

Input Parameters:

object assymbol

Output Parameter:

object type as string (Metamodel type)

Core\JEE\JEE.castscript

getType

Native functions declarationDescriptionCastScript file
native symbol getType(symbol Object)Description: Get the return type of a function or the type of a field

Input Parameters:

object

Output Parameter:

type

Core\JEE\JEE.castscript

analyzeDBQuery

Native functions declarationDescriptionCastScript file
symbol analyzeDBQuery(string queryType, string queryName, string dbRequest, symbol queryParent )Description: Analyze a given DB query whose language can be SQL, HQL or JPQL. This function will create a specific named query whose type is specified by queryType, set specific properties and create use links from the DB Named Query to the database with the modifiers Select/Insert/Update/Delete so that SQL Client metrics and quality rules will apply.

Note that:

  • it will work for SQL, HQL and JPQL and only when the type to create is CAST_SQL_NamedQuery, HIB_SQL_NAMED_QUERY, JPA_NAMED_NATIVE_QUERY, HIB_HQL_NAMED_QUERY or JPA_NAMED_QUERY; an error is generated if the DB query type is different from the types above
    •  if DBQuery type is one of CAST_SQL_NamedQuery, HIB_SQL_NAMED_QUERY, JPA_NAMED_NATIVE_QUERY then quality rules and metrics that apply on Client SQL code will apply to these objects as well as architectural quality rules.
    • if DBQuery type one of HIB_HQL_NAMED_QUERY and JPA_NAMED_QUERY only architectural quality rules will apply on it

Input Parameters:

  • queryType: type of the DB query to create, can be one of CAST_SQL_NamedQuery, HIB_SQL_NAMED_QUERY, JPA_NAMED_NATIVE_QUERY, HIB_HQL_NAMED_QUERY and JPA_NAMED_QUERY
  • queryName: name of the DB query to create
  • dbRequest: the SQL, HQL or JPQL string request
  • queryParent: the parent of the named query object to create (the XML file or the Java file in case of annotation where the named query is declared)

Output Parameter:

Returns the created Named DB query symbol and null in case of error. When the symbol that represents the named query is created, you then just need to manage links to this symbol. Depending on the situation, parametrization can be used when this name query is used as a parameter of a method or creating a direct link from the method when it is not possible and you know where this named query is called.

Core\JEE\JEE.castscript
symbol analyzeDBQuery(string queryType, string queryName, string dbRequest)Description: Analyze a given DB query whose language can be SQL, HQL or JPQL. This function will create a specific named query whose type is specified by queryType, set specific properties and create use links from the DB Named Query to the database with the modifiers Select/Insert/Update/Delete so that SQL Client metrics and quality rules will apply.

Input Parameters:

  • queryType: type of the DB query to create, can be one of CAST_SQL_NamedQuery, HIB_SQL_NAMED_QUERY, JPA_NAMED_NATIVE_QUERY, HIB_HQL_NAMED_QUERY and JPA_NAMED_QUERY
  • queryName: name of the DB query to create
  • dbRequest: the SQL, HQL or JPQL string request

Output Parameter:

Returns the created Named DB query symbol and null in case of error. When the symbol that represents the named query is created, you then just need to manage links to this symbol. Depending on the situation, parametrization can be used when this name query is used as a parameter of a method or creating a direct link from the method when it is not possible and you know where this named query is called.

Core\JEE\JEE.castscript

Analysis environment manipulation

The analysis of some frameworks may be dependent on properties. This native method allows you to set and retrieve the value of such properties during the castscript execution.

Native functions declarationDescriptionCastScript file
native void setAnalysisProperty(string key,string value)Description: Set the property with name key to value

Input Parameters:

  • the key and its value
Core\JEE\JEE.castscript
native string getAnalysisProperty(string key)Description: Get the property value which name is key

Input Parameters:

  • key

Output Parameter:

  • the property value
Core\JEE\JEE.castscript

Example

Below is an example script:

/**
* Create an EJB Session with the short name of the class = className;
* Add an attribute session-type = Stateful or Stateless according to the annotation used;
* Create a prototype link from the bean named ejbSessionName to the class className ;
* Create fireLinks from EJB client interface methods to EJB implementation class methods
*
* @param ejbSessionName: ejb session name
* @param className:  class of implementation
* @param localInterfaceName
* @param remoteInterfaceName
* @param sessionType: stateful or stateless
* @param fromAnnotation:  true if bean is defined from annotation, false otherwise (from ejb-jar.xml file)
*/

 void createEJBSession(string ejbSessionName, string className, string localInterfaceName, string remoteInterfaceName, string sessionType, boolean fromAnnotation)
{
    symbol ejbSession = findOrCreateSymbol(ejbSessionName, JV_EJB_SESSION);
    if(ejbSession == null)
    {
        exit("impossible to create the EJB Session: " + ejbSessionName);
    }
    log(DEBUG, "created JV_EJB_SESSION: " + ejbSessionName);

    setProperty(ejbSession, CAST_EJB_SessionBeanProperties_SessionType, sessionType);
    setProperty(ejbSession, CAST_EJB_EntityBeanProperties_CMPVersion, "3.0");
    symbol ejbClass = findUniqueSymbol(className, JV_CLASS);
    if(ejbClass == null)
    {
        exit("impossible to find the class: " + className);
    }

    setProperty(ejbSession, Cast_EJB_AllProperties_BeanClass, className);
    createLink(ejbSession, ejbClass, prototypeLink);
    log(DEBUG, "created link from JV_EJB_SESSION: " + ejbSessionName + " to JV_CLASS: " + className);

    if(localInterfaceName == "" && fromAnnotation)
    {
        localInterfaceName = getAnnotatedInheritImplementParents(ejbClass, "javax.ejb.Local");
        log(DEBUG, "Local interface of " + className + " is defined with interface annotation on: " + localInterfaceName);
    }

    if(localInterfaceName != "" && localInterfaceName != null)
    {
        symbol localInterface = findUniqueSymbol(localInterfaceName, JV_INTERFACE);
        if(ejbSession == null)
        {
            exit("impossible to find the interface: " + localInterfaceName);
        }

        setProperty(ejbSession, Cast_EJB_AllProperties_HomeInterface, localInterfaceName);
        createLink(localInterface, ejbSession, prototypeLink);
        createLinksBetweenMethods(localInterface, ejbClass, fireLink, false);
        log(DEBUG, "created link from Local JV_INTERFACE: " + localInterfaceName + " to JV_CLASS: " + className);
    }

    if(remoteInterfaceName == "" && fromAnnotation)
    {
        remoteInterfaceName = getAnnotatedInheritImplementParents(ejbClass, "javax.ejb.Remote");
        log(DEBUG, "Remote interface of " + className + " is defined with interface annotation on: " + remoteInterfaceName);
    }

    if(remoteInterfaceName != "" && remoteInterfaceName != null)
    {
        symbol remoteInterface = findUniqueSymbol(remoteInterfaceName, JV_INTERFACE);
        if(ejbSession == null)
        {
            exit("impossible to find the interface: " + remoteInterfaceName);
        }

        setProperty(ejbSession, Cast_EJB_AllProperties_RemoteInterface, remoteInterfaceName);
        createLink(remoteInterface, ejbSession, prototypeLink);
        createLinksBetweenMethods(remoteInterface, ejbClass, fireLink, true);
        log(DEBUG, "created link from Local JV_INTERFACE: " + remoteInterfaceName + " to JV_CLASS: " + className);
    }
}
 
  • No labels