|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.lucene.gdata.server.registry.EntryEventMediator
org.apache.lucene.gdata.server.registry.GDataServerRegistry
public class GDataServerRegistry
The GDataServerRegistry represents the registry component of the GData
Server. All provided services and server components will be registered here.
The GData Server serves RSS / ATOM feeds for defined services. Each service
provides n feeds of a defined subclass of
BaseFeed
. Each feed contains m entries
of a defined subclass of BaseEntry
. To
generate RSS / ATOM formates a class of the type
ExtensionProfile
is also defined for a service.
The entry,feed and the ExtensionProfile classes are defined in the gdata-config.xml and will be loaded when the server starts up.
The components defined in the gdata-config.xml will also be loaded and instantiated at startup. If a component can not be loaded or an Exception occurs the server will not start up. To cause of the exception or error will be logged to the standard server output.
The GDataServerRegistry is a Singleton
Method Summary | ||
---|---|---|
void |
destroy()
Destroys the registry and release all resources |
|
protected void |
flushRegistry()
|
|
EntryEventMediator |
getEntryEventMediator()
|
|
ProvidedService |
getProvidedService(String service)
Looks up the ProvidedServiceConfig by the given service name. |
|
static GDataServerRegistry |
getRegistry()
|
|
Collection<ProvidedService> |
getServices()
|
|
boolean |
isServiceRegistered(String service)
|
|
|
lookup(Class<R> clazz,
ComponentType compType)
This method is the main interface to the Component Lookup Service of the registry. |
|
|
registerComponent(Class<E> componentClass,
ComponentConfiguration configuration)
All registered ServerComponent registered via this method are
available via the
lookup(Class, ComponentType) method. |
|
void |
registerScopeVisitable(ScopeVisitable visitable)
|
|
void |
registerScopeVisitor(ScopeVisitor visitor)
|
|
void |
registerService(ProvidedService configurator)
Registers a ProvidedService |
Methods inherited from class org.apache.lucene.gdata.server.registry.EntryEventMediator |
---|
allEntriesDeleted, entryAdded, entryDeleted, entryUpdated, isListenerRegistered, registerEntryEventListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static GDataServerRegistry getRegistry()
public void registerService(ProvidedService configurator)
ProvidedService
configurator
- -
the configurator to register in the registrypublic void registerScopeVisitor(ScopeVisitor visitor) throws RegistryException
visitor
- -
the visitor to register
RegistryException
public void registerScopeVisitable(ScopeVisitable visitable) throws RegistryException
visitable
- -
the instance to register
RegistryException
ScopeVisitable
public ProvidedService getProvidedService(String service)
ProvidedServiceConfig
by the given service name.
service
-
ProvidedServiceConfig
or null
if the
no configuration for this service has been registeredprotected void flushRegistry()
public boolean isServiceRegistered(String service)
service
- -
the name of the service
true
if and only if the service is registered,
otherwise false
.public void destroy()
public <R> R lookup(Class<R> clazz, ComponentType compType)
registryInstance.lookup(StorageController.class,ComponentType.STORAGECONTROLLER);
R
- the type of the expected return valueclazz
- -
Class object of the expected return valuecompType
- -
The component type
null
if the component
can not looked up.public <E extends ServerComponent> void registerComponent(Class<E> componentClass, ComponentConfiguration configuration) throws RegistryException
ServerComponent
registered via this method are
available via the
lookup(Class, ComponentType)
method. For each
ComponentType
there will be one single instance registered in the
registry.
Eventually this method invokes the initialize method of the ServerComponent interface to prepare the component to be available via the lookup service
E
- -
The interface of the component to registercomponentClass
- -
a implementation of a ServerComponent interface to register in
the registryconfiguration
- -
the component configuration ComponentConfiguration
RegistryException
- -
if the provided class does not implement the
ServerComponent
interface, if the mandatory
annotations not visible at runtime or not set, if the super
type provided by the ComponentType
for the class to
register is not a super type of the class or if the
invocation of the ServerComponent.initialize()
method
throws an exception.public EntryEventMediator getEntryEventMediator()
getEntryEventMediator
in class EntryEventMediator
EntryEventMediator.getEntryEventMediator()
public Collection<ProvidedService> getServices()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |