This is a sample of a Java application powered by the e-Biz Impact runtime engine. Any custom function that is defined as public can be accessed by the e-Biz Impact bus. This sample implements DelAimInterface that defines the servproc and servayt functions, called by SFM to deliver transactions to an end point.
/*
* PluginApplicationSample.java
*
* Created June 18, 2004, 10:47 AM
*/
package samples.plugin;
import com.sybase.impact.messaging.*;
import com.sybase.impact.plugin.*;
/**
* This class is an example of a Java application that is powered by the e-Biz* Impact runtime engine. Any custom function that is defined public can be
* accessed by the e-Biz Impact bus. This sample implements DelAimInterface that
* defines the servproc and servayt functions, called by sfm for delivering
* transactions to an end point.
*
* @author hlebegue
*
* @version 1.0
*
* @since 1.0
*/
public class PluginDelAimSample extends Application implements DelAimInterface{
/**
* Creates a new instance of <code>PluginDelAimSample.</code>
*/
public PluginDelAimSample() {
}
/**
* Standard entry points used by the bus to initialize the application.
* Implementing this function is optional.
*
* @return Positive or null for success.
*/
public int initialize(){
erm("Delivery Aim is Initialized");
return 1;
}
/**
* Standard entry points uses by the bus to Initialize the application.
* Implementing this function is optional.
*
* @return Positive or null for success.
*/
public void deinitialize(){
erm("Delivery Aim is Deinitialized");
}
/**
* Called by an SFM application. A consumer is expected to return 1
* if ready; otherwise negative or null. A consumer is also expected to set up
* the last transaction ID into <code>sAytStat</code> to inform SFM of the last
* known good transaction serial number.
*
* @param oArguments A server argument wrapper that contains all the function
* arguments.
*
* @return Value greater that one if success; otherwise null or negative.
*/
public int servayt(ServAytArguments, Arguments) {
erm("\n" + Arguments.toString());
return 1;
}
/**
* Called by an SFM application and correspond to the server processing a
* transaction. The consumer is expected to return positive for success, -1 for
* failure, request a new retry, or -999 to cancel this transaction and move on
* to the next. The consumer is expected to dispatch the transaction data
* buffer and if it succeeds, save the transaction serial number into a file to
* allow <code>servayt</code> to read the number.
*
* @param oArguments A <code>servproc</code> argument wrapper that contains all
* the function arguments.
*
* @return Value greater that one if success; otherwise null or negative for
* failure. Special consideration on -999 for cancel or -998 for skip.
*/
public int servproc(ServProcArguments oArguments) {
erm("\n" + oArguments.toString());
Arguments.errorText="kjkjbfds";
return 1;
}
}
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |