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

java.lang.Object
  extended by org.jboss.webbeans.bootstrap.api.helpers.SimpleServiceRegistry
All Implemented Interfaces:
ServiceRegistry

public class SimpleServiceRegistry
extends java.lang.Object
implements ServiceRegistry

A registry for services

Author:
Pete Muir

Constructor Summary
SimpleServiceRegistry()
           
 
Method Summary
<S extends Service>
void
add(java.lang.Class<S> type, S service)
          Add a service to bootstrap
<S extends Service>
boolean
contains(java.lang.Class<S> type)
          Check if a service is registered
 boolean equals(java.lang.Object obj)
           
<S extends Service>
S
get(java.lang.Class<S> type)
          Retrieve a service implementation
 int hashCode()
           
 java.lang.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(java.lang.Class<S> type,
                                    S service)
Description copied from interface: ServiceRegistry
Add a service to bootstrap

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

get

public <S extends Service> S get(java.lang.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(java.lang.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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2011. All Rights Reserved.