org.deegree.commons.config
Class DeegreeWorkspace

java.lang.Object
  extended by org.deegree.commons.config.DeegreeWorkspace

public class DeegreeWorkspace
extends Object

Encapsulates a directory for deegree configuration files (a deegree workspace) and provides access to the configured deegree resources.

Version:
$Revision: 32084 $, $Date: 2011-10-05 10:46:15 +0200 (Wed, 05 Oct 2011) $
Author:
Andreas Schmitz, Markus Schneider, last edited by: $Author: aschmitz $

Method Summary
 void destroyAll()
          Unloads all resources associated with this context, as well as ALL STATIC ones.
static DeegreeWorkspace getInstance()
          Returns the default workspace.
static DeegreeWorkspace getInstance(String workspaceName)
          Returns the workspace with the given name.
static DeegreeWorkspace getInstance(String workspaceName, File fallbackDir)
          Returns the workspace with the given name (or the workspace for the given directory if the former does not exist).
 File getLocation()
           
 ClassLoader getModuleClassLoader()
           
 Collection<ModuleInfo> getModulesInfo()
          Returns the ModuleInfo for all deegree modules in the workspace.
 String getName()
          Returns the name of the workspace.
 List<ResourceManager> getResourceManagers()
           
<T extends ResourceManager>
T
getSubsystemManager(Class<T> c)
           
static String getWorkspaceRoot()
           
 void initAll()
          Initializes all managed configurations.
 void initManagers()
          Initializes the managers available on the classpath, but does not actually read the configurations.
static boolean isWorkspace(String name)
           
static List<String> listWorkspaces()
           
static void unregisterWorkspace(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getResourceManagers

public List<ResourceManager> getResourceManagers()
Returns:
a list of the currently loaded resource managers, never null

getModulesInfo

public Collection<ModuleInfo> getModulesInfo()
                                      throws IOException
Returns the ModuleInfo for all deegree modules in the workspace.

Returns:
Throws:
IOException

initManagers

public void initManagers()
Initializes the managers available on the classpath, but does not actually read the configurations.

Throws:
ResourceInitException

isWorkspace

public static boolean isWorkspace(String name)
Parameters:
name -
Returns:
true, if the directory $workspace_root/$name exists

getInstance

public static DeegreeWorkspace getInstance()
Returns the default workspace.

Returns:
the default workspace, never null

getInstance

public static DeegreeWorkspace getInstance(String workspaceName)
Returns the workspace with the given name.

Parameters:
workspaceName - name of the workspace, can be null (implies default workspace)
Returns:
the workspace instance (directory must not necessarily exist), never null

getInstance

public static DeegreeWorkspace getInstance(String workspaceName,
                                           File fallbackDir)
                                    throws IOException
Returns the workspace with the given name (or the workspace for the given directory if the former does not exist).

Parameters:
workspaceName - name of the workspace, can be null (implies default workspace)
fallbackDir - directory to use as workspace if the named workspace does not exist
Returns:
the workspace instance (directory must not necessarily exist), never null
Throws:
IOException

getName

public String getName()
Returns the name of the workspace.

Returns:
the name of the workspace, never null

getLocation

public File getLocation()
Returns:
the root directory of the workspace (must not necessarily exist)), never null

getSubsystemManager

public <T extends ResourceManager> T getSubsystemManager(Class<T> c)
Parameters:
c -
Returns:
null, if no such manager was loaded

initAll

public void initAll()
             throws ResourceInitException
Initializes all managed configurations.

Throws:
ResourceInitException

destroyAll

public void destroyAll()
Unloads all resources associated with this context, as well as ALL STATIC ones.


getModuleClassLoader

public ClassLoader getModuleClassLoader()

getWorkspaceRoot

public static String getWorkspaceRoot()
Returns:
the root directory for workspaces

listWorkspaces

public static List<String> listWorkspaces()
Returns:
a list of available workspaces

unregisterWorkspace

public static void unregisterWorkspace(String name)


Copyright © 2011. All Rights Reserved.