|
||||||||||
| 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, SOTO_LIFE_CYCLE |
| 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(java.lang.String id,
java.lang.Object ref)
Binds an object under a given identifier. |
void |
dispose()
Internally shuts down all services and layers. |
SotoApplicationFactory |
getApplicationFactory()
|
LifeCycleManager |
getDefaultLifeCycleManager()
|
LifeCycleManager |
getLifeCycleManagerFor(java.lang.String name)
|
org.sapia.resource.ResourceHandler |
getResourceHandlerFor(java.lang.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(java.io.File f)
Loads the Soto XML descriptor whose file is given. |
SotoContainer |
load(java.io.File f,
java.util.Map map)
Loads the Soto XML descriptor whose file is given. |
SotoContainer |
load(java.io.InputStream is)
Loads the Soto XML descriptor whose stream is given. |
SotoContainer |
load(java.io.InputStream is,
java.util.Map vars)
Loads the Soto XML descriptor whose stream is given. |
SotoContainer |
load(java.lang.String resourceName)
Loads the Soto XML descriptor whose resource is given. |
SotoContainer |
load(java.lang.String resourceName,
java.util.Map vars)
Loads the Soto XML descriptor whose resource is given. |
SotoContainer |
load(java.net.URL url,
java.util.Map map)
Loads the Soto XML descriptor whose URL is given. |
java.lang.Object |
lookup(java.lang.Class instanceOf)
Looks up for the object that is an instance of the specified interface. |
java.util.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. |
java.lang.Object |
lookup(java.lang.String id)
Looks up for the object identified by the given ID and returns it. |
void |
registerLifeCycleManager(java.lang.String name,
LifeCycleManager manager)
Registers the given life-cycle manager with this instance. |
java.lang.Object |
resolveRef(java.lang.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,
java.lang.Exception
meta - a ServiceMetaData.
DuplicateException
java.lang.Exception
public void bind(java.lang.String id,
java.lang.Object ref)
id - an arbitrary identifier.ref - an Object
public java.lang.Object resolveRef(java.lang.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 java.lang.Object lookup(java.lang.String id)
throws NotFoundException
NotFoundException - if no object could be found.
public java.lang.Object lookup(java.lang.Class instanceOf)
throws NotFoundException
instanceOf - an interface, specified as a Class instance.
NotFoundException - if no object could be found.
public java.util.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(java.io.InputStream is,
java.util.Map vars)
throws java.lang.Exception
is - an InputStream.vars - a Map of name/value pairs that can be recuperated in
the configuration using the ${varname} notation.
java.lang.Exception
public SotoContainer load(java.io.InputStream is)
throws java.lang.Exception
is - an InputStream.
java.lang.Exception
public SotoContainer load(java.lang.String resourceName,
java.util.Map vars)
throws java.lang.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.
java.lang.Exception
public SotoContainer load(java.lang.String resourceName)
throws java.lang.Exception
resourceName - the name of the classpath resource that contains the
configuration.
java.lang.Exception
public SotoContainer load(java.io.File f,
java.util.Map map)
throws java.lang.Exception
f - a File.map - a Map of name/value pairs that can be recuperated in
the configuration using the ${varname} notation.
java.lang.Exception
public SotoContainer load(java.net.URL url,
java.util.Map map)
throws java.lang.Exception
url - an URL.map - a Map of name/value pairs that can be recuperated in
the configuration using the ${varname} notation.
java.lang.Exception
public SotoContainer load(java.io.File f)
throws java.lang.Exception
f - a File.
java.lang.Exception
public void start()
throws java.lang.Exception
java.lang.ExceptionService.start()public void dispose()
Service.dispose(),
Layer.dispose()public SotoResourceHandlerChain getResourceHandlers()
ResourceHandlerChain that this instance holds.public org.sapia.resource.ResourceHandler getResourceHandlerFor(java.lang.String uri)
ResourceHander.
public void registerLifeCycleManager(java.lang.String name,
LifeCycleManager manager)
name - the unique name under which to bind the given LifeCycleManager in
this container.manager - a LifeCycleManager
public LifeCycleManager getLifeCycleManagerFor(java.lang.String name)
throws java.lang.IllegalArgumentException
name - the name of the LifeCycleManager to return.
LifeCycleManager corresponding to the given name.
java.lang.IllegalArgumentException - if no such instance could be found.public LifeCycleManager getDefaultLifeCycleManager()
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 | |||||||||