org.objectweb.jonathan.libs.kernel.decoders

Class JAtom

Implemented Interfaces:
Component, Forkable, Initializer, MultiFactory

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 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(String _class)
Creates a new class atom whose alternatives are listed in _alternatives as JAlternatives.
JAtom(String _class, List _alternatives)
Creates a new class atom whose alternatives are listed in _alternatives as JAlternatives.

Method Summary

Component
duplicate()
Object
getFactoryValue()
Return a wrapper of this JComponent value for factory aspects.
protected void
initialize()
JAtom specific initialization code.
void
initialize(Object _obj, Context _c, int _alternative)
Implementation of the Initializer interface's initialize method.
Object
newObject(Context _c, int _alternative, Instanciable _instance)
Implementation of the MultiFactory interface's newObject method.
String
toString()

Methods inherited from class org.objectweb.jonathan.libs.kernel.decoders.LazyComponent

getIntValue, getType, getValue, initialize

Methods inherited from class org.objectweb.jonathan.libs.kernel.JComponent

duplicate, fork, getComponent, getElement, getFactoryValue, getIntValue, getReference, getType, getValue, getValue, internalFork, reset, setReference, toString

Field Details

classe

protected String classe

Constructor Details

JAtom

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


JAtom

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

Method Details

duplicate

public Component duplicate()
Overrides:
duplicate in interface JComponent


getFactoryValue

public Object getFactoryValue()
            throws JonathanException
Return a wrapper of this JComponent value for factory aspects.
Specified by:
getFactoryValue in interface Component
Overrides:
getFactoryValue in interface JComponent

Returns:
a wrapper of this JComponent value for factory aspects.

Throws:
JonathanException -


initialize

protected final void initialize()
Overrides:
initialize in interface LazyComponent


initialize

public void initialize(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.


newObject

public 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.


toString

public String toString()
Overrides:
toString in interface JComponent