284 WebSphere Business Integration Adapters
Example 17-4 shows the deleteEvents() method implementation for the
RMEventStore.
Example 17-4 The deleteEvents() method.
public void deleteEvent(String eventID) throws DeleteFailedException {
RMLogger.trace(CWConnectorUtil.LEVEL4, "Entering deleteEvent");
// obtain connection from connection pool
RMServerRMIInterface connection;
try {
connection = (RMServerRMIInterface) connectionPool.getConnection();
} catch (Exception e) {
CWConnectorExceptionObject c = new CWConnectorExceptionObject();
c.setMsg("Unable to obtain connection to the application");
c.setStatus(CWConnectorConstant.APPRESPONSETIMEOUT);
throw new DeleteFailedException(c);
}
try {
// delete event from event table
RMDataImplementation aDataImpl =
getRMDataImplementationInstance(eventID);
connection.deleteObject(aDataImpl);
// free up connection from connection pool
connectionPool.releaseConnection(connection);
} catch (Exception e) {
CWConnectorExceptionObject c = new CWConnectorExceptionObject();
c.setMsg("Unable to delete event from the event table");
c.setStatus(CWConnectorConstant.APPRESPONSETIMEOUT);
throw new DeleteFailedException(c);
}
RMLogger.trace(CWConnectorUtil.LEVEL4, "Exiting deleteEvent");
}