org.jboss.weld.bootstrap.api.helpers
Class SimpleServiceRegistry

java.lang.Object
  extended by org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry
All Implemented Interfaces:
Iterable<Service>, ServiceRegistry

public class SimpleServiceRegistry
extends Object
implements ServiceRegistry

A registry for services

Author:
Pete Muir

Constructor Summary
SimpleServiceRegistry()
           
 
Method Summary
<S extends Service>
void
add(Class<S> type, S service)
          Add a service
 void addAll(Collection<Map.Entry<Class<? extends Service>,Service>> services)
          Add services
 void cleanup()
          Clear up the services registered, by calling Service.cleanup() on each registered service
<S extends Service>
boolean
contains(Class<S> type)
          Check if a service is registered
 Set<Map.Entry<Class<? extends Service>,Service>> entrySet()
           
 boolean equals(Object obj)
           
protected  Map<Class<? extends Service>,Service> get()
           
<S extends Service>
S
get(Class<S> type)
          Retrieve a service implementation
 int hashCode()
           
 Iterator<Service> iterator()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleServiceRegistry

public SimpleServiceRegistry()
Method Detail

add

public <S extends Service> void add(Class<S> type,
                                    S service)
Description copied from interface: ServiceRegistry
Add a service

Specified by:
add in interface ServiceRegistry
Type Parameters:
S - the service type to add
service - the service implementation
See Also:
Service

addAll

public void addAll(Collection<Map.Entry<Class<? extends Service>,Service>> services)
Description copied from interface: ServiceRegistry
Add services

Specified by:
addAll in interface ServiceRegistry

entrySet

public Set<Map.Entry<Class<? extends Service>,Service>> entrySet()
Specified by:
entrySet in interface ServiceRegistry

get

protected Map<Class<? extends Service>,Service> get()

get

public <S extends Service> S get(Class<S> type)
Description copied from interface: ServiceRegistry
Retrieve a service implementation

Specified by:
get in interface ServiceRegistry
Type Parameters:
S - the service type
Returns:
the service implementation, or null if none is registered

contains

public <S extends Service> boolean contains(Class<S> type)
Description copied from interface: ServiceRegistry
Check if a service is registered

Specified by:
contains in interface ServiceRegistry
Type Parameters:
S - the service type
Returns:
true if a service is registered, otherwise false

cleanup

public void cleanup()
Description copied from interface: ServiceRegistry
Clear up the services registered, by calling Service.cleanup() on each registered service

Specified by:
cleanup in interface ServiceRegistry

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

iterator

public Iterator<Service> iterator()
Specified by:
iterator in interface Iterable<Service>


Copyright © 2013 Seam Framework. All Rights Reserved.