|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.soto.SotoContainer
public class SotoContainer
An intance of this class contains service instances and manages their life-cycle.
| Nested Class Summary | |
|---|---|
static class |
SotoContainer.EnvImpl
|
| Field Summary |
|---|
| Fields inherited from interface org.sapia.soto.SotoConsts |
|---|
SOTO_BOOTSTRAP, SOTO_DEBUG, SOTO_ENV_KEY, SOTO_INCLUDE_KEY |
| Constructor Summary | |
|---|---|
SotoContainer()
Constructor for SotoContainer. |
|
| Method Summary | |
|---|---|
void |
bind(ServiceMetaData meta)
Binds the given object to this instance, using the specified identifier. |
void |
bind(String id,
Object ref)
Binds an object under a given identifier. |
void |
dispose()
Internally shuts down all services and layers. |
SotoApplicationFactory |
getApplicationFactory()
|
org.sapia.resource.ResourceHandler |
getResourceHandlerFor(String uri)
Returns the resource handler that corresponds to the given scheme. |
SotoResourceHandlerChain |
getResourceHandlers()
Returns the resource handlers held by this instance. |
Settings |
getSettings()
|
SotoContainer |
load(File f)
Loads the Soto XML descriptor whose file is given. |
SotoContainer |
load(File f,
Map map)
Loads the Soto XML descriptor whose file is given. |
SotoContainer |
load(InputStream is)
Loads the Soto XML descriptor whose stream is given. |
SotoContainer |
load(InputStream is,
Map vars)
Loads the Soto XML descriptor whose stream is given. |
SotoContainer |
load(String resourceName)
Loads the Soto XML descriptor whose resource is given. |
SotoContainer |
load(String resourceName,
Map vars)
Loads the Soto XML descriptor whose resource is given. |
SotoContainer |
load(URL url,
Map map)
Loads the Soto XML descriptor whose URL is given. |
Object |
lookup(Class instanceOf)
Looks up for the object that is an instance of the specified interface. |
List |
lookup(ServiceSelector selector,
boolean returnMetadata)
Internally adds the services that have been accepted by the passed in selector and returns them in a list to the caller. |
Object |
lookup(String id)
Looks up for the object identified by the given ID and returns it. |
Object |
resolveRef(String id)
|
void |
start()
Internally starts the services bound to this container. |
Env |
toEnv()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SotoContainer()
| Method Detail |
|---|
public Settings getSettings()
public void bind(ServiceMetaData meta)
throws DuplicateException,
Exception
meta - a ServiceMetaData.
DuplicateException
Exception
public void bind(String id,
Object ref)
id - an arbitrary identifier.ref - an Object
public Object resolveRef(String id)
throws NotFoundException
id - the identifier under which the expected object was registered.
Object corresponding to the given identifier.
NotFoundException#register(java.lang.String, java.lang.Object)
public Object lookup(String id)
throws NotFoundException
NotFoundException - if no object could be found.
public Object lookup(Class instanceOf)
throws NotFoundException
instanceOf - an interface, specified as a Class instance.
NotFoundException - if no object could be found.
public List lookup(ServiceSelector selector,
boolean returnMetadata)
selector - a ServiceSelector.returnMetadata - if true, this instance will return
ServiceMetadata instances. Else, it will return Service
instances.
List of Service or
ServiceMetadata instances.
public SotoContainer load(InputStream is,
Map vars)
throws Exception
is - an InputStream.vars - a Map of name/value pairs that can be recuperated in
the configuration using the ${varname} notation.
Exception
public SotoContainer load(InputStream is)
throws Exception
is - an InputStream.
Exception
public SotoContainer load(String resourceName,
Map vars)
throws Exception
resourceName - the name of the classpath resource that contains the
configuration.vars - a Map of name/value pairs that can be recuperated in
the configuration using the ${varname} notation.
Exception
public SotoContainer load(String resourceName)
throws Exception
resourceName - the name of the classpath resource that contains the
configuration.
Exception
public SotoContainer load(File f,
Map map)
throws Exception
f - a File.map - a Map of name/value pairs that can be recuperated in
the configuration using the ${varname} notation.
Exception
public SotoContainer load(URL url,
Map map)
throws Exception
url - an URL.map - a Map of name/value pairs that can be recuperated in
the configuration using the ${varname} notation.
Exception
public SotoContainer load(File f)
throws Exception
f - a File.
Exception
public void start()
throws Exception
ExceptionService.start()public void dispose()
Service.dispose(),
Layer.dispose()public SotoResourceHandlerChain getResourceHandlers()
ResourceHandlerChain that this instance holds.public org.sapia.resource.ResourceHandler getResourceHandlerFor(String uri)
ResourceHander.public SotoApplicationFactory getApplicationFactory()
SotoApplicationFactory that is used to create
objects from an XML configuration.public Env toEnv()
Env instance that corresponds to this container.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||