ioio.lib.util
Class IOIOConnectionRegistry

java.lang.Object
  extended by ioio.lib.util.IOIOConnectionRegistry

public class IOIOConnectionRegistry
extends java.lang.Object

A utility class for managing available connection types to IOIO.

For advanced usage only!

This class facilitates dynamic linkage and instantiation of different IOIO connection types. IOIOConnectionBootstrap classes enable creation of IOIOConnectionFactory instances, from which concrete IOIOConnections are created. The binding to IOIOConnectionBootstrap is dynamic, thus enabling linkage to succeed with or without those bootstraps. Likewise, during runtime, the absence of bootstraps is handled gracefully. A typical usage will call addBootstraps(String[]) with a list of class names to be sought from a static initializer block. It may then call getBootstraps() to obtain any bootstrap classes that are available in runtime, in case the bootstrap classes themselves need some runtime handling. Last, the getConnectionFactories() will return a collection of IOIOConnectionFactory, each representing one possible communication channel to a IOIO.


Constructor Summary
IOIOConnectionRegistry()
           
 
Method Summary
static void addBootstraps(java.lang.String[] classNames)
          For advanced usage only! Add platform-specific connection bootstrap classes.
static java.util.Collection<IOIOConnectionBootstrap> getBootstraps()
          For advanced usage only! Used for special runtime handling of bootstrap classes.
static java.util.Collection<IOIOConnectionFactory> getConnectionFactories()
          Get all available connection specifications.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IOIOConnectionRegistry

public IOIOConnectionRegistry()
Method Detail

getConnectionFactories

public static java.util.Collection<IOIOConnectionFactory> getConnectionFactories()
Get all available connection specifications. This is a list of all currently available communication channels in which a IOIO may be available. The client typically passes elements of this collection to IOIOFactory.create(IOIOConnection), possibly after filtering based on the specification's properties.

Returns:
A collection of specifications.

getBootstraps

public static java.util.Collection<IOIOConnectionBootstrap> getBootstraps()
For advanced usage only! Used for special runtime handling of bootstrap classes.

Returns:
The bootstraps.

addBootstraps

public static void addBootstraps(java.lang.String[] classNames)
For advanced usage only! Add platform-specific connection bootstrap classes. Call before calling getConnectionFactories().