com.aurorasoftworks.signal.runtime.core.context
Interface IContext

All Known Implementing Classes:
Context

public interface IContext

An IoC container. This is the central part of the Signal Framework API. The container maintains a map of beans (named objects) instantiated by injecting the dependencies they declared in an external configuration source. This interface was originally coded to support Spring context instantiation on the Java ME platform. Is is, however, designed to be generic and not to depend on any J2ME or Spring APIs so that other types of contexts and runtime environments can be supported if needed. The container is mutable and new beans can therefore be registered after instantiation. All implementations of this interface are expected to be thread-safe.

Author:
Marek

Method Summary
 boolean containsBean(java.lang.String name)
          Determines whether a bean with the specified name already exists.
 java.lang.Object getBean(java.lang.Class beanClass)
           
 java.lang.Object getBean(java.lang.String name)
          Retrieves a bean previously registered with the specified name.
 java.util.Vector getBeanNames(java.lang.Class beanClass)
          Returns names of the beans of the specified type
 java.util.Vector getBeans(java.lang.Class beanClass)
           
 IProxyFactory getProxyFactory()
           
 void registerBean(java.lang.String name, java.lang.Object object)
          Registers a bean using the provided name.
 

Method Detail

getBean

java.lang.Object getBean(java.lang.String name)
                         throws ContextException
Retrieves a bean previously registered with the specified name.

Parameters:
name - name of a bean to be retrieved
Returns:
a bean with the provided name or null if one does not exist
Throws:
ContextException

getBeanNames

java.util.Vector getBeanNames(java.lang.Class beanClass)
                              throws ContextException
Returns names of the beans of the specified type

Parameters:
beanClass -
Returns:
Throws:
ContextException

getBeans

java.util.Vector getBeans(java.lang.Class beanClass)
                          throws ContextException
Throws:
ContextException

getBean

java.lang.Object getBean(java.lang.Class beanClass)
                         throws ContextException
Throws:
ContextException

registerBean

void registerBean(java.lang.String name,
                  java.lang.Object object)
                  throws ContextException
Registers a bean using the provided name. If the provided name is already in use, the previous bean is replaced with the new one in this context. Note that this does not affect injected references to the previous bean.

Parameters:
name - a name of the bean being registered
object - a bean to be registered
Throws:
ContextException

containsBean

boolean containsBean(java.lang.String name)
Determines whether a bean with the specified name already exists.

Parameters:
name - a name of a bean to be located in the context
Returns:
true if a bean with the provided name exists, false otherwise

getProxyFactory

IProxyFactory getProxyFactory()


Copyright © 2010. All Rights Reserved.