org.oddjob.beanbus.mega
Class MegaBeanBus

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.BasePrimary
          extended by org.oddjob.framework.StructuralJob<Object>
              extended by org.oddjob.beanbus.mega.MegaBeanBus
All Implemented Interfaces:
Serializable, Runnable, ArooaContextAware, ArooaSessionAware, ConfigurationOwner, ServiceProvider, BusServiceProvider, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful, Stoppable, Structural

public class MegaBeanBus
extends StructuralJob<Object>
implements ConfigurationOwner, BusServiceProvider

Description

A job that allows the construction of a BeanBus.

A Bean Bus is an assembly of Collections.

Example

A simple bus example.
<oddjob>
    <job>
        <bean class="org.oddjob.beanbus.mega.MegaBeanBus" id="bus">
            <parts>
                <bus:iterable-driver xmlns:bus="oddjob:beanbus">
                    <beans>
                        <list>
                            <values>
                                <value value="Apple"/>
                                <value value="Orange"/>
                                <value value="Pear"/>
                            </values>
                        </list>
                    </beans>
                </bus:iterable-driver>
                <bus:bean-capture id="list" xmlns:bus="oddjob:beanbus"/>
            </parts>
        </bean>
    </job>
</oddjob>
See Also:
Serialized Form
Author:
Rob Gordon

Field Summary
 
Fields inherited from class org.oddjob.framework.StructuralJob
childHelper, childStateReflector, stateHandler, stop, structuralState
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
MegaBeanBus()
          Only constructor.
 
Method Summary
 void addOwnerStateListener(OwnerStateListener listener)
          Add a listener.
protected  void execute()
          Execute this job.
 BusConductor getBusConductor()
           
protected  StateOperator getInitialStateOp()
          Subclasses must provide the StateOperator that will decide how to evaluate the children's state.
 BusService getServices()
          Provider the services.
 boolean isNoAutoLink()
           
protected  void onReset()
          Allow sub classes to do something on reset.
 ConfigurationSession provideConfigurationSession()
          Provide a ConfigurationSession.
 void removeOwnerStateListener(OwnerStateListener listener)
          Remove a listener.
 DesignFactory rootDesignFactory()
          Get the design factory for the configuration.
 ArooaElement rootElement()
          Get the root element.
 void setArooaContext(ArooaContext context)
           
 void setBusConductor(BusConductor busConductor)
           
 void setNoAutoLink(boolean noAutoLink)
           
 void setParts(int index, Object child)
          Add a child.
 
Methods inherited from class org.oddjob.framework.StructuralJob
addStructuralListener, fireDestroyedState, force, getStateChanger, hardReset, isStop, onDestroy, onStop, removeStructuralListener, run, softReset, startChildStateReflector, stateHandler, stop
 
Methods inherited from class org.oddjob.framework.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toString
 
Methods inherited from class org.oddjob.framework.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 

Constructor Detail

MegaBeanBus

public MegaBeanBus()
Only constructor.

Method Detail

setArooaContext

public void setArooaContext(ArooaContext context)
Specified by:
setArooaContext in interface ArooaContextAware
Overrides:
setArooaContext in class BaseComponent

provideConfigurationSession

public ConfigurationSession provideConfigurationSession()
Description copied from interface: ConfigurationOwner
Provide a ConfigurationSession.

Specified by:
provideConfigurationSession in interface ConfigurationOwner
Returns:
A ConfigurationSession. My be null if no session is available.

addOwnerStateListener

public void addOwnerStateListener(OwnerStateListener listener)
Description copied from interface: ConfigurationOwner
Add a listener.

Specified by:
addOwnerStateListener in interface ConfigurationOwner

removeOwnerStateListener

public void removeOwnerStateListener(OwnerStateListener listener)
Description copied from interface: ConfigurationOwner
Remove a listener.

Specified by:
removeOwnerStateListener in interface ConfigurationOwner

rootDesignFactory

public DesignFactory rootDesignFactory()
Description copied from interface: ConfigurationOwner
Get the design factory for the configuration. If this is null the Oddjob Explorer won't show a DesignInside action.

Specified by:
rootDesignFactory in interface ConfigurationOwner
Returns:
A DesignFactory. Must not be null if a ConfigurationSession is available.

rootElement

public ArooaElement rootElement()
Description copied from interface: ConfigurationOwner
Get the root element.

Specified by:
rootElement in interface ConfigurationOwner
Returns:
The root element of the configuration. Must not be null if a ConfiguraitonSession is available.

getInitialStateOp

protected StateOperator getInitialStateOp()
Description copied from class: StructuralJob
Subclasses must provide the StateOperator that will decide how to evaluate the children's state.

Specified by:
getInitialStateOp in class StructuralJob<Object>
Returns:
A State Operator. Must not be null.

setParts

public void setParts(int index,
                     Object child)
Add a child.

Property: jobs

Description: The child jobs.

Required: No, but pointless if missing.

Parameters:
child - A child

execute

protected void execute()
                throws Exception
Description copied from class: StructuralJob
Execute this job.

Specified by:
execute in class StructuralJob<Object>
Throws:
Exception - If the unexpected occurs.

onReset

protected void onReset()
Description copied from class: StructuralJob
Allow sub classes to do something on reset.

Overrides:
onReset in class StructuralJob<Object>

getServices

public BusService getServices()
Description copied from interface: ServiceProvider
Provider the services.

Specified by:
getServices in interface ServiceProvider
Specified by:
getServices in interface BusServiceProvider
Returns:
The services. May be null.

getBusConductor

public BusConductor getBusConductor()

setBusConductor

public void setBusConductor(BusConductor busConductor)

isNoAutoLink

public boolean isNoAutoLink()

setNoAutoLink

public void setNoAutoLink(boolean noAutoLink)