org.slim3.container
Class S3Container

java.lang.Object
  extended by org.slim3.container.S3Container

public class S3Container
extends Object

Slim3 container.

Since:
3.0
Author:
higa

Field Summary
static String BACK_NAMING_FACTORY_KEY
          The key for back initial context factory.
protected  Context backContext
          The back naming context.
protected  ConcurrentHashMap<String,Object> repository
          The repository.
 
Constructor Summary
S3Container()
          Constructor.
 
Method Summary
 void bind(String name, Object obj)
          Binds the name to the object.
 void clear()
          Clears the repository.
<T> T
lookup(String name)
          Looks up an object.
protected  void prepareBackContext()
          Prepares back naming context.
 void rebind(String name, Object obj)
          Binds the name to the object, overwriting any existing binding.
protected  PrototypeBeanFactory registerBeanFactory(String name)
          Registers a bean factory.
 void unbind(String name)
          Unbinds the named object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACK_NAMING_FACTORY_KEY

public static final String BACK_NAMING_FACTORY_KEY
The key for back initial context factory.

See Also:
Constant Field Values

repository

protected ConcurrentHashMap<String,Object> repository
The repository.


backContext

protected Context backContext
The back naming context.

Constructor Detail

S3Container

public S3Container()
Constructor.

Method Detail

prepareBackContext

protected void prepareBackContext()
Prepares back naming context.


bind

public void bind(String name,
                 Object obj)
          throws NameAlreadyBoundRuntimeException
Binds the name to the object.

Parameters:
name - the name
obj - the object
Throws:
NameAlreadyBoundRuntimeException - if the name is already bound to another object

unbind

public void unbind(String name)
            throws NameNotFoundRuntimeException
Unbinds the named object.

Parameters:
name - the name.
Throws:
NameNotFoundRuntimeException - if the name is not bound to any objects

rebind

public void rebind(String name,
                   Object obj)
Binds the name to the object, overwriting any existing binding.

Parameters:
name - the name
obj - the object

lookup

public <T> T lookup(String name)
         throws NameNotFoundRuntimeException
Looks up an object.

Type Parameters:
T - object type
Parameters:
name - the name
Returns:
an object
Throws:
NameNotFoundRuntimeException - if the name is not bound to any objects

clear

public void clear()
Clears the repository.


registerBeanFactory

protected PrototypeBeanFactory registerBeanFactory(String name)
Registers a bean factory.

Parameters:
name - the name
Returns:
a bean factory


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.