org.abstracthorizon.extend.server.deployment.support
Class DirectoryModuleLoader

java.lang.Object
  extended by org.abstracthorizon.extend.server.deployment.support.DirectoryModuleLoader
All Implemented Interfaces:
ModuleLoader

public class DirectoryModuleLoader
extends Object
implements ModuleLoader

This module loader provides directories from the file system (URL with "file:" as a protocol) that are without an extension.

Author:
Daniel Sendula

Constructor Summary
DirectoryModuleLoader()
          Empty constructor
 
Method Summary
 boolean canLoad(URI uri)
          Module loader for directories.
 Module load(URI uri)
          Creates DirectoryModule and returns it.
 Module loadAs(URI uri, ModuleId moduleId)
          Creates DirectoryModule and returns it.
 ModuleId toModuleId(URI uri)
          Translates URI to moduleId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryModuleLoader

public DirectoryModuleLoader()
Empty constructor

Method Detail

canLoad

public boolean canLoad(URI uri)
Module loader for directories. It loads directories that do not have "extension" ("." in their name).

Specified by:
canLoad in interface ModuleLoader
Parameters:
uri - URI
Returns:
true if module loader knows how to load (create) module from given URI

toModuleId

public ModuleId toModuleId(URI uri)
Translates URI to moduleId

Specified by:
toModuleId in interface ModuleLoader
Parameters:
uri - uri
Returns:
module id or null

load

public Module load(URI uri)
Creates DirectoryModule and returns it.

Specified by:
load in interface ModuleLoader
Parameters:
uri - URI
Returns:
initialised DirectoryModule

loadAs

public Module loadAs(URI uri,
                     ModuleId moduleId)
Creates DirectoryModule and returns it.

Specified by:
loadAs in interface ModuleLoader
Parameters:
uri - URI
moduleId - module id
Returns:
initialised DirectoryModule


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.