at.ac.tuwien.infosys.sm4all.copal.core.internal
Class ContextEventTypeRegistryImpl

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.util.BaseObservable<RegistryObservable.RegistrationState,V,RegistryObservable.RegistryObserver<V>>
      extended by at.ac.tuwien.infosys.sm4all.copal.api.util.BaseRegistry<K,V>
          extended by at.ac.tuwien.infosys.sm4all.copal.core.internal.RegistryService<java.lang.String,ContextEventType>
              extended by at.ac.tuwien.infosys.sm4all.copal.core.internal.ContextEventTypeRegistryImpl
All Implemented Interfaces:
ContextEventTypeRegistry, Observable<RegistryObservable.RegistrationState,ContextEventType,RegistryObservable.RegistryObserver<ContextEventType>>, Registry<java.lang.String,ContextEventType>, RegistryObservable<ContextEventType>, org.osgi.framework.BundleActivator

public class ContextEventTypeRegistryImpl
extends RegistryService<java.lang.String,ContextEventType>
implements ContextEventTypeRegistry

Implementation of the ContextEventTypeRegistry interface.

Author:
sanjin

Nested Class Summary
 
Nested classes/interfaces inherited from interface at.ac.tuwien.infosys.sm4all.copal.api.util.RegistryObservable
RegistryObservable.RegistrationState, RegistryObservable.RegistryObserver<T>
 
Constructor Summary
ContextEventTypeRegistryImpl()
          Creates an instance of the ContextEventTypeRegistry implementation.
 
Method Summary
 ContextEventType[] getAll()
          Returns all currently registered ContextEventTypes.
protected  java.lang.String getKey(ContextEventType eventType)
          Return the key for specified value.
 boolean isStarted()
          Returns if this ContextEventTypeRegistry has been started by an OSGi framework.
 void register(ContextEventType eventType)
          Registers specified value.
 void unregister(java.lang.String name)
          Unregisters value associated with specified key.
protected  void unregisterAll()
          Unregisters all registered values.
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.core.internal.RegistryService
attach, detach, start, stop
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.util.BaseRegistry
get, getValues, isRegistered, set, setValues
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.util.BaseObservable
detachAll, getObservers, notifyAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface at.ac.tuwien.infosys.sm4all.copal.api.service.ContextEventTypeRegistry
get, isRegistered
 
Methods inherited from interface at.ac.tuwien.infosys.sm4all.copal.api.util.Observable
attach, detach
 

Constructor Detail

ContextEventTypeRegistryImpl

public ContextEventTypeRegistryImpl()
Creates an instance of the ContextEventTypeRegistry implementation.

Method Detail

isStarted

public boolean isStarted()
Returns if this ContextEventTypeRegistry has been started by an OSGi framework.

Overrides:
isStarted in class RegistryService<java.lang.String,ContextEventType>
Returns:
if this ContextEventTypeRegistry has been started by an OSGi framework.

register

public void register(ContextEventType eventType)
              throws AlreadyRegisteredException
Description copied from class: BaseRegistry
Registers specified value. If there is already a value associated with same key the old value will remain registered and this method will throw AlreadyRegisteredException.

Specified by:
register in interface ContextEventTypeRegistry
Specified by:
register in interface Registry<java.lang.String,ContextEventType>
Overrides:
register in class BaseRegistry<java.lang.String,ContextEventType>
Parameters:
eventType - the value.
Throws:
AlreadyRegisteredException - if a value with same key is already registered.
See Also:
BaseRegistry.set(Object...)

unregister

public void unregister(java.lang.String name)
                throws NotRegisteredException
Description copied from class: BaseRegistry
Unregisters value associated with specified key. If there is no value associated with specified key the registry remains unchanged and this method will throw NotRegisteredException.

Specified by:
unregister in interface ContextEventTypeRegistry
Specified by:
unregister in interface Registry<java.lang.String,ContextEventType>
Overrides:
unregister in class BaseRegistry<java.lang.String,ContextEventType>
Parameters:
name - the key.
Throws:
NotRegisteredException - if there is no value associated with specified key.

getAll

public ContextEventType[] getAll()
Description copied from interface: ContextEventTypeRegistry
Returns all currently registered ContextEventTypes.

Specified by:
getAll in interface ContextEventTypeRegistry
Specified by:
getAll in interface Registry<java.lang.String,ContextEventType>
Returns:
all currently registered ContextEventTypes.

getKey

protected java.lang.String getKey(ContextEventType eventType)
Description copied from class: BaseRegistry
Return the key for specified value.

Specified by:
getKey in class BaseRegistry<java.lang.String,ContextEventType>
Parameters:
eventType - the value.
Returns:
the key.

unregisterAll

protected void unregisterAll()
Description copied from class: BaseRegistry
Unregisters all registered values.

Overrides:
unregisterAll in class BaseRegistry<java.lang.String,ContextEventType>


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.