Apache Tuscany SCA Kernel Sub-Project

org.apache.tuscany.spi.component
Class AbstractSCAObject

java.lang.Object
  extended by org.apache.tuscany.spi.AbstractLifecycle
      extended by org.apache.tuscany.spi.component.AbstractSCAObject
All Implemented Interfaces:
SCAObject, EventPublisher, Lifecycle
Direct Known Subclasses:
AtomicComponentExtension, CompositeComponentExtension, ReferenceExtension, ServiceExtension

public abstract class AbstractSCAObject
extends AbstractLifecycle
implements SCAObject

Functionality common to all SCAObject implementations

Version:
$Rev: 451895 $ $Date: 2006-10-01 23:58:18 -0700 (Sun, 01 Oct 2006) $

Field Summary
protected  Map<EventFilter,List<RuntimeEventListener>> listeners
           
protected  CompositeComponent parent
           
protected static EventFilter TRUE_FILTER
           
 
Fields inherited from class org.apache.tuscany.spi.AbstractLifecycle
lifecycleState
 
Fields inherited from interface org.apache.tuscany.spi.Lifecycle
CONFIG_ERROR, ERROR, INITIALIZED, INITIALIZING, RUNNING, STOPPED, STOPPING, UNINITIALIZED
 
Constructor Summary
AbstractSCAObject(String name, CompositeComponent parent)
           
 
Method Summary
 void addListener(EventFilter filter, RuntimeEventListener listener)
          Registers a listener to receive notifications for the context
 void addListener(RuntimeEventListener listener)
          Registers a listener to receive notifications for the context
 Map<Object,Object> getExtensions()
          The extensions map contains other runtime context such as type systems for various databindings
protected  Map<EventFilter,List<RuntimeEventListener>> getListeners()
           
 String getName()
          Returns the artifact name
 CompositeComponent getParent()
          Returns the parent composite, or null if the artifact does not have one
 boolean isSystem()
          Returns true if the artifact is a system artifact
 void prepare()
          Called to signal that the composite should perform and required steps prior to registration with its parent such as wiring of its children
 void publish(Event event)
          Publish an event
 void removeListener(RuntimeEventListener listener)
          Removes a previously registered listener
 String toString()
          Returns the current lifecycle as a String (for example, "RUNNING").
 
Methods inherited from class org.apache.tuscany.spi.AbstractLifecycle
getLifecycleState, setLifecycleState, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.tuscany.spi.component.SCAObject
getScope, getServiceInstance
 
Methods inherited from interface org.apache.tuscany.spi.Lifecycle
getLifecycleState, start, stop
 

Field Detail

TRUE_FILTER

protected static final EventFilter TRUE_FILTER

listeners

protected Map<EventFilter,List<RuntimeEventListener>> listeners

parent

protected final CompositeComponent parent
Constructor Detail

AbstractSCAObject

public AbstractSCAObject(String name,
                         CompositeComponent parent)
Method Detail

getName

public String getName()
Description copied from interface: SCAObject
Returns the artifact name

Specified by:
getName in interface SCAObject

getParent

public CompositeComponent getParent()
Description copied from interface: SCAObject
Returns the parent composite, or null if the artifact does not have one

Specified by:
getParent in interface SCAObject

addListener

public void addListener(RuntimeEventListener listener)
Description copied from interface: EventPublisher
Registers a listener to receive notifications for the context

Specified by:
addListener in interface EventPublisher

removeListener

public void removeListener(RuntimeEventListener listener)
Description copied from interface: EventPublisher
Removes a previously registered listener

Specified by:
removeListener in interface EventPublisher

addListener

public void addListener(EventFilter filter,
                        RuntimeEventListener listener)
Description copied from interface: EventPublisher
Registers a listener to receive notifications for the context

Specified by:
addListener in interface EventPublisher

publish

public void publish(Event event)
Description copied from interface: EventPublisher
Publish an event

Specified by:
publish in interface EventPublisher

getListeners

protected Map<EventFilter,List<RuntimeEventListener>> getListeners()

prepare

public void prepare()
Description copied from interface: SCAObject
Called to signal that the composite should perform and required steps prior to registration with its parent such as wiring of its children

Specified by:
prepare in interface SCAObject

toString

public String toString()
Description copied from class: AbstractLifecycle
Returns the current lifecycle as a String (for example, "RUNNING").

Overrides:
toString in class AbstractLifecycle
Returns:
the current lifecycle as a String

getExtensions

public Map<Object,Object> getExtensions()
Description copied from interface: SCAObject
The extensions map contains other runtime context such as type systems for various databindings

Specified by:
getExtensions in interface SCAObject
Returns:
A live map of extended context

isSystem

public boolean isSystem()
Description copied from interface: SCAObject
Returns true if the artifact is a system artifact

Specified by:
isSystem in interface SCAObject
Returns:
true if the artifact is a system artifact

Apache Tuscany SCA Kernel Sub-Project

-