org.ow2.petals.se.xslt.model
Class XsltConfigurationHandler

java.lang.Object
  extended by org.ow2.petals.se.xslt.model.XsltConfigurationHandler

public class XsltConfigurationHandler
extends java.lang.Object

A handler for XSLT configurations.

Every element derived from the SU configuration and required at runtime is hold by such a handler.

Author:
Vincent Zurczak - EBM WebSourcing

Constructor Summary
XsltConfigurationHandler(XsltConfiguration xsltConfiguration, java.util.logging.Logger logger)
          Constructor.
 
Method Summary
 void check(java.util.logging.Logger logger)
          Checks the handler.
 java.lang.ClassLoader getClassLoader()
           
 java.lang.String getEndpointName()
           
 java.lang.String getOutputAttachmentName()
           
 void releaseTransformer(javax.xml.transform.Transformer transformer)
          Releases a transformer (for the transformer pool).
 void start(java.util.logging.Logger logger)
          Starts the handler.
 void stop()
          Stops the handler.
 javax.xml.transform.Transformer takeTransformer(org.ow2.petals.component.framework.api.message.Exchange exchange, java.util.logging.Logger logger)
          Takes a transformer (with the right properties) in the transformer pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XsltConfigurationHandler

public XsltConfigurationHandler(XsltConfiguration xsltConfiguration,
                                java.util.logging.Logger logger)
Constructor.

Parameters:
xsltConfiguration - an XSLT configuration
logger - the component's logger
Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Method Detail

check

public void check(java.util.logging.Logger logger)
           throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Checks the handler.

It tries to create the XSL template which is not cached (deployment)
If the SU embeds JAR files, they are loaded in the class loader of the handler, so that they can be used by the XSL transformation.

Parameters:
logger - the logger of the component
Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException - if the check fails

start

public void start(java.util.logging.Logger logger)
           throws org.ow2.petals.component.framework.api.exception.PEtALSCDKException
Starts the handler.

The XSL style sheet is cached and a pool of transformer is created
If the SU embeds JAR files, they are loaded in the class loader of the handler, so that they can be used by the XSL transformation.

Parameters:
logger - the logger of the component
Throws:
org.ow2.petals.component.framework.api.exception.PEtALSCDKException - if the handler could not be started

stop

public void stop()
Stops the handler.

The transformer is deleted and the class loader is freed.


getEndpointName

public java.lang.String getEndpointName()
Returns:
the associated end-point name
See Also:
#getEndpointName()

getClassLoader

public java.lang.ClassLoader getClassLoader()
Returns:
the classLoader

getOutputAttachmentName

public java.lang.String getOutputAttachmentName()
Returns:
an output attachment-name

takeTransformer

public javax.xml.transform.Transformer takeTransformer(org.ow2.petals.component.framework.api.message.Exchange exchange,
                                                       java.util.logging.Logger logger)
                                                throws javax.xml.transform.TransformerException
Takes a transformer (with the right properties) in the transformer pool.

Parameters:
exchange - the exchange, to get its properties
logger - the component logger
Returns:
a new transformer
Throws:
javax.xml.transform.TransformerException - if the transformer could not be created or if a XSL parameter could not be overridden

releaseTransformer

public void releaseTransformer(javax.xml.transform.Transformer transformer)
Releases a transformer (for the transformer pool).

Parameters:
transformer - the transformer to release


Copyright © 2005-2011 Petals Link (EBM Websourcing). All Rights Reserved.