com.servingxml.ioc.resources
Class IocContainerImpl

java.lang.Object
  extended by com.servingxml.ioc.resources.IocContainerImpl
All Implemented Interfaces:
IocContainer, MutableIocContainer, ResourceTable

public class IocContainerImpl
extends java.lang.Object
implements MutableIocContainer, ResourceTable

The IocContainerImpl instance holds a collection of resource objects indexed by name.


Field Summary
static java.lang.String RESOURCES_LOCATION
           
 
Constructor Summary
IocContainerImpl(ComponentDictionary componentDictionary, IocContainer parent)
           
IocContainerImpl(MutableNameTable nameTable, ComponentDictionary componentDictionary, javax.xml.transform.sax.SAXTransformerFactory transformerFactory)
           
 
Method Summary
 MutableNameTable getNameTable()
           
 QnameContext getQnameContext()
           
 javax.xml.transform.sax.SAXTransformerFactory getTransformerFactory()
           
 java.lang.String[] getUris(java.lang.Class javaInterface)
           
 void initialize(ConfigurationContext context, MutableResourceTable resourceTable)
           
 void initializeResources(ConfigurationContext context, MutableResourceTable resourceTable)
           
protected  void initInclude(AbstractConfigurationContext context, MutableResourceTable resourceTable)
           
 void load(java.net.URL resourcesUrl)
          Deprecated. 
 void loadResources(org.w3c.dom.Document resourcesDocument, java.lang.String systemId, Record parameters)
           
 void loadResources(java.net.URL resourcesUrl, Record parameters)
           
 java.lang.Object lookupConfigurationComponent(java.lang.Class javaInterface)
          Looks up the configuration resource associated with the specified java interface.
 java.lang.Object lookupServiceComponent(java.lang.Class javaInterface, java.lang.String uri)
          Looks up the service resource associated with the specified java interface and uri.
 void printDiagnostics(java.io.PrintStream ps)
           
 void putUris(java.lang.Class javaInterface, java.util.List<java.lang.String> uriList)
           
 void registerConfigurationComponent(java.lang.Class javaInterface, java.lang.Object value)
          Registes a configuration component instance associated with the specified java interface.
 void registerServiceComponent(java.lang.Class javaInterface, java.lang.String uri, java.lang.Object value)
          Registers a service component instance associated with the specified java interface and name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCES_LOCATION

public static final java.lang.String RESOURCES_LOCATION
See Also:
Constant Field Values
Constructor Detail

IocContainerImpl

public IocContainerImpl(MutableNameTable nameTable,
                        ComponentDictionary componentDictionary,
                        javax.xml.transform.sax.SAXTransformerFactory transformerFactory)

IocContainerImpl

public IocContainerImpl(ComponentDictionary componentDictionary,
                        IocContainer parent)
Method Detail

getNameTable

public MutableNameTable getNameTable()
Specified by:
getNameTable in interface IocContainer

lookupServiceComponent

public java.lang.Object lookupServiceComponent(java.lang.Class javaInterface,
                                               java.lang.String uri)
Description copied from interface: IocContainer
Looks up the service resource associated with the specified java interface and uri.

Specified by:
lookupServiceComponent in interface IocContainer
Specified by:
lookupServiceComponent in interface ResourceTable
Parameters:
javaInterface - the java interface that the component implements.
uri - the resource uri.
Returns:
A service resource if found, null otherwise.

lookupConfigurationComponent

public java.lang.Object lookupConfigurationComponent(java.lang.Class javaInterface)
Description copied from interface: IocContainer
Looks up the configuration resource associated with the specified java interface.

Specified by:
lookupConfigurationComponent in interface IocContainer
Specified by:
lookupConfigurationComponent in interface ResourceTable
Parameters:
javaInterface - the java interface that the component implements.
Returns:
A configuration resource if found, null otherwise.

registerServiceComponent

public void registerServiceComponent(java.lang.Class javaInterface,
                                     java.lang.String uri,
                                     java.lang.Object value)
Description copied from interface: MutableIocContainer
Registers a service component instance associated with the specified java interface and name.

Specified by:
registerServiceComponent in interface MutableIocContainer
Parameters:
javaInterface - the java interface that the component implements.
uri - the component instance uri
value - a service component instance if found, null otherwise.

registerConfigurationComponent

public void registerConfigurationComponent(java.lang.Class javaInterface,
                                           java.lang.Object value)
Description copied from interface: MutableIocContainer
Registes a configuration component instance associated with the specified java interface.

Specified by:
registerConfigurationComponent in interface MutableIocContainer
Parameters:
javaInterface - the java interface that the component implements.
value - a configuration component instance.

printDiagnostics

public void printDiagnostics(java.io.PrintStream ps)
Specified by:
printDiagnostics in interface IocContainer

load

@Deprecated
public void load(java.net.URL resourcesUrl)
Deprecated. 


loadResources

public void loadResources(java.net.URL resourcesUrl,
                          Record parameters)
Specified by:
loadResources in interface MutableIocContainer

loadResources

public void loadResources(org.w3c.dom.Document resourcesDocument,
                          java.lang.String systemId,
                          Record parameters)
Specified by:
loadResources in interface MutableIocContainer

initializeResources

public void initializeResources(ConfigurationContext context,
                                MutableResourceTable resourceTable)

initialize

public void initialize(ConfigurationContext context,
                       MutableResourceTable resourceTable)

initInclude

protected void initInclude(AbstractConfigurationContext context,
                           MutableResourceTable resourceTable)

getTransformerFactory

public javax.xml.transform.sax.SAXTransformerFactory getTransformerFactory()
Specified by:
getTransformerFactory in interface IocContainer

getUris

public java.lang.String[] getUris(java.lang.Class javaInterface)
Specified by:
getUris in interface IocContainer

putUris

public void putUris(java.lang.Class javaInterface,
                    java.util.List<java.lang.String> uriList)
Specified by:
putUris in interface IocContainer

getQnameContext

public QnameContext getQnameContext()
Specified by:
getQnameContext in interface IocContainer