org.milyn
Class SmooksOSGIFactory

java.lang.Object
  extended by org.milyn.SmooksOSGIFactory
All Implemented Interfaces:
SmooksFactory

public class SmooksOSGIFactory
extends Object
implements SmooksFactory

A factory class for creating Smooks instances in an OSGi environment.

This factory will create create a class loader that is able to delegate to the bundles classloader.

Author:
Daniel Bevenius

Constructor Summary
SmooksOSGIFactory(org.osgi.framework.Bundle bundle)
           
 
Method Summary
 Smooks createInstance()
          Creates a new Smooks instance using the Bundle passed in.
 Smooks createInstance(InputStream config)
          Creates a new Smooks instance using the Bundle passed in and adds the passed-in configuration.
 Smooks createInstance(String config)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmooksOSGIFactory

public SmooksOSGIFactory(org.osgi.framework.Bundle bundle)
Method Detail

createInstance

public Smooks createInstance()
Creates a new Smooks instance using the Bundle passed in. Calling this method is equivalent to calling #create(String) and passing in null as the config.

Specified by:
createInstance in interface SmooksFactory
Returns:
Smooks a newly created Smooks instance that is un-configured.

createInstance

public Smooks createInstance(InputStream config)
                      throws IOException,
                             SAXException
Creates a new Smooks instance using the Bundle passed in and adds the passed-in configuration.

Specified by:
createInstance in interface SmooksFactory
Parameters:
bundle - the OSGi bundle for which a delegating classloader will be created.
config - the configuration that should be added to the newly created Smooks instance. If null then a non-configured Smooks instance will be returned.
Returns:
Smooks a newly created Smooks instance.
Throws:
IOException
SAXException

createInstance

public Smooks createInstance(String config)
                      throws IOException,
                             SAXException
Specified by:
createInstance in interface SmooksFactory
Throws:
IOException
SAXException


Copyright © 2014. All Rights Reserved.