com.candle.roma.kxc
Class RomaBusinessElement

java.lang.Object
  |
  +--com.candle.roma.kxc.RomaContext
        |
        +--com.candle.roma.kxc.RomaBusinessElement

public class RomaBusinessElement
extends RomaContext

This class allows an application to instantiate a server-side connection to the Roma network as a Roma Business Element.

A Business Element typically receives requests from a Client and issue Responses.

A single application is allowed to instantiate multiple objects of the Business Element class.

The Business Element class be extended by an application to providing a derived class which may override createRequest() for each type of request to be distinguished.

See Also:
RomaBeRequest

Constructor Summary
RomaBusinessElement()
          Constructs a RomaBusinessElement object but does not attach the Business Element to the Roma network.
RomaBusinessElement(java.lang.String name)
          Constructs and connects the new Business Element to the Roma network.
RomaBusinessElement(java.lang.String name, int opts)
          Constructs and connects a Business Element to the Roma network.
RomaBusinessElement(java.lang.String name, int opts, RomaSecurityDef sec)
          Constructs and connects a Business Element to the Roma network.
RomaBusinessElement(java.lang.String name, int opts, RomaSecurityDef sec, java.lang.String modelQName)
          Constructs and connects a Business Element to the Roma network.
 
Method Summary
 RomaTheme buildTheme(RomaTheme theme, RomaThemeInfo info, int options, boolean close)
          Creates a new theme from the source theme and the theme details.
 void connect(java.lang.String name)
          Attaches a named BusinessElement to the Roma network.
 void connect(java.lang.String name, int opts)
          Attaches a named BusinessElement to the Roma network.
 void connect(java.lang.String name, int opts, RomaSecurityDef sec)
          Attaches a named BusinessElement to the Roma network.
 void connect(java.lang.String name, int opts, RomaSecurityDef sec, java.lang.String modelQName)
          Attaches a named BusinessElement to the Roma network.
protected  RomaBeRequest createRequest(RomaBeRequest request)
          Unmarshal a retrieved request.
 RomaBeRequest get()
          Gets a client request using default get options, i.e.
 RomaBeRequest get(RomaGetOptions opt)
          Gets a client request according to the supplied get options.
 RomaBeRequest get(RomaGetOptions opt, byte[] msgBuf, RomaInteger msgBufSize)
          Gets a client request according to the supplied get options.
 RomaBeRequest get(RomaGetOptions opt, byte[] msgBuf, RomaInteger msgBufSize, byte[] tagBuf, RomaInteger tagBufSize)
          Gets a client request according to the supplied get options.
 RomaMessageInfo interpretMessage(RomaBeRequest msg, int options)
          Returns detailed information on the specified message.
 boolean isTermIndicator()
           
 void put(RomaBeResponse resp)
          Issues a response to a Client request.
 RomaThemeInfo queryTheme(RomaTheme theme)
          Returns information on the specified theme.
 
Methods inherited from class com.candle.roma.kxc.RomaContext
closeTheme, commitLocal, copyTheme, deleteStorageQueue, disconnect, insertWorkflow, isConnected, mergeEteInfo, putException, putException, replaceWorkflow, reportError, reportError, rollbackLocal, sendAlert, setBusinessFlow, writeLog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RomaBusinessElement

public RomaBusinessElement()
Constructs a RomaBusinessElement object but does not attach the Business Element to the Roma network.

RomaBusinessElement

public RomaBusinessElement(java.lang.String name)
                    throws RomaError
Constructs and connects the new Business Element to the Roma network. Uses default values for the application options (APP_NONE) and security options (null) associated with Business Element.
Parameters:
name - name of the Business Element
Throws:
RomaError - is thrown on connection failure.

RomaBusinessElement

public RomaBusinessElement(java.lang.String name,
                           int opts)
                    throws RomaError
Constructs and connects a Business Element to the Roma network. Takes application options associated with Business Element. See RomaContext for information on valid application options.
Parameters:
name - name of the Business Element.
opts - application options
Throws:
RomaError - is thrown on connection failure.
See Also:
RomaContext

RomaBusinessElement

public RomaBusinessElement(java.lang.String name,
                           int opts,
                           RomaSecurityDef sec)
                    throws RomaError
Constructs and connects a Business Element to the Roma network. Takes application options and security options associated with Business Element. See RomaContext for information on valid application options.
Parameters:
name - name of the Business Element.
opts - application options
sec - security options
Throws:
RomaError - is thrown on connection failure.
See Also:
RomaContext

RomaBusinessElement

public RomaBusinessElement(java.lang.String name,
                           int opts,
                           RomaSecurityDef sec,
                           java.lang.String modelQName)
                    throws RomaError
Constructs and connects a Business Element to the Roma network. Takes application options, security options and model queue associated with Business Element. See RomaContext for information on valid application options.
Parameters:
name - name of the Business Element.
opts - application options.
sec - security options.
modelQName - model the queue on this when creating.
Throws:
RomaError - is thrown on connection failure.
See Also:
RomaContext
Method Detail

connect

public void connect(java.lang.String name)
             throws RomaError
Attaches a named BusinessElement to the Roma network. Uses default values for the application options (APP_NONE) and security options (null) associated with Business Element.
Parameters:
name - name of the Business Element.
Throws:
RomaError - is thrown on operation failure.

