Class ComponentViewer

  extended byorg.apache.avalon.framework.logger.AbstractLogEnabled
      extended byorg.apache.avalon.fortress.impl.AbstractContainer
          extended byorg.apache.avalon.fortress.impl.DefaultContainer
              extended byorg.apache.avalon.fortress.examples.viewer.ComponentViewer
All Implemented Interfaces:
java.awt.event.ActionListener, Configurable, Container, Contextualizable, Disposable, java.util.EventListener, Initializable, LogEnabled, java.lang.Runnable, Serviceable, Startable

public final class ComponentViewer
extends DefaultContainer
implements Startable, java.awt.event.ActionListener, java.lang.Runnable

Simple Fortress container containing a Swing based viewer for performing lookups on registered components.

The intention of the viewer is to allow you to perform a lookup of a component manually, (currently) so you can check the see the effect of lazy vs startup initialization.

REVISIT: add a text component which tracks the log file to make it easier to see a component being initialized upon first lookup.

CVS $Revision: 1.8 $ $Date: 2004/02/24 22:31:22 $
Avalon Development Team

Field Summary
Fields inherited from class org.apache.avalon.fortress.impl.AbstractContainer
DEFAULT_ENTRY, m_classLoader, m_commandSink, m_componentContext, m_context, m_extManager, m_instrumentManager, m_loggerManager, m_mapper, m_metaManager, m_poolManager, m_serviceManager, m_shutDownOrder, SELECTOR_ENTRY
Fields inherited from interface org.apache.avalon.fortress.Container
Constructor Summary
Method Summary
 void actionPerformed(java.awt.event.ActionEvent evt)
          Handles the lookup event.
 void initialize()
          Initializes this component.
 void run()
 void start()
          Starts the component, makes GUI visible, ready for use.
 void stop()
          Stops component, make GUI invisible, ready for decomissioning.
Methods inherited from class org.apache.avalon.fortress.impl.DefaultContainer
configure, getServiceManager, interpretProxy
Methods inherited from class org.apache.avalon.fortress.impl.AbstractContainer
addComponent, contextualize, createHintMap, createObjectFactory, dispose, get, getProxyManager, getRoleKey, has, provideComponentContext, provideServiceManager, service, setProxyManager
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public ComponentViewer()
Method Detail


public void initialize()
                throws java.lang.Exception
Initializes this component. Creates simple Swing GUI containing available translations for the key 'hello-world'.

Specified by:
initialize in interface Initializable
initialize in class AbstractContainer
java.lang.Exception - if an error occurs


public void start()
Starts the component, makes GUI visible, ready for use.

Specified by:
start in interface Startable


public void stop()
Stops component, make GUI invisible, ready for decomissioning.

Specified by:
stop in interface Startable


public void actionPerformed(java.awt.event.ActionEvent evt)
Handles the lookup event. Finds out which component was selected and performs a lookup and release on this component.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
evt - an ActionEvent value


public void run()
Specified by:
run in interface java.lang.Runnable

Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.