JCAPSMentor - Java CAPS Unleashed - Basic to Expert Discussions

JCAPSMentor - Basic to Expert Discussions Jcaps, SOA, SUN, Netbeans, Enterprise, Sun System Application Server, Java, J2EE, EAI, JBI, Composite Application Platform Suite, EDI, SeeBeyond, HL7, Singapore

 
  FOLLOW US!
  JCAPSMentor

Visit us at Facebook



 

  Visitors LIVE! Stats
 
  Covering the World!
 
Invoking / Calling Procedure (within Database Package) from JCAPS
Sometime packaging all the sql into a procedure helps us to get rid of the usual Oracle/SQL OTD bugs. The smartest way is to collect all the information which we require in a jcd and then trying to write an optimized query which fetches the results as per out requirement.

Doing such tasks with the help of Oracle/SQL OTD Wizard looks easy initially but can be painful and tedious in case change-requests drops to your email after completion of the first phase of your project :)

Following example illustrates how we can call a procedure from JCD:



Writing and executing sql queries/ procedure calls in Collaboration in core java gains a lot of flexibity in terms of changes later on. Also we can create dynamic queries which i feel is not possible to create with the help of Oracle/SQL OTD.


Labels: , , , , , , , ,

 
Retrieving Host Name in JCAPS
Do you have a requirement which needs to toggle the directory, or may be change some value inside the collaboration depending on the server where the application is deployed.

We can easily retrieve the HostName using java.net API as shown below: (Retrieving Host Name in JCD)




- Manesh A. K.
JCAPSMentor.com

Labels: , , , ,

 
Log4j in JCAPS
Following is the Steps to implementation the log4j in JCAPS

Step 1:
Import the log4j jar file in to your Project by
Right click on the project select - > import then -> file we chose the
-> jar file (log4j) and select import.

Step 2:
Then import the jar file into your JCD where you want to implement the
log4j is by
Click on Import JAR file on JCD console -> Add ->and select the jar
file that had been imported into you project.

Step 3:
Then code import command statement in the JCD.
import org.apache.log4j.*;

Step 4:
Declare the object for the logger before the main method, as below.
static Category logger = Category.getInstance( "" );

Step 5:
In the Main method code specific path and the log4j properties file, as bel
ow.
PropertyConfigurator.configure( "" );

Step 6:
See that you had configured the log4j property file; your log4j should
look like this

log4j.category.jcdManesh=INFO,dest1

log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=C:/Properties/InstJava.log
log4j.appender.dest1.MaxFileSize=10MB
log4j.appender.dest1.MaxBackupIndex=1
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n

Sample implementation of the log4j JCD looks like this


Code:
package Project1;

import org.apache.log4j.*;

public class jcdManesh
{

static Category logger = Category.getInstance( "jcdManesh" );

public com.stc.codegen.util.CollaborationContext collabContext;

public com.stc.codegen.util.TypeConverter typeConverter;

public void receive( com.stc.connector.appconn.file.FileTextMessage inp
ut )
throws Throwable
{
PropertyConfigurator.configure(
"C:/JavaCAPS513/logicalhost/log4j.properties" );
logger.info( ">>>>>> START <<<<<<" ); logger.info( ">>>>>> END <<<<<<" ); } }



Sample log4j.properties for the above JCD looks like this


Code:
log4j.category.jcdManesh=INFO,dest1

log4j.appender.dest1=org.apache.log4j.RollingFileAppender
log4j.appender.dest1.File=C:/Properties/InstJava.log
log4j.appender.dest1.MaxFileSize=10MB
log4j.appender.dest1.MaxBackupIndex=1
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %c{1} [%p] %m%n



Note: You can download the Log4J from the following website:
http://logging.apache.org/log4j/1.2/download.html

Labels: , , , ,

 
BatchInbound File Name Pattern - Working with JCAPS regular expression
Sometimes providing a pattern to any of the Batch Adapter in JCAPS can be a pain and involves a lot of Googling for an regex which actually would work for us. It may look simple intially but writing a wrong file regex pattern can cause dangling exception at runtime.

In case you are looking for file pattern which has to read any file with a particular extension like .cntl, you can use :
.*\.cntl


or may you need to read any file from a particular directory do use:
.*\.*$


The above file patterns have worked for JCAPS 5.1.X and JCAPS 6.

Incase you are looking for a specific pattern as per your requirement do write to me at manesh@jcapsmentor.com

Also, following are some sites which can help you to check the regex which you have thought about to implement in the Batch Adapter as patterns:

http://www.myregextester.com/
http://www.fileformat.info/tool/regex.htm

Regards,
Mak

Labels: , , , ,

 
JCAPS 5.x/6 TOP 8 KNOWN ERRORS and SOLUTIONS

Labels: , ,

 
Sun Certified Java CAPS Integrator (310-502) Preparation Material (Submitted by Manesh Koovappillil)
Java Composite Application Platform Suite
Sun Certified Java CAPS Integrator (310-502)

Jcaps SCJCI Exam Preparation - Interview Q_By_Manesh_Loovappillil
 
 
Manesh Abhimanyu
Manesh is a Sr. EAI Consultant, at present working in Singapore (Little Red Dot).

His focus is in the areas of SOA, ESB and Enterprise Architecture Management.

Contact him via email (mak2powerATyahoo.co.in)

Menu
Archives
Links
Website developed & maintained by

Manesh Abhimanyu K. (Mak)

Click here to contact Manesh









Free Domain CO.NR