connect

public void connect(java.lang.String name,
                    int opts)
             throws RomaError
Attaches a named BusinessElement to the Roma network. Takes application options and security options associated with the Business Element.
Parameters:
name - name of the Business Element
opts - application options
Throws:
RomaError - is thrown on operation failure.

connect

public void connect(java.lang.String name,
                    int opts,
                    RomaSecurityDef sec)
             throws RomaError
Attaches a named BusinessElement to the Roma network. Takes application options and security options associated with the Business Element.
Parameters:
name - name of the Business Element
opts - application options
sec - security options
Throws:
RomaError - is thrown on operation failure.

connect

public void connect(java.lang.String name,
                    int opts,
                    RomaSecurityDef sec,
                    java.lang.String modelQName)
             throws RomaError
Attaches a named BusinessElement to the Roma network. Takes application options and security options associated with the Business Element.
Parameters:
name - name of the Business Element
opts - application options
sec - security options
modelQName - model queue name
Throws:
RomaError - is thrown on operation failure.

put

public void put(RomaBeResponse resp)
         throws RomaError
Issues a response to a Client request. This method calls the RomaBeResponse class' marshalResponse() method before issuing the response. The RomaBeResponse instance is updated with the generated theme and/or the msgId and correlation id if the user has not specified them on the request.
Parameters:
resp - Business Element response
Throws:
RomaError - is thrown on operation failure.
See Also:
RomaBeResponse

get

public RomaBeRequest get()
                  throws RomaError
Gets a client request using default get options, i.e. the first available request is retrieved and the theme for the response is left open. If the wait interval has expired a null RomaBeRequest is returned.
Throws:
RomaError - is thrown on failure of the get call.

get

public RomaBeRequest get(RomaGetOptions opt)
                  throws RomaError
Gets a client request according to the supplied get options. If the wait interval has expired a null RomaBeRequest is returned.
Parameters:
opt - get options used to select the request.
Throws:
RomaError - is thrown on failure of the get call.

get

public RomaBeRequest get(RomaGetOptions opt,
                         byte[] msgBuf,
                         RomaInteger msgBufSize)
                  throws RomaError
Gets a client request according to the supplied get options. The supplied message buffer will be used to receive data, the tag buffer will be allocated automatically. If the wait interval has expired a null RomaBeRequest is returned.
Parameters:
opt - get options used to select the request.
msgBuf - buffer to receive message
msgBufSize - size of message buffer.
Throws:
RomaError - is thrown on failure of the get call.

get

public RomaBeRequest get(RomaGetOptions opt,
                         byte[] msgBuf,
                         RomaInteger msgBufSize,
                         byte[] tagBuf,
                         RomaInteger tagBufSize)
                  throws RomaError
Gets a client request according to the supplied get options. The supplied message and tag buffers will be used to receive data. If the wait interval has expired a null RomaBeRequest is returned.
Parameters:
opt - get options used to select the request.
msgBuf - buffer to receive message
msgBufSize - size of message buffer.
tagBuf - buffer to receive tag data
tagBufSize - size of buffer to receive tag data
Throws:
RomaError - is thrown on failure of the get call.

isTermIndicator

public boolean isTermIndicator()
Returns:
true if termination indicator was set after put or get operation

queryTheme

public RomaThemeInfo queryTheme(RomaTheme theme)
                         throws RomaError
Returns information on the specified theme.
Parameters:
theme - Source theme
Throws:
RomaError - is thrown if the operation fails

buildTheme

public RomaTheme buildTheme(RomaTheme theme,
                            RomaThemeInfo info,
                            int options,
                            boolean close)
                     throws RomaError
Creates a new theme from the source theme and the theme details.
Parameters:
theme - Source theme
details - Theme details
options - Options indicating what parts of the theme information to use for the theme build. It is THEMEINFO_ALL or a combination of
  • Roma.THEMEINFO_THEMEID - use theme ID
  • Roma.THEMEINFO_RETRYCOUNT - use retry count
  • Roma.THEMEINFO_WORKFLOW - use workflow information
  • Roma.THEMEINFO_ETEINFO - use ETE information
  • Roma.THEMEINFO_TRAILERS - use persistent trailers
  • Roma.THEMEINFO_CONFIRMFLAGS - use confirmation flags
close - If true, closes the source theme
Throws:
RomaError - is thrown if the operation fails

interpretMessage

public RomaMessageInfo interpretMessage(RomaBeRequest msg,
                                        int options)
                                 throws RomaError
Returns detailed information on the specified message.
Parameters:
msg - Source message
options - Feature options, should be zero or one of
  • Roma.INTMSG_THEME - extract the message theme. The application is responsible for the theme closing.
Throws:
RomaError - is thrown if the operation fails

createRequest

protected RomaBeRequest createRequest(RomaBeRequest request)
Unmarshal a retrieved request. This method is expected to be overridden in derived classes. It can be used to differentiate between different types of response so that users can construct subclasses of class RomaBeRequest that deal with the response data as appropriate.

The RomaBusinessElement subclass' createRequest() method can construct the appropriate type of RomaBeRequest using the RomaBeRequest instance data. The createRequest() method is called by the get() method once the response is retrieved.

Parameters:
request - a retrieved RomaBeRequest. when constructing the RomaBeRequest object.