bea.jolt.beans
Class JoltServiceBean

java.lang.Object
  extended bybea.jolt.beans.JoltServiceBean
All Implemented Interfaces:
java.util.EventListener, JoltInputListener, java.beans.PropertyChangeListener, java.io.Serializable

public class JoltServiceBean
extends java.lang.Object
implements JoltInputListener, java.io.Serializable, java.beans.PropertyChangeListener

The JoltServiceBean represents a remote Tuxedo service. It

All getOutputValue/getOutputTextValue methods operate on service output parameters only.

All setInputValue/setInputTextValue methods operate on service input parameters only.

See Also:
JoltInputEvent, JoltOutputEvent, Serialized Form

Constructor Summary
JoltServiceBean()
          Constructor
 
Method Summary
 void addJoltOutputListener(JoltOutputListener listener)
          Add a JoltOutputEvent listener.
 void callService()
          Invoke the remote service.
 void clear()
          This method clears the underlying input and output message buffers.
 void dataChanged(JoltInputEvent evt)
          Event handler method for JoltInputEvents.
 boolean getDebug()
          Get the value of the debug property.
 JoltOutputEvent getJoltOutputEvent()
          Get to the JoltOutputEvent object encapsulated by the JoltServiceBean.
 int getOccurrenceCount(java.lang.String fieldName)
          Get the number of occurrences of a field from the Jolt output message buffer.
 java.lang.String getOutputTextValue(java.lang.String fieldName)
          Get the value of a field in the Jolt output message buffer as a String.
 java.lang.String getOutputTextValue(java.lang.String fieldName, int index)
          Get the value of one occurrence of a field in the Jolt output message buffer as a String.
 java.lang.String[] getOutputTextValues(java.lang.String fieldName)
          Get all occurrences of a field in the Jolt output message buffer as String.
 java.lang.Object getOutputValue(java.lang.String fieldName)
          Get the value of a field in the Jolt output message buffer using the field's native type.
 java.lang.Object getOutputValue(java.lang.String fieldName, int index)
          Get the value of one occurrence of a field in the Jolt output message buffer using the field's native type.
 java.lang.Object[] getOutputValues(java.lang.String fieldName)
          Get all occurrences of a field in the Jolt output message buffer using the field's native type.
 java.lang.String getServiceName()
          Gets the name of the remote service that this bean represents.
 JoltSessionBean getSession()
          Get the JoltSessionBean object used by this JoltServiceBean.
 boolean getTransactional()
          Returns true if the bean is in transactional mode, otherwise it returns false.
 boolean isTransactional()
          Returns true if the bean is in transactional mode, otherwise it returns false.
 void propertyChange(java.beans.PropertyChangeEvent evt)
          Event handler for PropertyChange events.
 void removeJoltOutputListener(JoltOutputListener listener)
          Remove a JoltOutputEvent listener.
 void setDebug(boolean value)
          Set the debug property.
 void setInputTextValue(java.lang.String fieldName, int index, java.lang.String textValue)
          Set one occurrence of a field in the Jolt input message buffer as a String.
 void setInputTextValue(java.lang.String fieldName, java.lang.String textValue)
          Set the value of a field in the Jolt input message buffer as a String.
 void setInputTextValues(java.lang.String fieldName, java.lang.String[] textValues)
          Set all occurrences of a field in the Jolt input message buffer as String.
 void setInputValue(java.lang.String fieldName, int index, java.lang.Object value)
          Set the value of one occurrence of a field in the Jolt input message buffer using the field's native type.
 void setInputValue(java.lang.String fieldName, java.lang.Object value)
          Set the value of a field in the Jolt input message buffer using the field's native type.
 void setInputValues(java.lang.String fieldName, java.lang.Object[] values)
          Set all occurrences of a field in the Jolt input message buffer using the field's native type.
 void setServiceName(java.lang.String name)
          Sets the name of the remote service that this bean represents.
 void setSession(JoltSessionBean value)
          This method is used in cases when the JoltServiceBean is created after the logon event.
 void setTransactional(boolean mode)
          Sets the transactional mode of the bean.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoltServiceBean

