org.jomc.spi
Interface Scope

Package class diagram package Scope

@Generated(value="org.jomc.tools.JavaSources",
           comments="See http://jomc.sourceforge.net/jomc/1.0-alpha-11/jomc-tools")
public interface Scope

Scope a specification applies to.

This specification declares a multiplicity of Many. An application assembler may provide multiple implementations of this specification (including none). Use of class ObjectManager is supported for getting these implementations or for selecting a single implementation.

 Scope[] objects = (Scope[]) ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Scope.class );
 Scope object = ObjectManagerFactory.getObjectManager( getClassLoader() ).getObject( Scope.class, "implementation name" );
 

This specification does not apply to any scope. A new object is returned whenever requested.

Version:
$Id: Scope.java 1102 2009-12-07 03:01:58Z schulte2005 $
Author:
Christian Schulte 1.0

Method Summary
 Object getObject(String identifier)
          Gets an object from the scope.
 Map<String,Object> getObjects()
          Gets the objects of the scope.
 Object putObject(String identifier, Object object)
          Puts an object into the scope.
 Object removeObject(String identifier)
          Removes an object from the scope.
 

Method Detail

getObjects

Map<String,Object> getObjects()
Gets the objects of the scope.

Returns:
The objects of the scope or null.

getObject

Object getObject(String identifier)
                 throws NullPointerException
Gets an object from the scope.

Parameters:
identifier - The identifier of the object to get from the scope.
Returns:
The object identified by identifier or null if no such object exists in the scope.
Throws:
NullPointerException - if identifier is null.

putObject

Object putObject(String identifier,
                 Object object)
                 throws NullPointerException
Puts an object into the scope.

Parameters:
identifier - The identifier of the object to put into the scope.
object - The object to put into the scope.
Returns:
The previous object from the scope or null if there was no object in the scope.
Throws:
NullPointerException - if identifier or object is null.

removeObject

Object removeObject(String identifier)
                    throws NullPointerException
Removes an object from the scope.

Parameters:
identifier - The identifier of the object to remove from the scope.
Returns:
The removed object or null if there was no object in the scope.
Throws:
NullPointerException - if identifier is null.


Copyright © 2005-2009 The JOMC Project. All Rights Reserved.