at.ac.tuwien.infosys.sm4all.copal.core.internal
Class RegistryService<K,V>

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<K,V>
Type Parameters:
K - the type of keys maintained by this registry.
V - the type of values maintained by this registry.
All Implemented Interfaces:
Observable<RegistryObservable.RegistrationState,V,RegistryObservable.RegistryObserver<V>>, Registry<K,V>, RegistryObservable<V>, org.osgi.framework.BundleActivator
Direct Known Subclasses:
ContextEventTypeRegistryImpl, ContextProcessorRegistryImpl, ContextPublisherRegistryImpl

public abstract class RegistryService<K,V>
extends BaseRegistry<K,V>
implements org.osgi.framework.BundleActivator

The abstract class which can be used as base class for any registry that also wants to be registered as an OSGi service.

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
protected RegistryService(java.lang.String serviceName)
          Creates an instance of the RegistryService that uses specified name as name when registering the OSGi service.
 
Method Summary
 void attach(RegistryObservable.RegistryObserver<V> observer)
          Attaches specified Observer so it will in future receive notifications on changes.
 void detach(RegistryObservable.RegistryObserver<V> observer)
          Detach specified Observer so it will not receive any future notifications on changes.
protected  boolean isStarted()
          Returns if this RegistryService has been started by an OSGi framework.
 void start(org.osgi.framework.BundleContext bundleContext)
           
 void stop(org.osgi.framework.BundleContext bundleContext)
           
 
Methods inherited from class at.ac.tuwien.infosys.sm4all.copal.api.util.BaseRegistry
get, getKey, getValues, isRegistered, register, set, setValues, unregister, unregisterAll
 
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.util.Registry
getAll
 

Constructor Detail

RegistryService

protected RegistryService(java.lang.String serviceName)
Creates an instance of the RegistryService that uses specified name as name when registering the OSGi service.

Parameters:
serviceName - the name of this RegistryService.
Method Detail

isStarted

protected boolean isStarted()
Returns if this RegistryService has been started by an OSGi framework.

Returns:
if this RegistryService has been started by an OSGi framework.

start

public void start(org.osgi.framework.BundleContext bundleContext)
Specified by:
start in interface org.osgi.framework.BundleActivator

stop

public void stop(org.osgi.framework.BundleContext bundleContext)
Specified by:
stop in interface org.osgi.framework.BundleActivator

attach

public void attach(RegistryObservable.RegistryObserver<V> observer)
Description copied from class: BaseObservable
Attaches specified Observer so it will in future receive notifications on changes.

Specified by:
attach in interface Observable<RegistryObservable.RegistrationState,V,RegistryObservable.RegistryObserver<V>>
Overrides:
attach in class BaseRegistry<K,V>
Parameters:
observer - the Observer.

detach

public void detach(RegistryObservable.RegistryObserver<V> observer)
Description copied from class: BaseObservable
Detach specified Observer so it will not receive any future notifications on changes.

Specified by:
detach in interface Observable<RegistryObservable.RegistrationState,V,RegistryObservable.RegistryObserver<V>>
Overrides:
detach in class BaseRegistry<K,V>
Parameters:
observer - the QueryObserver.


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