com.sun.sgs.impl.kernel
Class ComponentRegistryImpl

java.lang.Object
  extended by com.sun.sgs.impl.kernel.ComponentRegistryImpl
All Implemented Interfaces:
ComponentRegistry, Iterable<Object>

 class ComponentRegistryImpl
extends Object
implements ComponentRegistry

This is a simple implementation of ComponentRegistry used to startup and configure the system and individual applications. It can have any objects added to it, but components cannot be removed. This implementation is not thread-safe.


Constructor Summary
ComponentRegistryImpl()
          Creates an empty instance of ComponentRegistryImpl.
 
Method Summary
(package private)  void addComponent(Object component)
          Adds a component to the set of available components.
<T> T
getComponent(Class<T> type)
          Returns a component from the registry, matched based on the given type.
 Iterator<Object> iterator()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentRegistryImpl

ComponentRegistryImpl()
Creates an empty instance of ComponentRegistryImpl.

Method Detail

getComponent

public <T> T getComponent(Class<T> type)
Returns a component from the registry, matched based on the given type. If there are no matches, or there is more than one possible match, then an exception is thrown.

Specified by:
getComponent in interface ComponentRegistry
Type Parameters:
T - the type of the component
Parameters:
type - the Class of the requested component
Returns:
the requested component

addComponent

void addComponent(Object component)
Adds a component to the set of available components.

Parameters:
component - the component to add to the registry

iterator

public Iterator<Object> iterator()

Specified by:
iterator in interface Iterable<Object>

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved