Use the MessageFormatter.java file under <AppServer location>/repra/sample/client directory as a sample of the customized message formatter. The sample uses the DBEventParser utility to retrieve data and metadata from the replication event. For detailed information see “Using the DBEventParserFactory”.
Compiling the customized formatter processor
Change to the directory where your formatter processor is located.
cd /work/custom
Use the Java compiler, the -classpath parameter, and the required libraries to compile your customized class.
mkdir customclasses /usr/jdk141/bin/javac -classpath.:/opt/sybase/EAServer/repra/ lib/repraconn.jar -d customclasses com/mycompany/SampleFormatter.java
Verify the compilation.
When the compilation finishes without any error messages, go to the customclasses directory to verify that the SampleFormatter.class exists in com/mycompany.
Building the runtime environment for the customized formatter processor
To include the customized formatter processor in a jar file, go to the customclasses directory and build a jar format from the com directory. Otherwise, you can use the directory path for setting up your environment.
Sybase recommends that you use the jar file format for your customization.
Build a jar file:
cd /work/custom/customclasses /usr/jdk141/bin/jar -cf mycustom.jar com
Shut down and restart your application server.
For EAServer:
Copy the jar file, or the directory structure containing the Java classes created from the previous step, to the EAServer java/classes directory.
Run EAServer and connect to it from EAServer Manager.
If you are using the jar file, go to the Servers/<your server> directory and select Server Properties. Select the Java Classes tab. Click Add to add the name of the jar file, such as mycustom.jar, and click OK.
Shut down the EAServer, and restart it to activate the new environment change.
For WebLogic:
Shut down the application server if it is running.
Add the full path of mycustom.jar or the customclasses directory to the end of the CLASSPATH definition in $BEA_HOME/repra/bin/repra_env.sh:
set CLASSPATH=/work/custom/customclasses:$CLASSPATH or set CLASSPATH=/work/custom/customclasses/mycustom.jar;$CLASSPATH
Start the WebLogic Server to activate the new environment change.