Rio Project 4.2 API Documentation



org.rioproject.cybernode
Class ServiceBeanLoader

java.lang.Object
  extended by org.rioproject.cybernode.ServiceBeanLoader

public class ServiceBeanLoader
extends Object

The ServiceBeanLoader will load and create a ServiceBean. The ServiceBeanLoader supports the following configuration entries

Author:
Dennis Reedy

Nested Class Summary
static class ServiceBeanLoader.Result
          Trivial class used as the return value by the load method.
 
Constructor Summary
ServiceBeanLoader()
           
 
Method Summary
static void advertise(Object jsbProxy, ServiceBeanContext context)
          Advertise a ServiceBean
static void advertise(Object jsbProxy, String serviceName, String opStringName, String[] groups, LookupLocator[] locators, String hostAddress, Entry[] attrs)
          Advertise a ServiceBean
static Entry[] getConfiguredAttributes(ServiceBeanContext context)
          Get configuration defined attributes
static ServiceBeanLoader.Result load(ServiceElement sElem, Uuid serviceID, ServiceBeanManager jsbManager, ComputeResource computeResource, Configuration sharedConfiguration)
          The load method is invoked to load and instantiate a ServiceBean.
static void unload(ClassLoader loader, ServiceElement elem)
          Clean up resources
Remove ServiceClassLoader from global policy to prevent leaking ServiceClassLoader instances Remove any downloaded jars
static void unload(ServiceBeanLoader.Result result, ServiceElement elem)
          Clean up resources
Remove ServiceClassLoader from global policy to prevent leaking ServiceClassLoader instances Remove any downloaded jars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceBeanLoader

public ServiceBeanLoader()
Method Detail

unload

public static void unload(ServiceBeanLoader.Result result,
                          ServiceElement elem)
Clean up resources
  • Remove ServiceClassLoader from global policy to prevent leaking ServiceClassLoader instances
  • Remove any downloaded jars

    Parameters:
    result - The Result object to unload
    elem - The ServiceElement to use as a reference

  • unload

    public static void unload(ClassLoader loader,
                              ServiceElement elem)
    Clean up resources
  • Remove ServiceClassLoader from global policy to prevent leaking ServiceClassLoader instances
  • Remove any downloaded jars

    Parameters:
    loader - The ClassLoader to unload
    elem - The ServiceElement to use as a reference

  • load

    public static ServiceBeanLoader.Result load(ServiceElement sElem,
                                                Uuid serviceID,
                                                ServiceBeanManager jsbManager,
                                                ComputeResource computeResource,
                                                Configuration sharedConfiguration)
                                         throws JSBInstantiationException
    The load method is invoked to load and instantiate a ServiceBean.

    Parameters:
    sElem - The ServiceElement
    serviceID - Uuid for the service
    jsbManager - The ServiceBeanManager
    computeResource - ComputeResource object
    sharedConfiguration - Shared configuration
    Returns:
    A Result object with attributes to access the instantiated service
    Throws:
    JSBInstantiationException - If errors occur while creating the service bean

    advertise

    public static void advertise(Object jsbProxy,
                                 ServiceBeanContext context)
                          throws JSBControlException
    Advertise a ServiceBean

    Parameters:
    jsbProxy - Proxy to the JSB
    context - The ServiceBeanContext
    Throws:
    JSBControlException - If the service bean cannot be advertised

    advertise

    public static void advertise(Object jsbProxy,
                                 String serviceName,
                                 String opStringName,
                                 String[] groups,
                                 LookupLocator[] locators,
                                 String hostAddress,
                                 Entry[] attrs)
                          throws JSBControlException
    Advertise a ServiceBean

    Parameters:
    jsbProxy - Proxy to the JSB
    serviceName - The name for the service
    opStringName - The name of the OperationalString
    groups - Array of String discovery groups
    locators - Array LookupLocators
    hostAddress - the address of the machine the service is executing on
    attrs - An array of additional Entry objects to add
    Throws:
    JSBControlException - If the service bean cannot be advertised

    getConfiguredAttributes

    public static Entry[] getConfiguredAttributes(ServiceBeanContext context)
    Get configuration defined attributes

    Parameters:
    context - The ServiceBeanContext
    Returns:
    An array of configured Entry attributes from the ServiceBeanContext

    Copyright © Rio Project.

    Copyright © 2006-2011 Rio Project. All Rights Reserved.