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

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

public final class RuntimeHelper
extends Object

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

Author:
Marco Piraccini

Constructor Summary
RuntimeHelper()
           
 
Method Summary
static Document buildDOMDocument(Reader xmlReader)
          return the DOM Document
static DOMSource createDOMSource(Reader xmlReader)
          creates a DOMSource from the xml text read from the reader.
static javax.jbi.messaging.InOut createInOutMessageExchange(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 String getComponentName()
           
static javax.jbi.messaging.DeliveryChannel getDeliveryChannel()
           
static String getExceptionAsXmlText(Exception ex)
          may be used to set the exception as fault content.
static StringBuffer getExceptionStackTrace(Exception ex)
          converts the ex stracktrace to string.
static Logger getLogger()
           
static void logDebug(Object logObj)
           
static void logError(Object logObj)
           
static void logInfo(String msg)
           
static void logVerbose(String msg)
           
static void logWarning(Object logObj)
           
static StringBuffer readFromDOMSource(DOMSource domSource)
          reads xml text from DOMSource to StringBuffer
static StringBuffer readFromInputSource(InputSource inSource)
          reads the xml text from InputSource into a StringBuffer
static StringBuffer readFromSource(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 Logger getLogger()

logInfo

public static void logInfo(String msg)

logVerbose

public static void logVerbose(String msg)

logWarning

public static void logWarning(Object logObj)

logError

public static void logError(Object logObj)

logDebug

public static void logDebug(Object logObj)

getComponentContext

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

getDeliveryChannel

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

getComponentName

public static 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(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 Document buildDOMDocument(Reader xmlReader)
                                 throws Exception
return the DOM Document

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

readFromDOMSource

public static StringBuffer readFromDOMSource(DOMSource domSource)
reads xml text from DOMSource to StringBuffer


readFromInputSource

public static StringBuffer readFromInputSource(InputSource inSource)
reads the xml text from InputSource into a StringBuffer


readFromSource

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


createDOMSource

public static DOMSource createDOMSource(Reader xmlReader)
creates a DOMSource from the xml text read from the reader.


getExceptionStackTrace

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


getExceptionAsXmlText

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



Copyright © 2005-2010 Imola Informatica. All Rights Reserved.