org.oreodata
Class DataRegistryImpl

java.lang.Object
  |
  +--java.rmi.server.RemoteObject
        |
        +--java.rmi.server.RemoteServer
              |
              +--java.rmi.server.UnicastRemoteObject
                    |
                    +--org.oreodata.DataRegistryImpl
All Implemented Interfaces:
DataRegistry, java.rmi.Remote, java.io.Serializable

public class DataRegistryImpl
extends java.rmi.server.UnicastRemoteObject
implements DataRegistry

This object plays a central role in Oreo's object-relational mapping. It is essentially a repository of "metadata" that allows us to get at the various containers as well as "exemplars" of the various data records.

Author:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
DataRegistryImpl()
           
 
Method Summary
 OreoDataSource getDataSource(java.lang.String name)
           
 java.util.List getDataSourceNames()
           
static DataRegistry getDefaultRegistry()
           
 Record getExemplar(java.lang.String type)
           
 RecordDescriptor getMetadata(java.lang.String type)
          get record Metadata for the type
 java.util.List getRecordNames()
           
 void registerDataSource(DataSourceMetadata dsm)
          register the metadata for a DataSource by its unique name.
 void registerDataSource(OreoDataSource source)
          register a DataSource by its unique name
 void registerDataSourceAlias(java.lang.String alias, DataSourceMetadata dsm)
           
 void registerRecordType(RecordDescriptor descriptor)
          Register the metadata for a record type.
static void setDefaultRegistry(DataRegistry registry)
          Optional hook to call if you want to substitute a custom DataRegistry implementation for the default one.
 void setRemoteRegistry(DataRegistry registry)
          Set a second DataRegistry source that will be used if the type is not found locally.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataRegistryImpl

public DataRegistryImpl()
                 throws java.io.IOException
Method Detail

getDefaultRegistry

public static DataRegistry getDefaultRegistry()

setDefaultRegistry

public static void setDefaultRegistry(DataRegistry registry)
Optional hook to call if you want to substitute a custom DataRegistry implementation for the default one.


setRemoteRegistry

public void setRemoteRegistry(DataRegistry registry)
                       throws java.io.IOException
Set a second DataRegistry source that will be used if the type is not found locally. This will likely be on a remote machine, hence the nomenclature.

java.io.IOException

getMetadata

public RecordDescriptor getMetadata(java.lang.String type)
                             throws java.io.IOException
Description copied from interface: DataRegistry
get record Metadata for the type

Specified by:
getMetadata in interface DataRegistry
java.io.IOException

registerRecordType

public void registerRecordType(RecordDescriptor descriptor)
                        throws java.io.IOException
Description copied from interface: DataRegistry
Register the metadata for a record type.

Specified by:
registerRecordType in interface DataRegistry
java.io.IOException

registerDataSource

public void registerDataSource(OreoDataSource source)
                        throws java.io.IOException
Description copied from interface: DataRegistry
register a DataSource by its unique name

Specified by:
registerDataSource in interface DataRegistry
java.io.IOException

registerDataSource

public void registerDataSource(DataSourceMetadata dsm)
                        throws java.io.IOException
Description copied from interface: DataRegistry
register the metadata for a DataSource by its unique name.

Specified by:
registerDataSource in interface DataRegistry
java.io.IOException

getDataSource

public OreoDataSource getDataSource(java.lang.String name)
                             throws java.io.IOException
Specified by:
getDataSource in interface DataRegistry
Returns:
a DataSource by its unique name
java.io.IOException

getExemplar

public Record getExemplar(java.lang.String type)
                   throws java.io.IOException
Specified by:
getExemplar in interface DataRegistry
Returns:
a "virgin" record of the given type
java.io.IOException

getDataSourceNames

public java.util.List getDataSourceNames()
                                  throws java.io.IOException
Specified by:
getDataSourceNames in interface DataRegistry
Returns:
a List of the names of all of the data sources that this data registry knows about.
java.io.IOException

getRecordNames

public java.util.List getRecordNames()
                              throws java.io.IOException
Specified by:
getRecordNames in interface DataRegistry
Returns:
a List of the names of all of the record types that this data registry knows about.
java.io.IOException

registerDataSourceAlias

public void registerDataSourceAlias(java.lang.String alias,
                                    DataSourceMetadata dsm)
                             throws java.io.IOException
Specified by:
registerDataSourceAlias in interface DataRegistry
java.io.IOException