Package com.softwaremining.logic
Class ServicesFactory
java.lang.Object
com.softwaremining.logic.ServicesFactory
Manages Creation and Cancellation of programs using Factory pattern.
Additionally manages loading of Transaction-Id=ProgramName for CICS applications from file services.properties
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
cancelCicsCalledPrograms
(IBaseService progInstance) static void
cancelService
(String className, IBaseService parent) remove service from cached program.static BaseService
create
(ISMObject classNameVar, IBaseService parent) create an instance of the target class.static BaseService
create
(String _className, IBaseService parent) create an instance of the target class.static void
This method is to allow manual forcing to release of the memory associated with a session.static Properties
getNameToServiceMappingProperties
(boolean throwExceptionIfNotFound) Used internally by CICS applications - Attempt to locate and load "services.properties" This property file will contain a mapping between name of a program, and an equivalent java-class.static String
static void
removeSession
(BaseService parent) For internal use only.
Used by Conversational Servlet engine once application has finishedstatic void
transferSessionId
(Long prevSessionId, Long newSessId)
-
Field Details
-
totalRuntime
public static long totalRuntimefor internal use only ... profiling information
-
-
Constructor Details
-
ServicesFactory
public ServicesFactory()
-
-
Method Details
-
transferSessionId
-
forceReleaseSessionId
This method is to allow manual forcing to release of the memory associated with a session. In some cases, depending on how programs are started and released, some programs may never have been removed, causing a memory leak / ever increasing memory requirement by the runtime application.- Parameters:
sid
-
-
create
create an instance of the target class. This is used during translation of cobol's CALL Statements.
NOTE: Unless the ServicesFactory.cancel method is used to cancel the called program (by the caller), the system will cache the called-program and the next call to ServicesFactory.create (from same session) will return the same instance of the called-program, with all the data preserved.- Parameters:
parent
- : Calling object Used to retrieve Session information, screen information, etc._className
- : full packageName and class name. E.g. com.softwaremining.examples.Class1, or
just the name e.g. CLASS1 - in this case the system will use the "parent" package, and capitalize "CLASS1" to produce com.softwaremining.examples.Class1 .
Alternatively the package name may supplied by Config.EXTERNAL_SERVICES_PACKAGE_NAME (from entry in softwaremining.properties).- Returns:
-
create
create an instance of the target class. This is used during translation of cobol's CALL Statements.
NOTE: Unless the ServicesFactory.cancel method is used to cancel the called program (by the caller), the system will cache the called-program and the next call to ServicesFactory.create (from same session) will return the same instance of the called-program, with all the data preserved.- Parameters:
_className
- : full packageName and class name. E.g. com.softwaremining.examples.Class1, or
just the name e.g. CLASS1 - in this case the system will use the "parent" package, and capitalize "CLASS1" to produce com.softwaremining.examples.Class1 .
Alternatively the package name may supplied by Config.EXTERNAL_SERVICES_PACKAGE_NAME (from entry in softwaremining.properties).parent
- : Calling object Used to retrieve Session information, screen information, etc.- Returns:
-
cancelService
remove service from cached program. Next call to ServicesFactory.create will create a fresh instance of the program- Parameters:
className
-parent
-
-
cancelCicsCalledPrograms
-
removeSession
For internal use only.
Used by Conversational Servlet engine once application has finished -
getNameToServiceMappingProperties
Used internally by CICS applications - Attempt to locate and load "services.properties" This property file will contain a mapping between name of a program, and an equivalent java-class.
for example:
prog1=Program1
prog2=Program2- Returns:
-
printStats
-