com.candle.roma.kxc
Class RomaContext

java.lang.Object
  |
  +--com.candle.roma.kxc.RomaContext
Direct Known Subclasses:
RomaBusinessElement, RomaClient

public abstract class RomaContext
extends java.lang.Object

This is a base class that encapsulates the common options between a RomaClient and a RomaBusinessElement.

See Also:
RomaClient, RomaBusinessElement

Constructor Summary
RomaContext()
           
 
Method Summary
 void closeTheme(RomaTheme theme)
          Closes a Roma theme.
 void commitLocal()
          Commits any local Roma transactions outstanding on current thread.
 RomaTheme copyTheme(RomaTheme theme)
          Creates a new theme ID with exactly the same information as the existing theme.
 void deleteStorageQueue(java.lang.String queueName)
          Deletes storage queue.
 void disconnect()
          Terminates the connection to Roma (if connected).
 RomaTheme insertWorkflow(RomaTheme theme, RomaBusinessService bs, boolean close)
          Inserts the business service into the workflow of the theme immediately after the current location in the workflow.
 boolean isConnected()
          Returns true if connection established, false otherwise.
 RomaTheme mergeEteInfo(RomaTheme theme, RomaEteInfo ete, boolean close)
          Merges the end-to-end and in-flight information with the end-to-end and in-flight information that already exists for the message and can be extracted with the RomaBusinessElement.queryTheme(RomaTheme) or RomaClient.queryTheme(RomaTheme) method.
 void putException(RomaExceptionMessage msg)
          Writes an exception message to the exception message queue with default RomaExceptionOptions.
 void putException(RomaExceptionMessage msg, RomaExceptionOptions opt)
          Writes an exception message to the exception message queue.
 RomaTheme replaceWorkflow(RomaTheme theme, RomaBusinessService bs, boolean close)
          Replaces all remaining servers in the workflow with the business service, leaving the client at the end of the workflow.
 void reportError(RomaExceptionMessage msg, RomaInteger carriedOutActions)
          Invoke an error analysis routine directly with default RomaReportOptions.
 void reportError(RomaExceptionMessage msg, RomaInteger carriedOutActions, RomaReportOptions opt)
          Used to invoke an error analysis routine directly.
 void rollbackLocal()
          Rolls back any local Roma transactions outstanding on the current thread.
 void sendAlert(RomaLogInformation info)
          Sends an alert message.
 void setBusinessFlow(RomaBusinessFlow bf)
          Sets the business flow information on the context.
static void writeLog(RomaLogInformation info)
          Writes entry to the system log.
static void writeSysLog(RomaLogInformation info)
          Writes entry to the system log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RomaContext

public RomaContext()
Method Detail

isConnected

public boolean isConnected()
Returns true if connection established, false otherwise.

commitLocal

public void commitLocal()
                 throws RomaError
Commits any local Roma transactions outstanding on current thread. This method doesn't rely on the context having been set in the syncpoint definition.
Throws:
RomaError - is thrown on error.

rollbackLocal

public void rollbackLocal()
                   throws RomaError
Rolls back any local Roma transactions outstanding on the current thread. This method doesn't rely on the context having been set in the syncpoint definition, it always rollbacks the Roma local transaction.
Throws:
RomaError - is thrown on error.

deleteStorageQueue

public void deleteStorageQueue(java.lang.String queueName)
                        throws RomaError
Deletes storage queue. (temporarily removed. RCH)
Parameters:
queueName - name of storage queue to delete.
Throws:
RomaError - reports errors returned by the Roma pipe.

closeTheme

public void closeTheme(RomaTheme theme)
                throws RomaError
Closes a Roma theme.
Parameters:
theme - a Roma theme previously allocated for this context. If the operation is successful this will be reset to null.
Throws:
RomaError - is thrown on error.

disconnect

public void disconnect()
                throws RomaError
Terminates the connection to Roma (if connected).
Throws:
RomaError - is thrown on error.

putException

