org.activemath.config
Class ManagerSubconfiguration

java.lang.Object
  extended by org.activemath.config.ManagerSubconfiguration
All Implemented Interfaces:
Subconfiguration

public final class ManagerSubconfiguration
extends Object
implements Subconfiguration

A class to produce a Subconfiguration object from the Manager's properties.

Version:
date

Constructor Summary
ManagerSubconfiguration(String prefix)
           
 
Method Summary
 boolean getBoolean(String name)
          Tries to compute the boolean value of the value of the given property.
 Collection getChildrenNames(String subPrefix)
          Returns the next step completion given the named prefix.
 int getInt(String name)
          Tries to compute the integer value of the value of the given property.
 URL getPath(String name)
          Computes the path of the given properties according to ActiveMath's mechanism (using a possible extra <name>.refType property.
 String getProperty(String name)
          Returns the values for the given name or null if there's none.
 Iterator getPropertyNames()
          Returns an enumeration of all the property names.
 Object getService(String serviceInterfaceClassName)
          This method returns a service implementing one of the following interfaces: MBaseRef is provided by Manager.getOfficialMBase() AbstractUserModel is provided by Manager#getUserModel MathWebBrokerWrapper is provided by Manager.getMathWebBroker() de.marf.crypt.identities.PermanentIdenticator is provided by Manager#getPermanentIdenticator.
 Subconfiguration getSubconfiguration(String prefix)
          Creates a sub-configuration object with the properties with given prefix.
 URL pathFromString(String pathString)
          Computes the path for the obtained property value.
 void refreshServices()
          does nothing
 void setDefaultProperties(Map props)
          Sets the default properties for this component.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagerSubconfiguration

public ManagerSubconfiguration(String prefix)
Method Detail

setDefaultProperties

public void setDefaultProperties(Map props)
Description copied from interface: Subconfiguration
Sets the default properties for this component. This allows a configured object to set its default values which are used by the configuration implementation. The keys and values of the map passed as argument are supposed to be String.

Specified by:
setDefaultProperties in interface Subconfiguration

getProperty

public String getProperty(String name)
Description copied from interface: Subconfiguration
Returns the values for the given name or null if there's none.

Specified by:
getProperty in interface Subconfiguration

getPath

public URL getPath(String name)
Description copied from interface: Subconfiguration
Computes the path of the given properties according to ActiveMath's mechanism (using a possible extra <name>.refType property.

Specified by:
getPath in interface Subconfiguration
See Also:
Manager.getPath(java.lang.String)

pathFromString

public URL pathFromString(String pathString)
Description copied from interface: Subconfiguration
Computes the path for the obtained property value.

Specified by:
pathFromString in interface Subconfiguration

getBoolean

public boolean getBoolean(String name)
Description copied from interface: Subconfiguration
Tries to compute the boolean value of the value of the given property.

Specified by:
getBoolean in interface Subconfiguration

getInt

public int getInt(String name)
Description copied from interface: Subconfiguration
Tries to compute the integer value of the value of the given property.

Specified by:
getInt in interface Subconfiguration

getService

public Object getService(String serviceInterfaceClassName)
This method returns a service implementing one of the following interfaces: If none of these match, it will return one configured as in SubconfImpl.PropertiesConfig. This method will offer more objects as it's life goes on allowing the ability to remove entirely the static references to the Manager class thus making implementations using this class presumably portable in different settings (e.g. using a simple xml or properties file).

Specified by:
getService in interface Subconfiguration
Returns:
an object of a class implementing the service-interface-class.
Throws:
IllegalArgumentException - if the service indicated does not exist

refreshServices

public void refreshServices()
does nothing

Specified by:
refreshServices in interface Subconfiguration

getPropertyNames

public Iterator getPropertyNames()
Description copied from interface: Subconfiguration
Returns an enumeration of all the property names.

Specified by:
getPropertyNames in interface Subconfiguration

getChildrenNames

public Collection getChildrenNames(String subPrefix)
Description copied from interface: Subconfiguration
Returns the next step completion given the named prefix.

As an example, given

    i.a.blop.c = val1
i.b.blip = val2

This method, called with "i", would return the enumeration made of the string "a" and the string "b".

Specified by:
getChildrenNames in interface Subconfiguration
Parameters:
subPrefix - the prefix string, without the trailing "." or null if the root property names is wished.

getSubconfiguration

public Subconfiguration getSubconfiguration(String prefix)
Description copied from interface: Subconfiguration
Creates a sub-configuration object with the properties with given prefix.

Specified by:
getSubconfiguration in interface Subconfiguration
Parameters:
prefix - the prefix string, without the trailing "."