|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimple.http.load.PrefixMapper
public class PrefixMapper
The PrefixMapper
provides a mapper that is used to
perform mapping using prefix paths. This provides a scheme like
the Servlet context mapping scheme. This Mapper
allows arbitrary path configurations to be mapped directly to
a service name, which can be autoloaded to serve content.
This can break the URI path into four components, the prefix,
the service name, the class name, and the relative path. The
prefix is the path part that is used to acquire the service
name. A prefix is a URI directory, such as /path/
,
which is unique. The relative path is the remaining path, after
the prefix is removed. So a path of /path/bin/file
has the relative path of /bin/file
.
The specification of prefix paths to service instance names is
done using the XML configuration file Mapper.xml
.
This must is used by a MapperEngine
to resolve
services to be loaded, and can also be used by the services to
acquire the location of resources using the relative paths.
MapperEngine
Constructor Summary | |
---|---|
PrefixMapper(Context context)
Constructor for the PrefixMapper . |
Method Summary | |
---|---|
java.lang.String |
getClass(java.lang.String name)
Used to resolve the class name using a service name. |
Configuration |
getConfiguration(java.lang.String name)
This method is used retrieve properties for a service by using the service name. |
java.lang.String |
getName(java.lang.String path)
This will resolve the service instance name given a URI path. |
java.lang.String |
getPath(java.lang.String path)
This method is used to acquire a path relative to the prefix path. |
java.lang.String |
getPrefix(java.lang.String path)
This will determine the prefix path that matches the given URI path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PrefixMapper(Context context)
PrefixMapper
. This is used
to create a Mapper
that can be used to resolve
service instance names given an arbitrary URI path. This uses
a configuration file located using the Context
object supplied with the context. The configuration file is
used to acquire the mappings for URI path to service names.
context
- used to find the mapping configuration fileMethod Detail |
---|
public java.lang.String getPath(java.lang.String path)
getPath
in interface Mapper
path
- the HTTP URI to extract a relative path with
public java.lang.String getName(java.lang.String path)
getName
in interface Mapper
path
- the URI path to extract a relative path with
public java.lang.String getPrefix(java.lang.String path)
/
.
path
- the URI path to resolve a path prefix for
public Configuration getConfiguration(java.lang.String name)
getConfiguration
in interface Mapper
name
- this is the name of the service instance
public java.lang.String getClass(java.lang.String name)
getName
method. If there
is no match for the service name then null is returned.
getClass
in interface Mapper
name
- this is the service name to get a class name for
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |