MIF Project - LLD - Java
MIF Project - LLD - Java
Revision History
Affected Groups
Table of Contents
Detailed Design DD MIF Enhancement_v1.0.doc
1. INTRODUCTION.................................................................................................................................. 4
1.1. BACKGROUND.....................................................................................................................................................4
1.2. SCOPE AND OBJECTIVES.....................................................................................................................................4
2. DETAILED DESIGN............................................................................................................................. 5
2.1. MODULE NAME AND DESCRIPTION....................................................................................................................5
2.1.1. Design Alternatives.................................................................................................................... 5
2.1.2. Design Details........................................................................................................................... 7
2.1.3. External Interfaces................................................................................................................... 17
2.1.4. Assumptions............................................................................................................................ 18
3. CRITICAL FUNCTIONS AND FOCUS FOR TESTING.....................................................................18
4. LIMITATIONS.................................................................................................................................... 18
5. TRACEABILITY TO REQUIREMENTS............................................................................................. 18
6. Acronyms and Glossary..................................................................................................................... 18
Detailed Design DD MIF Enhancement_v1.0.doc
1. Introduction
1.1. Background
MIF stands for Message IF. MIF is an interface which lies between the
MQ adapter and the applications. MIF has the capability to support the
environments like Win NT/2000, HP-UX, and AIX. MIF is capable of
supporting the languages like C++, Java, COM interfaces, Oracle PL/SQL.
MIF uses separate libraries / DLL’s to communicate with MQ directly.
The IPA adapter design pattern, which then only requires the server
developer to write the “native object”, is generally well-suited to
services which will take advantage of message queuing in a
straightforward way. Because the MIF does not append any mandated header
or trailer to messages, it can be used by clients to request services
that are not MIF aware.
Scope
Requirements Analysis. This includes an evaluation of the existing
EPP features and impact analysis.
Complete Design and Coding of the system.
End to end Unit Testing and System testing.
Integration testing with external systems.
Support & fixes for acceptance testing.
Detailed Design DD MIF Enhancement_v1.0.doc
Objectives
The objective of this design document is to add a plugin framework
to the existing MIF.
The plugin framework will be given the capability to load and
initialize the plugin’s dynamically during runtime.
The MIF plugin system will read the available plugin’s from the
configuration XML file for each service that exists with a
particular MIF instance.
In memory and disk based caching of the configuration file should
be included into the MIF system separate for every service.
Detailed trace log functionality should be included as part of the
MIF system.
XSL Transformation of the incoming XML messages on demand should
be provided.
2. Detailed Design
The configuration file is a XML file and the adapter will be using
the flexibility of the XML parsers for retrieving the
configuration details for each service associated with a
particular instance of MIF.
SAX Parser (xalan) will be used for the parsing XML configuration
files in java.
PLUGIN FRAMEWORK:
There are three service types that the MIF interface work with,
Data Flow,
- Data comes to MIF from the source application.
- Data which comes to MIF will be passed to each loaded plugin.
- Functionality of each plugin will be applied to the data.
- Resultant data will be passed back to the MIF system from
each loaded plugin.
- Data is send to the target queue.
Data Flow,
- Data comes to MIF from the source queue.
- Data which comes to MIF will be passed to each loaded plugin.
- Functionality of each plugin will be applied to the data.
- Resultant data will be passed back to the MIF system from
each loaded plugin.
- Data is send to the target application.
Along with the other configuration details cached in the Map for
each service, the plugin details also will be cached for each
service.
XSLT Transformation:
The disk based in memory caching will be done for each service
depending on the <ReCache_Invocations> tag in configuration XML
file. This will be particular for a specific service associated
with a MIF instance.
Detailed Design DD MIF Enhancement_v1.0.doc
<ReCache_Invocations># of invocations</ReCache_Invocations>
1.1. Object SERVICE = Obtain the service that should process that
message.
/*
ReCache_Invocation tag may not present for all services. This is
considered as this is a new functionality and in the existing system
this tag is not present.
*/
1.4. ReCache_Invocation=configuration.READ(“ReCache_Invocation”).
/*
invocation_counter will be the tracker for the number of messages that
comes through a particular service.
*/
1.6. Get invocation_counter from the SERVICE.
The trace log will now include the following scenarios which comes
in different combinations in the trace log,
Shown is a matrix that shows the dependency of the log level with
the log scenarios,
API exposed,
MIFLogger.log (String Message, String Log_Type, FileWriter _MQfr)
/*
Function which will be called by the classes when they need the trace
log. Filewriter will be specific for each and every service.
*/
Function log (Messge:String, Category:int, FileWriter filewriter)
{
/*
The log_level/category matrix is represented in a two dimensional
array.
*/
String LogEnabled[4][6] =
{
START, DISABLED, DISABLED, ERROR, DISABLED, END
START, DISABLED, DISABLED, ERROR, SUCCESS , END
START, DISABLED, WARN , ERROR, SUCCESS , END
START, INFO , WARN , ERROR, SUCCESS , END
}
/*
Read the LOG_LEVEL from the configuration cache.
*/
LOG_LEVEL = READ (“LOG_LEVEL”)
/*
If the category is not disabled in the matrix, then print the log
message to the log file.
*/
If LogEnabled[LOG_LEVEL][Category] not equals “DISABLED”
Then
filewriter.write(printTimeStamp()+Seperator+ LogEnabled[LOG_LEVEL]
[Category]+Seperator+Message)
}
NOTE: If there are lots of threads acting on the same services, synchronization has to
be done which will bring down the performance as a lot of I/O operations has to be
done. While one thread works on I/O other threads has to wait. It may not be a good
solution for the online communications.
PLUGIN FRAMEWORK:
The configuration is read for each service when the data starts
flowing through the MIF for that service.
For each of the services, when MIF reads the first message the
configuration is cached into a centralized Map with the service
name as its key.
The plugin details are taken into the configuration detail Map
represented as string.
Plugin Framework:
The plugin handler will take the service name and message as
parameters. The handler will take the plugin details for that
particular service, loads and initialize the plugin utilities
present for that service.
The plugin utility classes are loaded, initialized and the same
will be cached for a particular service whenever the first
message of that service flows through the MIF system and the
clone of that object is given to the plugin handler. For the
Detailed Design DD MIF Enhancement_v1.0.doc
The caching and cloning of the plugin utility objects are done
to lower the cost involved in initializing the objects.
The plugin handler will now have the plugin details and pass
the message through all the plugin utilities and the resultant
message is passed to the MIF system.
Diagram below shows the data flow through the plugin utilities.
The plugin framework will invoke the plugin object for the
service for invocation flow scenarios (PreSend, PreRecieve,
PostSend, PostRecieve) as per the configuration details for the
specific service.
Detailed Design DD MIF Enhancement_v1.0.doc
Plugin Utilities:
The clone method will have the implementation for cloning the for
all plugin utility object. As mentioned above the cloning is done
to reduce the cost of initializing the plugin object for the
sequential incoming data.
Plugin Configuration:
XSLT Transformation:
Package com.mpb.mif.util.*;
……
Public class DefaultXSLTTransform extends
AbstractMIFPluginUtil
{
Public String execute (String data)
{
//implementation goes here
}
}
Detailed Design DD MIF Enhancement_v1.0.doc
The Default XSLT plugin will be given with the MIF in msgif.jar.
If a customized XSLT transformation utility has to be build, above
mentioned procedure has to be followed and the class should be
placed in the predefined path in the server.
<Plugin>
<Util>
!Name of Class to load
<UtilName>com.pb.msgif.util.DefaultXSLTTransformUtil</UtilName>
<PreSend> !Contain list of methods to invoke before sending msg
<Method>execute</Method> ! method to invoke
</PreSend>
</Util>
<Util>
!Name of Class to load
<UtilName>com.pb.msgif.util.DefaultXSLTTransformUtil</UtilName>
<PostRcv> !Contain list of methods to invoke after recving msg
<Method> execute</Method>! method to invoke
</PostRcv>
</Util>
</plugin>
2.1.4. Assumptions
4. Limitations
Data will not be in human readable format in target service
component (MQ-Series and HTTP Web server) after data encryption
and compression. It will create additional maintenance overhead
for administrator.
Detailed Design DD MIF Enhancement_v1.0.doc
5. Traceability to Requirements
Document reference Id & Description: (Doc Id from which this document is derived)