org.apache.tuscany.sca.node.osgi.launcher
Class NodeLauncher

java.lang.Object
  extended by org.apache.tuscany.sca.node.osgi.launcher.NodeLauncher

public class NodeLauncher
extends java.lang.Object

A launcher for SCA nodes.


Method Summary
<T> T
createNode(java.lang.String compositeURI, Contribution... contributions)
          Creates a new SCA OSGi Node.
<T> T
createNode(java.lang.String compositeURI, java.lang.String compositeContent, Contribution... contributions)
          Creates a new SCA OSGi Node.
<T> T
createNodeFromClassLoader(java.lang.String compositeURI, java.lang.ClassLoader classLoader)
          Create a SCA node based on the discovery of the contribution on the classpath for the given classloader.
<T> T
createNodeFromURL(java.lang.String configurationURL)
          Creates a new SCA node from the configuration URL
static void main(java.lang.String[] args)
           
static NodeLauncher newInstance()
          Returns a new launcher instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newInstance

public static NodeLauncher newInstance()
Returns a new launcher instance.

Returns:
a new launcher instance

createNodeFromURL

public <T> T createNodeFromURL(java.lang.String configurationURL)
                    throws LauncherException
Creates a new SCA node from the configuration URL

Parameters:
configurationURL - the URL of the node configuration which is the ATOM feed that contains the URI of the composite and a collection of URLs for the contributions
Returns:
a new SCA node.
Throws:
LauncherException

createNode

public <T> T createNode(java.lang.String compositeURI,
                        Contribution... contributions)
             throws LauncherException
Creates a new SCA OSGi Node.

Parameters:
compositeURI - the URI of the composite to use
contributions - the URI of the contributions that provides the composites and related artifacts. If the list is empty, then we will use the thread context classloader to discover the contribution on the classpath
Returns:
a new SCA node.
Throws:
LauncherException

createNode

public <T> T createNode(java.lang.String compositeURI,
                        java.lang.String compositeContent,
                        Contribution... contributions)
             throws LauncherException
Creates a new SCA OSGi Node.

Parameters:
compositeURI - the URI of the composite to use
compositeContent - the XML content of the composite to use
contributions - the URI of the contributions that provides the composites and related artifacts
Returns:
a new SCA node.
Throws:
LauncherException

createNodeFromClassLoader

public <T> T createNodeFromClassLoader(java.lang.String compositeURI,
                                       java.lang.ClassLoader classLoader)
                            throws LauncherException
Create a SCA node based on the discovery of the contribution on the classpath for the given classloader. This method should be treated a convenient shortcut with the following assumptions:

Parameters:
compositeURI - The URI of the composite file relative to the root of the enclosing contribution
classLoader - The ClassLoader used to load the composite file as a resource. If the value is null, then thread context classloader will be used
Returns:
A newly created SCA node
Throws:
LauncherException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception