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

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,ContextProcessor>
              extended by at.ac.tuwien.infosys.sm4all.copal.core.internal.ContextProcessorRegistryImpl
All Implemented Interfaces:
ContextProcessorRegistry, Observable<RegistryObservable.RegistrationState,ContextProcessor,RegistryObservable.RegistryObserver<ContextProcessor>>, Registry<java.lang.String,ContextProcessor>, RegistryObservable<ContextProcessor>, org.osgi.framework.BundleActivator

public class ContextProcessorRegistryImpl
extends RegistryService<java.lang.String,ContextProcessor>
implements ContextProcessorRegistry

Implementation of the ContextProcessorRegistry interface used by COPAL core.

Author:
fei, 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
ContextProcessorRegistryImpl()
          Creates an instance of the ContextProcessorRegistry implementation.
 
Method Summary
 ContextProcessor[] getAll()
          Returns all currently registered ContextProcessors.
 ContextProcessor[] getAll(java.lang.String eventType)
          Returns all ContextProcessors which process events of specified event type.
protected  java.lang.String getKey(ContextProcessor processor)
          Return the key for specified value.
 boolean isStarted()
          Returns if this ContextProcessorRegistry has been started by an OSGi framework.
 void register(ContextProcessor processor)
          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.ContextProcessorRegistry
get, isRegistered
 
Methods inherited from interface at.ac.tuwien.infosys.sm4all.copal.api.util.Observable
attach, detach
 

Constructor Detail

ContextProcessorRegistryImpl

public ContextProcessorRegistryImpl()
Creates an instance of the ContextProcessorRegistry implementation.

Method Detail

isStarted

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

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

register

public void register(ContextProcessor processor)
              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 ContextProcessorRegistry
Specified by:
register in interface Registry<java.lang.String,ContextProcessor>
Overrides:
register in class BaseRegistry<java.lang.String,ContextProcessor>
Parameters:
processor - 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 ContextProcessorRegistry
Specified by:
unregister in interface Registry<java.lang.String,ContextProcessor>
Overrides:
unregister in class BaseRegistry<java.lang.String,ContextProcessor>
Parameters:
name - the key.
Throws:
NotRegisteredException - if there is no value associated with specified key.

getAll

public ContextProcessor[] getAll()
Description copied from interface: ContextProcessorRegistry
Returns all currently registered ContextProcessors.

Specified by:
getAll in interface ContextProcessorRegistry
Specified by:
getAll in interface Registry<java.lang.String,ContextProcessor>
Returns:
all currently registered ContextProcessors.

getAll

public ContextProcessor[] getAll(java.lang.String eventType)
Description copied from interface: ContextProcessorRegistry
Returns all ContextProcessors which process events of specified event type.

Specified by:
getAll in interface ContextProcessorRegistry
Parameters:
eventType - the name of ContextEventType.
Returns:
all ContextProcessors which process events of specified event type.

getKey

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

Specified by:
getKey in class BaseRegistry<java.lang.String,ContextProcessor>
Parameters:
processor - 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,ContextProcessor>


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