Java Code, Java method, Java Global Instance

Java Code, Java method, Java Global Instance

book

Article ID: KB0092226

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Resolution:

1. Can a Java Code activity class implement a Java interface or extend a superclass? It does not seem to be possible when we try it. Any changes made to the class declaration get reset as soon as the code is compiled.

ANS: No. Java code activity do not let you change the package name or let you implement an interface or extend another class.

2. How can you amend the package name for a Java Code activity class?

ANS: If you want to use your own package name, then you may have to use "Java Method" activity. Java method activity lets you create you own class and invoke the methods of that class from BW process. Please go thru the documentation related to "Java Method" activity, it should solve this problem.


3. Does BW create a new instance of the class for every message processed by the activity?

ANS: Yes. If you do not want to create a new instance of class for each new job/process instance, please use "Java Global Instance" resource. This resource lets you share a particular java instance across different processes.


4. Can BW cache and reuse an existing instace of class for a Java Code activity?

ANS: "Java Global Instance" and "Java Method" combination will let you achieve this.


KEYWORDS: JAVA CODE, METHOD, GLOBAL INSTANCE

Issue/Introduction

Java Code, Java method, Java Global Instance