org.sapia.soto.config
Class ServiceEnv

java.lang.Object
  extended by org.sapia.soto.config.ServiceEnv
All Implemented Interfaces:
Env, SotoConsts

public class ServiceEnv
extends java.lang.Object
implements Env, SotoConsts

An instance of this class is assigned to EnvAware instances.

Author:
yduchesne

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
ServiceEnv(Env parent, java.lang.String baseUri)
          Creates a new instance of ServiceEnv
 
Method Summary
 void bind(java.lang.String id, java.lang.Object o)
           
 org.sapia.util.xml.confix.ObjectFactoryIF getObjectFactory()
          Returns the object factory that is used to create objects from XML configuration files.
 org.sapia.resource.ResourceHandler getResourceHandlerFor(java.lang.String protocol)
           
 SotoResourceHandlerChain getResourceHandlers()
           
 Settings getSettings()
           
 java.lang.Object include(java.lang.String uri, java.util.Map params)
          Returns the object representation of the given resource, using the Confix API.
 java.lang.Object include(java.lang.String uri, org.sapia.util.text.TemplateContextIF context)
          Returns the object representation of the given resource, using the Confix API.
 org.sapia.resource.Resource includeResource(java.lang.String uri, java.util.Map params)
           
 java.lang.Object lookup(java.lang.Class instanceOf)
           
 java.util.List lookup(ServiceSelector selector, boolean returnMetadata)
           
 java.lang.Object lookup(java.lang.String serviceId)
           
 java.lang.Object resolveRef(java.lang.String id)
           
 org.sapia.resource.Resource resolveResource(java.lang.String uri)
          Resolves the resource corresponding to the given URI.
 java.io.InputStream resolveStream(java.lang.String uri)
          Resolves the resource corresponding to the given URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceEnv

public ServiceEnv(Env parent,
                  java.lang.String baseUri)
Creates a new instance of ServiceEnv

Method Detail

getSettings

public Settings getSettings()
Specified by:
getSettings in interface Env
Returns:
this instance's Settings.

resolveStream

public java.io.InputStream resolveStream(java.lang.String uri)
                                  throws java.io.IOException
Description copied from interface: Env
Resolves the resource corresponding to the given URI. The path can have a protocol/scheme.

Specified by:
resolveStream in interface Env
Parameters:
uri - a URI.
Returns:
the InputStream corresponding to the given resource path.
Throws:
java.io.IOException

resolveResource

public org.sapia.resource.Resource resolveResource(java.lang.String uri)
                                            throws java.io.IOException
Description copied from interface: Env
Resolves the resource corresponding to the given URI. The path can have a protocol/scheme.

Specified by:
resolveResource in interface Env
Parameters:
uri - a URI.
Returns:
the Resource corresponding to the given uri.
Throws:
java.io.IOException

lookup

public java.lang.Object lookup(java.lang.String serviceId)
                        throws NotFoundException
Specified by:
lookup in interface Env
Throws:
NotFoundException
See Also:
SotoContainer.lookup(String)

getResourceHandlerFor

public org.sapia.resource.ResourceHandler getResourceHandlerFor(java.lang.String protocol)
Specified by:
getResourceHandlerFor in interface Env
See Also:
SotoContainer.getResourceHandlerFor(String)

lookup

public java.lang.Object lookup(java.lang.Class instanceOf)
                        throws NotFoundException
Specified by:
lookup in interface Env
Throws:
NotFoundException
See Also:
SotoContainer.lookup(Class)

lookup

public java.util.List lookup(ServiceSelector selector,
                             boolean returnMetadata)
Specified by:
lookup in interface Env
See Also:
SotoContainer.lookup(ServiceSelector, boolean)

getResourceHandlers

public SotoResourceHandlerChain getResourceHandlers()
Specified by:
getResourceHandlers in interface Env
See Also:
SotoContainer.getResourceHandlers()

getObjectFactory

public org.sapia.util.xml.confix.ObjectFactoryIF getObjectFactory()
Description copied from interface: Env
Returns the object factory that is used to create objects from XML configuration files. The returned factory can be used by client applications that wish to process standalone configuration files with the Confix API.

Specified by:
getObjectFactory in interface Env
Returns:
an ObjectFactoryIF.

include

public java.lang.Object include(java.lang.String uri,
                                java.util.Map params)
                         throws org.sapia.util.xml.confix.ConfigurationException
Description copied from interface: Env
Returns the object representation of the given resource, using the Confix API.

Specified by:
include in interface Env
Throws:
org.sapia.util.xml.confix.ConfigurationException

include

public java.lang.Object include(java.lang.String uri,
                                org.sapia.util.text.TemplateContextIF context)
                         throws org.sapia.util.xml.confix.ConfigurationException
Description copied from interface: Env
Returns the object representation of the given resource, using the Confix API.

Specified by:
include in interface Env
Throws:
org.sapia.util.xml.confix.ConfigurationException

includeResource

public org.sapia.resource.Resource includeResource(java.lang.String uri,
                                                   java.util.Map params)
                                            throws org.sapia.util.xml.confix.ConfigurationException
Throws:
org.sapia.util.xml.confix.ConfigurationException

bind

public void bind(java.lang.String id,
                 java.lang.Object o)
Specified by:
bind in interface Env
See Also:
SotoContainer.bind(java.lang.String, java.lang.Object)

resolveRef

public java.lang.Object resolveRef(java.lang.String id)
                            throws NotFoundException
Specified by:
resolveRef in interface Env
Throws:
NotFoundException
See Also:
SotoContainer.resolveRef(java.lang.String)


Copyright © 2010 Sapia OSS. All Rights Reserved.