livespace.osgi
Class Dependencies

java.lang.Object
  extended by livespace.osgi.Dependency
      extended by livespace.osgi.Dependencies
All Implemented Interfaces:
Iterable<Dependency>

public class Dependencies
extends Dependency
implements Iterable<Dependency>

Represents zero or more dependencies, all of which must be ready before this one is.

Author:
Matthew Phillips

Field Summary
 
Fields inherited from class livespace.osgi.Dependency
notReadyListeners, readyListeners
 
Constructor Summary
Dependencies()
           
 
Method Summary
 void add(Dependency dependency)
          Add a sub-dependency to the set.
 void add(Object name, Dependency dependency)
          Add a sub-dependency to the set with a given name.
 Dependency childNamed(String name)
           
 boolean isReady()
          True if the dependency is ready to be used.
 Iterator<Dependency> iterator()
          Return an iterator over the dependencies.
 void start()
          Start the dependency looking for its required resources.
 void stop()
          Stop the dependency looking for its required resources.
 Object value()
          Not supported.
 Object value(String name)
          Shortcut to get the resource for a sub-dependency.
 
Methods inherited from class livespace.osgi.Dependency
setReady, updateReady
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dependencies

public Dependencies()
Method Detail

add

public void add(Dependency dependency)
Add a sub-dependency to the set.

Parameters:
dependency - The dependency to add.
See Also:
add(Object, Dependency)

add

public void add(Object name,
                Dependency dependency)
Add a sub-dependency to the set with a given name. The name can be later used with several methods to lookup the dependency.


iterator

public Iterator<Dependency> iterator()
Return an iterator over the dependencies.

Specified by:
iterator in interface Iterable<Dependency>

start

public void start()
           throws Exception
Description copied from class: Dependency
Start the dependency looking for its required resources. The ready state will change when it is (which may be immediately as part of this call).

Specified by:
start in class Dependency
Throws:
Exception

stop

public void stop()
          throws Exception
Description copied from class: Dependency
Stop the dependency looking for its required resources. The ready state may change, perhaps immediately as part of this call.

Specified by:
stop in class Dependency
Throws:
Exception

value

public Object value()
Not supported. See value(String).

Specified by:
value in class Dependency

value

public Object value(String name)
             throws IllegalArgumentException
Shortcut to get the resource for a sub-dependency.

Parameters:
name - The sub-dependency name.
Throws:
IllegalArgumentException - if no name matches.
See Also:
childNamed(String)

childNamed

public Dependency childNamed(String name)

isReady

public boolean isReady()
Description copied from class: Dependency
True if the dependency is ready to be used.

Specified by:
isReady in class Dependency


Copyright © 2008 Commonwealth of Australia