org.objectweb.jonathan.libs.kernel.decoders
Class JAtom

java.lang.Object
  extended by org.objectweb.jonathan.libs.kernel.JComponent
      extended by org.objectweb.jonathan.libs.kernel.decoders.LazyComponent
          extended by org.objectweb.jonathan.libs.kernel.decoders.JAtom
All Implemented Interfaces:
Component, Initializer, MultiFactory, Forkable

public class JAtom
extends LazyComponent
implements MultiFactory, Initializer

Runtime atom component. Initialisation issues are dealt with by the LazyComponent implementation. Provides the basic behaviour of a MultiFactory too: holds a set of implementation alternatives.


Field Summary
protected  java.lang.String classe
           
 
Fields inherited from class org.objectweb.jonathan.libs.kernel.decoders.LazyComponent
initialized
 
Fields inherited from class org.objectweb.jonathan.libs.kernel.JComponent
int_value, reference, type, value
 
Constructor Summary
JAtom(java.lang.String _class)
          Creates a new class atom whose alternatives are listed in _alternatives as JAlternatives.
JAtom(java.lang.String _class, java.util.List _alternatives)
          Creates a new class atom whose alternatives are listed in _alternatives as JAlternatives.
 
Method Summary
 Component duplicate()
           
 java.lang.Object getFactoryValue()
          Return a wrapper of this JComponent value for factory aspects.
protected  void initialize()
          JAtom specific initialization code.
 void initialize(java.lang.Object _obj, Context _c, int _alternative)
          Implementation of the Initializer interface's initialize method.
 java.lang.Object newObject(Context _c, int _alternative, Instanciable _instance)
          Implementation of the MultiFactory interface's newObject method.
 java.lang.String toString()
           
 
Methods inherited from class org.objectweb.jonathan.libs.kernel.decoders.LazyComponent
getIntValue, getType, getValue
 
Methods inherited from class org.objectweb.jonathan.libs.kernel.JComponent
fork, getComponent, getElement, getReference, getValue, internalFork, reset, setReference
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

classe

protected java.lang.String classe
Constructor Detail

JAtom

public JAtom(java.lang.String _class,
             java.util.List _alternatives)
Creates a new class atom whose alternatives are listed in _alternatives as JAlternatives.


JAtom

public JAtom(java.lang.String _class)
Creates a new class atom whose alternatives are listed in _alternatives as JAlternatives.

Method Detail

duplicate

public Component duplicate()
Overrides:
duplicate in class JComponent

toString

public java.lang.String toString()
Overrides:
toString in class JComponent

getFactoryValue

public java.lang.Object getFactoryValue()
                                 throws JonathanException
Return a wrapper of this JComponent value for factory aspects.

Specified by:
getFactoryValue in interface Component
Overrides:
getFactoryValue in class JComponent
Returns:
a wrapper of this JComponent value for factory aspects.
Throws:
JonathanException

newObject

public java.lang.Object newObject(Context _c,
                                  int _alternative,
                                  Instanciable _instance)
                           throws JonathanException
Implementation of the MultiFactory interface's newObject method. Returns a new instance of the atom's implementation alternative whose ID is _alternative.

Specified by:
newObject in interface MultiFactory
Parameters:
_c - where the instanciation parameters are found
_alternative - the alternative to instantiate
_instance - the method's caller.
Returns:
an new _alternative's instance
Throws:
JonathanException - if something goes wrong.

initialize

public void initialize(java.lang.Object _obj,
                       Context _c,
                       int _alternative)
                throws JonathanException
Implementation of the Initializer interface's initialize method. Initializes an instance of the atom's implementation alternative whose ID is _alternative by calling its setters.

Specified by:
initialize in interface Initializer
Parameters:
_obj - the object to initialize
_c - where the initialisation parameters are found
_alternative - the alternative to instantiate
Throws:
JonathanException - if something goes wrong.

initialize

protected final void initialize()
JAtom specific initialization code. Instantiates the JAtom's own value. Used internally by LazyComponent.

Specified by:
initialize in class LazyComponent