it.imolinfo.jbi4ejb.jbi.component.runtime
Class RuntimeHelper

java.lang.Object
  extended by it.imolinfo.jbi4ejb.jbi.component.runtime.RuntimeHelper

public final class RuntimeHelper
extends java.lang.Object

Helper class that have easy accessors for the common functions in the component runtime.

Author:
Sun Microsystems, Inc.

Constructor Summary
RuntimeHelper()
           
 
Method Summary
static org.w3c.dom.Document buildDOMDocument(java.io.Reader xmlReader)
          return the DOM Document
static javax.xml.transform.dom.DOMSource createDOMSource(java.io.Reader xmlReader)
          creates a DOMSource from the xml text read from the reader.
static javax.jbi.messaging.InOut createInOutMessageExchange(javax.xml.namespace.QName operation, javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
          this method creates a InOutMessageExchange Object and sets the required data on the MessageExchange object including the create and set the Normalized message object to hold the input message on the MessageExchange object.
static javax.jbi.servicedesc.ServiceEndpoint findServiceEndpoint(ServiceDescriptor serviceDescriptor)
          helper method to find the active ServiceEndpiont for the service decribed with the serviceDescriptor.
static javax.jbi.component.ComponentContext getComponentContext()
           
static java.lang.String getComponentName()
           
static javax.jbi.messaging.DeliveryChannel getDeliveryChannel()
           
static java.lang.String getExceptionAsXmlText(java.lang.Exception ex)
          may be used to set the exception as fault content.
static java.lang.StringBuffer getExceptionStackTrace(java.lang.Exception ex)
          converts the ex stracktrace to string.
static java.util.logging.Logger getLogger()
           
static void logDebug(java.lang.Object logObj)
           
static void logError(java.lang.Object logObj)
           
static void logInfo(java.lang.String msg)
           
static void logVerbose(java.lang.String msg)
           
static void logWarning(java.lang.Object logObj)
           
static java.lang.StringBuffer readFromDOMSource(javax.xml.transform.dom.DOMSource domSource)
          reads xml text from DOMSource to StringBuffer
static java.lang.StringBuffer readFromInputSource(org.xml.sax.InputSource inSource)
          reads the xml text from InputSource into a StringBuffer
static java.lang.StringBuffer readFromSource(javax.xml.transform.Source source)
          reads xml from from DOM, SAX or Stream Source into a string buffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuntimeHelper

public RuntimeHelper()
Method Detail

getLogger

public static java.util.logging.Logger getLogger()

logInfo

public static void logInfo(java.lang.String msg)

logVerbose

public static void logVerbose(java.lang.String msg)

logWarning

public static void logWarning(java.lang.Object logObj)

logError

public static void logError(java.lang.Object logObj)

logDebug

public static void logDebug(java.lang.Object logObj)

getComponentContext

public static javax.jbi.component.ComponentContext getComponentContext()

getDeliveryChannel

public static javax.jbi.messaging.DeliveryChannel getDeliveryChannel()

getComponentName

public static java.lang.String getComponentName()

findServiceEndpoint

public static javax.jbi.servicedesc.ServiceEndpoint findServiceEndpoint(ServiceDescriptor serviceDescriptor)
helper method to find the active ServiceEndpiont for the service decribed with the serviceDescriptor. This method looks for the Active ServiceEndpoint using interface or servicename or service name and the endpointname.


createInOutMessageExchange

public static javax.jbi.messaging.InOut createInOutMessageExchange(javax.xml.namespace.QName operation,
                                                                   javax.jbi.servicedesc.ServiceEndpoint serviceEndpoint)
                                                            throws javax.jbi.messaging.MessagingException
this method creates a InOutMessageExchange Object and sets the required data on the MessageExchange object including the create and set the Normalized message object to hold the input message on the MessageExchange object.

Throws:
javax.jbi.messaging.MessagingException

buildDOMDocument

public static org.w3c.dom.Document buildDOMDocument(java.io.Reader xmlReader)
                                             throws java.lang.Exception
return the DOM Document

Parameters:
xmlReader - Reader
Returns:
dom document
Throws:
java.lang.Exception - on parser exception or any other exception

readFromDOMSource

public static java.lang.StringBuffer readFromDOMSource(javax.xml.transform.dom.DOMSource domSource)
reads xml text from DOMSource to StringBuffer


readFromInputSource

public static java.lang.StringBuffer readFromInputSource(org.xml.sax.InputSource inSource)
reads the xml text from InputSource into a StringBuffer


readFromSource

public static java.lang.StringBuffer readFromSource(javax.xml.transform.Source source)
reads xml from from DOM, SAX or Stream Source into a string buffer


createDOMSource

public static javax.xml.transform.dom.DOMSource createDOMSource(java.io.Reader xmlReader)
creates a DOMSource from the xml text read from the reader.


getExceptionStackTrace

public static java.lang.StringBuffer getExceptionStackTrace(java.lang.Exception ex)
converts the ex stracktrace to string.


getExceptionAsXmlText

public static java.lang.String getExceptionAsXmlText(java.lang.Exception ex)
may be used to set the exception as fault content.



Copyright © 2007-2008 Imola Informatica. All Rights Reserved.