public void putException(RomaExceptionMessage msg,
                         RomaExceptionOptions opt)
                  throws RomaError
Writes an exception message to the exception message queue.
Parameters:
msg - the exception message.
opt - put options associated with the operation.
Throws:
RomaError - is thrown on error.

putException

public void putException(RomaExceptionMessage msg)
                  throws RomaError
Writes an exception message to the exception message queue with default RomaExceptionOptions.
Parameters:
msg - the exception message.
Throws:
RomaError - is thrown on error.

reportError

public void reportError(RomaExceptionMessage msg,
                        RomaInteger carriedOutActions,
                        RomaReportOptions opt)
                 throws RomaError
Used to invoke an error analysis routine directly.
Parameters:
msg - the exception message.
opt - options associated with the invocation.
carriedOutActions - actions carried out
Throws:
RomaError - is thrown on error.

reportError

public void reportError(RomaExceptionMessage msg,
                        RomaInteger carriedOutActions)
                 throws RomaError
Invoke an error analysis routine directly with default RomaReportOptions.
Parameters:
msg - the exception message.
carriedOutActions - actions carried out
Throws:
RomaError - is thrown on error.

writeLog

public static void writeLog(RomaLogInformation info)
                     throws RomaError
Writes entry to the system log.
Parameters:
info - information for the log.
Throws:
RomaError - is thrown on error.

writeSysLog

public static void writeSysLog(RomaLogInformation info)
                        throws RomaError
Writes entry to the system log.
Parameters:
info - information for the log.
Throws:
RomaError - is thrown on error.

sendAlert

public void sendAlert(RomaLogInformation info)
               throws RomaError
Sends an alert message.
Parameters:
info - the alert.
Throws:
RomaError - is thrown on error.

insertWorkflow

public RomaTheme insertWorkflow(RomaTheme theme,
                                RomaBusinessService bs,
                                boolean close)
                         throws RomaError
Inserts the business service into the workflow of the theme immediately after the current location in the workflow.
Parameters:
theme - Source theme
bs - Business Service to insert
close - If true, closes the source theme
Returns:
New theme with inserted workflow
Throws:
RomaError - is thrown if the operation fails

replaceWorkflow

public RomaTheme replaceWorkflow(RomaTheme theme,
                                 RomaBusinessService bs,
                                 boolean close)
                          throws RomaError
Replaces all remaining servers in the workflow with the business service, leaving the client at the end of the workflow.
Parameters:
theme - Source theme
bs - Business Service replacing the workflow
close - If true, closes the source theme
Returns:
New theme with replaced workflow
Throws:
RomaError - is thrown if the operation fails

setBusinessFlow

public void setBusinessFlow(RomaBusinessFlow bf)
                     throws RomaError
Sets the business flow information on the context. This information will be included into the workflow route information on the next replaceWorkflow(RomaTheme,RomaBusinessService,boolean) or insertWorkflow(RomaTheme,RomaBusinessService,boolean) calls.
Parameters:
bf - Business Flow information
Throws:
RomaError - is thrown if the operation fails

copyTheme

public RomaTheme copyTheme(RomaTheme theme)
                    throws RomaError
Creates a new theme ID with exactly the same information as the existing theme.
Parameters:
theme - Source theme
Returns:
Copy of the specified theme
Throws:
RomaError - is thrown if the operation fails

mergeEteInfo

public RomaTheme mergeEteInfo(RomaTheme theme,
                              RomaEteInfo ete,
                              boolean close)
                       throws RomaError
Merges the end-to-end and in-flight information with the end-to-end and in-flight information that already exists for the message and can be extracted with the RomaBusinessElement.queryTheme(RomaTheme) or RomaClient.queryTheme(RomaTheme) method.
Parameters:
theme - Source theme
ete - End-to-end and in-flight information to merge into the specified theme
close - If true, closes the source theme
Returns:
New theme with merged ETE information
Throws:
RomaError - is thrown if the operation fails