org.jclouds.scriptbuilder.functionloader.osgi
Class BundleFunctionLoader

java.lang.Object
  extended by org.jclouds.scriptbuilder.functionloader.osgi.BundleFunctionLoader
All Implemented Interfaces:
FunctionLoader

public class BundleFunctionLoader
extends Object
implements FunctionLoader

A FunctionLoader which searches for functions in the Bundle resources.


Constructor Summary
BundleFunctionLoader(org.osgi.framework.BundleContext bundleContext)
          Constructor
 
Method Summary
 String loadFunction(String function, OsFamily family)
          Loads the function from the Bundle resources.
 void start()
          Starts the loader.
 void stop()
          Unregisters itself from the service registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BundleFunctionLoader

public BundleFunctionLoader(org.osgi.framework.BundleContext bundleContext)
Constructor

Parameters:
bundleContext -
Method Detail

start

public void start()
Starts the loader. Looks up for Bundle resources and registers itself in the service registry. It adds a property to the service which advertise all the functions found in the local resources.


stop

public void stop()
Unregisters itself from the service registry.


loadFunction

public String loadFunction(String function,
                           OsFamily family)
                    throws FunctionNotFoundException
Loads the function from the Bundle resources.

Specified by:
loadFunction in interface FunctionLoader
Parameters:
function - The function name to load.
family - This operating system family of the function.
Returns:
Throws:
FunctionNotFoundException


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.