public JoltServiceBean()
Constructor

Method Detail

getJoltOutputEvent

public JoltOutputEvent getJoltOutputEvent()
Get to the JoltOutputEvent object encapsulated by the JoltServiceBean.


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Event handler for PropertyChange events. In this case the JoltSessionBean will notify the JoltServiceBean when it logs on and off by raising a PropertyChangeEvent about its "LoggedOn" property.

Note that a logoff of a session other than the current session will not affect the JoltServiceBean, but a logon of a session other than the current session will change the session.

Note:This method should not be called directly.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
evt - The event object.

dataChanged

public void dataChanged(JoltInputEvent evt)
                 throws JoltException
Event handler method for JoltInputEvents. The JoltServiceBean updates the input buffer field specified in the JoltInputEvent to the value specified in the event.

Note:This method should not be called directly.

Specified by:
dataChanged in interface JoltInputListener
Parameters:
evt - The event object.
Throws:
JoltException

setServiceName

public void setServiceName(java.lang.String name)
Sets the name of the remote service that this bean represents.

Parameters:
name - Service name.

getServiceName

public java.lang.String getServiceName()
Gets the name of the remote service that this bean represents.

Returns:
name of the Tuxedo service

isTransactional

public boolean isTransactional()
Returns true if the bean is in transactional mode, otherwise it returns false.

Returns:
true or false

setTransactional

public void setTransactional(boolean mode)
Sets the transactional mode of the bean.

Parameters:
mode - true or false

getTransactional

public boolean getTransactional()
Returns true if the bean is in transactional mode, otherwise it returns false.

Returns:
true or false

setSession

public void setSession(JoltSessionBean value)
This method is used in cases when the JoltServiceBean is created after the logon event. Otherwise the JoltServiceBean gets access to a Tuxedo client session by listening to JoltSessionEvents.

Parameters:
value - The JoltSessionBean which is used by this service bean.

getSession

public JoltSessionBean getSession()
Get the JoltSessionBean object used by this JoltServiceBean.

Returns:
JoltSessionBean object.

getOutputValue

public java.lang.Object getOutputValue(java.lang.String fieldName)
                                throws java.lang.NoSuchFieldError
Get the value of a field in the Jolt output message buffer using the field's native type.

Parameters:
fieldName - Name of the field.
Returns:
Value of the field.
Throws:
java.lang.NoSuchFieldError

getOutputValue

public java.lang.Object getOutputValue(java.lang.String fieldName,
                                       int index)
                                throws java.lang.NoSuchFieldError
Get the value of one occurrence of a field in the Jolt output message buffer using the field's native type.

Parameters:
fieldName - Name of the field.
index - Index of the field.
Returns:
Value of the field.
Throws:
java.lang.NoSuchFieldError

getOutputValues

public java.lang.Object[] getOutputValues(java.lang.String fieldName)
                                   throws java.lang.NoSuchFieldError
Get all occurrences of a field in the Jolt output message buffer using the field's native type.

Parameters:
fieldName - Name of the field.
Returns:
The occurrences of the field.
Throws:
java.lang.NoSuchFieldError

getOutputTextValue

public java.lang.String getOutputTextValue(java.lang.String fieldName)
                                    throws java.lang.NoSuchFieldError
Get the value of a field in the Jolt output message buffer as a String.

Parameters:
fieldName - Name of the field.
Returns:
The value of the field as a String.
Throws:
java.lang.NoSuchFieldError

getOutputTextValue

public java.lang.String getOutputTextValue(java.lang.String fieldName,
                                           int index)
                                    throws java.lang.NoSuchFieldError
Get the value of one occurrence of a field in the Jolt output message buffer as a String.

Parameters:
fieldName - Name of the field.
index - The occurrence index of the field.
Returns:
The value of the field as a String.
Throws:
java.lang.NoSuchFieldError

getOutputTextValues

public java.lang.String[] getOutputTextValues(java.lang.String fieldName)
                                       throws java.lang.NoSuchFieldError
Get all occurrences of a field in the Jolt output message buffer as String.

Parameters:
fieldName - Name of the field.
Returns:
The occurrences of the field as a String.
Throws:
java.lang.NoSuchFieldError

setInputValue

public void setInputValue(java.lang.String fieldName,
                          java.lang.Object value)
                   throws java.lang.NoSuchFieldError,
                          java.lang.ClassCastException
Set the value of a field in the Jolt input message buffer using the field's native type.

Parameters:
fieldName - Name of the field.
Throws:
java.lang.NoSuchFieldError
java.lang.ClassCastException

setInputValue

public void setInputValue(java.lang.String fieldName,
                          int index,
                          java.lang.Object value)
                   throws java.lang.NoSuchFieldError,
                          java.lang.ClassCastException
Set the value of one occurrence of a field in the Jolt input message buffer using the field's native type.

Parameters:
fieldName - Name of the field.
Throws:
java.lang.NoSuchFieldError
java.lang.ClassCastException

setInputValues

public void setInputValues(java.lang.String fieldName,
                           java.lang.Object[] values)
                    throws java.lang.NoSuchFieldError,
                           java.lang.ClassCastException
Set all occurrences of a field in the Jolt input message buffer using the field's native type.

Parameters:
fieldName - Name of the field.
values - The value to set.
Throws:
java.lang.NoSuchFieldError
java.lang.ClassCastException

setInputTextValue

public void setInputTextValue(java.lang.String fieldName,
                              java.lang.String textValue)
                       throws java.lang.NoSuchFieldError,
                              java.lang.NumberFormatException
Set the value of a field in the Jolt input message buffer as a String.

Parameters:
fieldName - Name of the field.
textValue - The value to set.
Throws:
java.lang.NoSuchFieldError
java.lang.NumberFormatException

setInputTextValue

public void setInputTextValue(java.lang.String fieldName,
                              int index,
                              java.lang.String textValue)
                       throws java.lang.NoSuchFieldError,
                              java.lang.NumberFormatException
Set one occurrence of a field in the Jolt input message buffer as a String.

Parameters:
fieldName - Name of the field.
index - Index of the field.
textValue - The value to set.
Throws:
java.lang.NoSuchFieldError
java.lang.NumberFormatException

setInputTextValues

public void setInputTextValues(java.lang.String fieldName,
                               java.lang.String[] textValues)
                        throws java.lang.NoSuchFieldError,
                               java.lang.ClassCastException
Set all occurrences of a field in the Jolt input message buffer as String.

Parameters:
fieldName - Name of the field.
textValues - The values to set.
Throws:
java.lang.NoSuchFieldError
java.lang.ClassCastException

getOccurrenceCount

public int getOccurrenceCount(java.lang.String fieldName)
                       throws java.lang.NoSuchFieldError
Get the number of occurrences of a field from the Jolt output message buffer.

Parameters:
fieldName - Name of the field.
Returns:
Number of occurrences.
Throws:
java.lang.NoSuchFieldError

clear

public void clear()
This method clears the underlying input and output message buffers.


callService

public void callService()
                 throws ServiceException,
                        TransactionException,
                        ApplicationException
Invoke the remote service.

Throws:
ServiceException
TransactionException
ApplicationException

addJoltOutputListener

public void addJoltOutputListener(JoltOutputListener listener)
Add a JoltOutputEvent listener.

Parameters:
listener - Event listener to be added.

removeJoltOutputListener

public void removeJoltOutputListener(JoltOutputListener listener)
Remove a JoltOutputEvent listener.

Parameters:
listener - Event listener to be removed.

getDebug

public boolean getDebug()
Get the value of the debug property.

Returns:
The debug state.

setDebug

public void setDebug(boolean value)
Set the debug property.

Parameters:
value - the debug state