Rio Project 4.2 API Documentation



org.rioproject.tools.cli
Class ServiceFinder

java.lang.Object
  extended by org.rioproject.tools.cli.ServiceFinder

public class ServiceFinder
extends Object

Find a service

Author:
Dennis Reedy

Nested Class Summary
 class ServiceFinder.InfoFetcher
          Used to fetch information about services
static class ServiceFinder.InfoFetchStat
          Simple data structure holding the service name, the time the fetch request began, and the time it ended
 class ServiceFinder.ServiceFilter
          A ServiceItemFilter that filters on host names and attributes
static class ServiceFinder.ServiceInfo
          Class to hold a ServiceItem and the groups the service is a member of.
 class ServiceFinder.ServiceListener
          A ServiceDiscoveryListener
 
Constructor Summary
ServiceFinder(String[] groups, LookupLocator[] locators, Configuration config)
          Create a ServiceFinder
 
Method Summary
 ServiceItem[] find(String[] machines, Entry[] attrs)
          Find all services
 ServiceItem[] findCybernodes(String[] machines, Entry[] attrs)
          Find all Cybernode services
 ServiceItem[] findMonitors(String[] machines, Entry[] attrs)
          Find all Monitor services
 ServiceItem[] findMonitors(String[] machines, Entry[] attrs, boolean verbose)
          Find all Monitor services
static ApplianceInfo getApplianceInfo(Entry[] attrs)
          Get the ApplianceInfo attribute
 DiscoveryManagement getDiscoveryManagement()
          Get DiscoveryManagement
static Host getHost(Entry[] attrs)
          Get the Host attribute
static String getName(Entry[] attrs)
          Get the name of the service from either the Name attribute or the ServiceInfo attribute
 Object getPreparedAdmin(Object proxy)
          Get the Adminstrable proxy for a service, and prepare the returned proxy with the adminProxyPreparer
 ServiceFinder.ServiceInfo[] getServiceInfo()
          Get all ServiceInfo
 void terminate()
          Terminate the utility
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceFinder

public ServiceFinder(String[] groups,
                     LookupLocator[] locators,
                     Configuration config)
              throws IOException,
                     ConfigurationException
Create a ServiceFinder

Parameters:
groups - The groups to discover
locators - The LookupLocators to use
config - The Configuration to set
Throws:
IOException - If there are problems initializing discovery
ConfigurationException - If problems are encountered accessing the configuration
Method Detail

terminate

public void terminate()
Terminate the utility


find

public ServiceItem[] find(String[] machines,
                          Entry[] attrs)
Find all services

Parameters:
machines - String array of machine names to filter
attrs - An array of attributes to filter on
Returns:
Array of ServiceItem instances corresponding to the number of discovered service instances. If no services have been discovered, a zero-lengh array is returned

findCybernodes

public ServiceItem[] findCybernodes(String[] machines,
                                    Entry[] attrs)
Find all Cybernode services

Parameters:
machines - String array of machine names to filter
attrs - An array of attributes to filter on
Returns:
Array of ServiceItem instances corresponding to the number of discovered Cybernode service instances. If no Cybernode services have been discovered, a zero-lengh array is returned

findMonitors

public ServiceItem[] findMonitors(String[] machines,
                                  Entry[] attrs)
Find all Monitor services

Parameters:
machines - String array of machine names to filter
attrs - An array of attributes to filter on
Returns:
Array of ServiceItem instances corresponding to the number of discovered Monitor service instances. If no Monitor services have been discovered, a zero-lengh array is returned

findMonitors

public ServiceItem[] findMonitors(String[] machines,
                                  Entry[] attrs,
                                  boolean verbose)
Find all Monitor services

Parameters:
machines - String array of machine names to filter
attrs - An array of attributes to filter on
verbose - For more output set to true
Returns:
Array of ServiceItem instances corresponding to the number of discovered Monitor service instances. If no Monitor services have been discovered, a zero-lengh array is returned

getDiscoveryManagement

public DiscoveryManagement getDiscoveryManagement()
Get DiscoveryManagement

Returns:
The DiscoveryManagement instance being used

getServiceInfo

public ServiceFinder.ServiceInfo[] getServiceInfo()
Get all ServiceInfo

Returns:
An array of ServiceInfo objects

getName

public static String getName(Entry[] attrs)
Get the name of the service from either the Name attribute or the ServiceInfo attribute

Parameters:
attrs - Array of Entry attrbutes
Returns:
The name of the service from either the Name attribute or the ServiceInfo attribute

getHost

public static Host getHost(Entry[] attrs)
Get the Host attribute

Parameters:
attrs - Array of attributes
Returns:
A Host object

getApplianceInfo

public static ApplianceInfo getApplianceInfo(Entry[] attrs)
Get the ApplianceInfo attribute

Parameters:
attrs - An array of attributes to search
Returns:
If found, the ApplianceInfo entry

getPreparedAdmin

public Object getPreparedAdmin(Object proxy)
                        throws RemoteException
Get the Adminstrable proxy for a service, and prepare the returned proxy with the adminProxyPreparer

Parameters:
proxy - The service proxy
Returns:
A prepared Administrable proxy
Throws:
RemoteException - If errors occur

Copyright © Rio Project.

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