|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.rioproject.resources.client.JiniClient
public class JiniClient
The JiniClient class is a helper class that Jini clients (or something that wants to act like a Jini client) uses to create DiscoveryManagement instances to discover services
| Nested Class Summary | |
|---|---|
class |
JiniClient.Listener
|
| Field Summary | |
|---|---|
static String |
GROUPS_PROPERTY_NAME
|
JiniClient.Listener |
listener
|
static String |
LOCATOR_PROPERTY_NAME
|
| Constructor Summary | |
|---|---|
JiniClient()
Create an instance of a JiniClient |
|
JiniClient(DiscoveryManagement dm)
Create an instance of a JiniClient providing a DiscoveryManagement reference |
|
| Method Summary | |
|---|---|
void |
addLocator(String locator)
Add a Locator to discover. |
void |
addLocator(String host,
int port)
Add a Locator to discover. |
void |
addRegistrarGroups(String[] gAdd)
Add a list of groups to be discovered If a DiscoveryManagement is provided to JiniClient and
does not implement the DiscoveryGroupManagement interface, no action is
taken |
void |
discardRegistrar(ServiceRegistrar registrar)
Discard a ServiceRegistrar that had been previously discovered |
static DiscoveryManagement |
getDiscoveryManagement(ServiceElement sElem)
Get a DiscoveryManagement instance from service attributes in a ServiceElement |
DiscoveryManagement |
getDiscoveryManager()
Get the DiscoveryManagement instance |
LookupLocator[] |
getLocators()
Get the array of known locators |
static LookupCache |
getLookupCache(ServiceBeanContext context)
Get a LookupCache instance from service attributes in a ServiceBeanContext |
static LookupCache |
getLookupCache(ServiceBeanContext context,
ClassLoader cl)
Get a LookupCache instance from service attributes in a ServiceBeanContext |
String[] |
getRegistrarGroups()
Get the known set of groups |
ServiceRegistrar[] |
getRegistrars()
Get all ServiceRegistrar instances that have been discovered |
static ServiceTemplate |
getServiceTemplate(AssociationDescriptor aDesc)
Create a ServiceTemplate from an AssociationDescriptor |
static ServiceTemplate |
getServiceTemplate(AssociationDescriptor aDesc,
ClassLoader cl)
Create a ServiceTemplate from an AssociationDescriptor |
static ServiceTemplate |
getServiceTemplate(ServiceElement sElem)
Create a ServiceTemplate from a ServiceElement |
static ServiceTemplate |
getServiceTemplate(ServiceElement sElem,
ClassLoader cl)
Create a ServiceTemplate from a ServiceElement |
static String[] |
parseGroups(String groupNames)
Parse a comma or space delimited string of group names |
static LookupLocator[] |
parseLocators(String locatorUrls)
Parse a comma or space delimited string of locator urls |
void |
removeLocators(LookupLocator[] locators)
Deletes a set of locators from the managed set of locators, and discards any already-discovered lookup service that corresponds to a deleted locator. |
void |
removeRegistrarGroups(String[] gRemove)
Remove a list of groups from discovery management |
void |
terminate()
Stop this JiniClient and terminate discovery management. |
static String[] |
transformGroupNames(String[] groups)
Returns an array consisting of the names of the groups whose members are the lookup services to discover from an array of group names that may not map to Jini technology specific group name nuances |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String GROUPS_PROPERTY_NAME
public static final String LOCATOR_PROPERTY_NAME
public JiniClient.Listener listener
| Constructor Detail |
|---|
public JiniClient()
throws Exception
Exception - if any errors occur
public JiniClient(DiscoveryManagement dm)
throws Exception
dm - The DiscoveryManagement instance to use. If the
DiscoveryManagement object is null, JiniClient will look for 2
system properties to construct a DiscoveryManagement object:
Exception - if any errors occur| Method Detail |
|---|
public static String[] parseGroups(String groupNames)
groupNames - The string of group names to parse
LookupDiscovery.NO_GROUPS.
LookupDiscovery.ALL_GROUPS.
public static LookupLocator[] parseLocators(String locatorUrls)
throws MalformedURLException
locatorUrls - The string of locator urls to parse
LookupLocator array of
parsed locator urls. If the locatorUrls parameter is null, return null
MalformedURLException - If the locatorUrls contains a value that
has an illegal formatpublic static String[] transformGroupNames(String[] groups)
groups - String[] of group names to transform. Transformation is
determined as follows:
public static ServiceTemplate getServiceTemplate(ServiceElement sElem)
throws Exception
sElem - A ServiceElement
Exception - If the interface class in the ServiceElement
export bundle cannot be loaded
public static ServiceTemplate getServiceTemplate(ServiceElement sElem,
ClassLoader cl)
throws Exception
sElem - A ServiceElementcl - The ClassLoader to use to load the interface class. If null,
the threads context classloader will be used
Exception - If the interface class in the ServiceElement
export bundle cannot be loaded
public static DiscoveryManagement getDiscoveryManagement(ServiceElement sElem)
throws IOException
sElem - A ServiceElement
IOException - If DiscoveryManagement cannot be created
public static ServiceTemplate getServiceTemplate(AssociationDescriptor aDesc)
throws Exception
aDesc - The AssociationDescriptor
Exception - If the interface class in the AssociationDescriptor
cannot be loaded
public static ServiceTemplate getServiceTemplate(AssociationDescriptor aDesc,
ClassLoader cl)
throws Exception
aDesc - The AssociationDescriptorcl - The ClassLoader to use to load the interface class. If null,
the threads context classloader will be used
Exception - If the interface class cannot be loaded
public static LookupCache getLookupCache(ServiceBeanContext context,
ClassLoader cl)
throws Exception
context - A ServiceBeanContextcl - The classloader to use. If null use the current context
classloader
Exception - If the LookupCache cannot be obtained
public static LookupCache getLookupCache(ServiceBeanContext context)
throws Exception
context - A ServiceBeanContext
Exception - If the LookupCache cannot be obtainedpublic DiscoveryManagement getDiscoveryManager()
public ServiceRegistrar[] getRegistrars()
public void addLocator(String locator)
throws MalformedURLException
If a DiscoveryManagement is provided to JiniClient and
does not implement the DiscoveryLocatorManagement interface, no action is
taken
The URL in question must be of the form jini://host/ or jini://host:port/
locator - The locator url to add
MalformedURLException - the URL passed in could not be parsed
public void addLocator(String host,
int port)
If a DiscoveryManagement is provided to JiniClient and
does not implement the DiscoveryLocatorManagement interface, no action is
taken
host - The hostname part of the locatorport - The port name part of the locatorpublic LookupLocator[] getLocators()
If a DiscoveryManagement is provided to JiniClient and
does not implement the DiscoveryLocatorManagement interface, this method
will return null
public void removeLocators(LookupLocator[] locators)
If a DiscoveryManagement is provided to JiniClient and
does not implement the DiscoveryLocatorManagement interface, no action is
taken
locators - Array of LookupLocator instances to remove
public void addRegistrarGroups(String[] gAdd)
throws IOException
If a DiscoveryManagement is provided to JiniClient and
does not implement the DiscoveryGroupManagement interface, no action is
taken
gAdd - Array of group names to add
IOException - if the groups could not be addedpublic String[] getRegistrarGroups()
public void removeRegistrarGroups(String[] gRemove)
gRemove - The array of groups to removepublic void discardRegistrar(ServiceRegistrar registrar)
registrar - The ServiceRegistrar to discardpublic void terminate()
|
Copyright © Rio Project. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||