net.dpml.station.server
Class RemoteApplicationRegistry

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.server.UnicastRemoteObject
              extended bynet.dpml.station.server.DefaultModel
                  extended bynet.dpml.station.server.RemoteApplicationRegistry
All Implemented Interfaces:
ApplicationRegistry, Remote, Serializable

public class RemoteApplicationRegistry
extends DefaultModel
implements ApplicationRegistry

Implements of the application registry within which a set of application profiles are maintained.

Version:
1.0.1
Author:
Digital Product Meta Library
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Fields inherited from interface net.dpml.station.ApplicationRegistry
DEFAULT_STORAGE_URI
 
Constructor Summary
RemoteApplicationRegistry(Logger logger, URL url)
          Creation of a new application registry model.
 
Method Summary
 void addApplicationDescriptor(String key, ApplicationDescriptor descriptor)
          Add an application descriptor to the registry.
 void addRegistryListener(RegistryListener listener)
          Add a depot content change listener.
 void flush()
          Flush the state of the server to external storage.
 ApplicationDescriptor getApplicationDescriptor(String key)
          Retrieve an application profile.
 int getApplicationDescriptorCount()
          Return the number of application descriptors in the registry.
 ApplicationDescriptor[] getApplicationDescriptors()
          Return an array of all profiles in the registry.
 String[] getKeys()
          Return the array of application keys.
protected  void processEvent(EventObject event)
          Proces a registry event.
 void removeApplicationDescriptor(String key)
          Remove an application descriptor from the registry.
 void removeRegistryListener(RegistryListener listener)
          Add a registry change listener.
 String toString()
          Return a string representation of the registy model.
 void updateApplicationDescriptor(String key, ApplicationDescriptor descriptor)
          Replace an application descriptor within the registry with a supplied descriptor.
 
Methods inherited from class net.dpml.station.server.DefaultModel
addListener, enqueueEvent, enqueueEvent, getLock, getLogger, listeners, removeListener
 
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, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteApplicationRegistry

public RemoteApplicationRegistry(Logger logger,
                                 URL url)
                          throws Exception
Creation of a new application registry model.

Parameters:
logger - the assigned logging channel
url - storage location
Throws:
Exception - if an error occurs
Method Detail

getKeys

public String[] getKeys()
Return the array of application keys.

Specified by:
getKeys in interface ApplicationRegistry
Returns:
the application key array

getApplicationDescriptorCount

public int getApplicationDescriptorCount()
Return the number of application descriptors in the registry.

Specified by:
getApplicationDescriptorCount in interface ApplicationRegistry
Returns:
the application descriptor count

addApplicationDescriptor

public void addApplicationDescriptor(String key,
                                     ApplicationDescriptor descriptor)
                              throws DuplicateKeyException
Add an application descriptor to the registry.

Specified by:
addApplicationDescriptor in interface ApplicationRegistry
Parameters:
key - the application key
descriptor - the application descriptor
Throws:
DuplicateKeyException - if the key is already assigned

removeApplicationDescriptor

public void removeApplicationDescriptor(String key)
                                 throws UnknownKeyException
Remove an application descriptor from the registry.

Specified by:
removeApplicationDescriptor in interface ApplicationRegistry
Parameters:
key - the application key
Throws:
UnknownKeyException - if the key is not recognized

updateApplicationDescriptor

public void updateApplicationDescriptor(String key,
                                        ApplicationDescriptor descriptor)
                                 throws UnknownKeyException
Replace an application descriptor within the registry with a supplied descriptor.

Specified by:
updateApplicationDescriptor in interface ApplicationRegistry
Parameters:
key - the application key
descriptor - the updated application descriptor
Throws:
UnknownKeyException - if the key is not recognized

getApplicationDescriptors

public ApplicationDescriptor[] getApplicationDescriptors()
Return an array of all profiles in the registry.

Specified by:
getApplicationDescriptors in interface ApplicationRegistry
Returns:
the application profiles

getApplicationDescriptor

public ApplicationDescriptor getApplicationDescriptor(String key)
                                               throws UnknownKeyException
Retrieve an application profile.

Specified by:
getApplicationDescriptor in interface ApplicationRegistry
Parameters:
key - the application profile key
Returns:
the application profile
Throws:
UnknownKeyException - if the key is unknown

flush

public void flush()
           throws IOException
Flush the state of the server to external storage.

Specified by:
flush in interface ApplicationRegistry
Throws:
IOException - if an I/O error occurs

addRegistryListener

public void addRegistryListener(RegistryListener listener)
Add a depot content change listener.

Specified by:
addRegistryListener in interface ApplicationRegistry
Parameters:
listener - the registry change listener to add

removeRegistryListener

public void removeRegistryListener(RegistryListener listener)
Add a registry change listener.

Specified by:
removeRegistryListener in interface ApplicationRegistry
Parameters:
listener - the registry change listener to add

processEvent

protected void processEvent(EventObject event)
Proces a registry event.

Specified by:
processEvent in class DefaultModel
Parameters:
event - the event top process

toString

public String toString()
Return a string representation of the registy model.

Returns:
the string value