Interface Component
-
- All Known Subinterfaces:
ComponentSelector
- All Known Implementing Classes:
DefaultComponentSelector
,WrapperComponentSelector
public interface Component
This interface identifies classes that can be used asComponents
by aComposable
.The contract surrounding the
Component
is that it is used, but not a user. When a class implements this interface, it is stating that other entities may use that class.A
Component
is the basic building block of the Avalon Framework. When a class implements this interface, it allows itself to be managed by aComponentManager
and used by an outside element called aComposable
. TheComposable
must know what type ofComponent
it is accessing, so it will re-cast theComponent
into the type it needs.In order for a
Component
to be useful you must either extend this interface, or implement this interface in conjunction with one that actually has methods. The new interface is the contract with theComposable
that this is a particular type of component, and as such it can perform those functions on that type of component.For example, we want a component that performs a logging function so we extend the
Component
to be aLoggingComponent
.interface LoggingComponent extends Component { log(String message); }
Now all
Composable
s that want to use this type of component, will re-cast theComponent
into aLoggingComponent
and theComposable
will be able to use thelog
method.Deprecated: Deprecated without replacement. Should only be used while migrating away from a system based on Composable/ComponentManager. A generic
java.lang.Object
can be used as a replacement.- Version:
- CVS $Revision: 1.14 $ $Date: 2003/02/11 15:58:38 $
- Author:
- Avalon Development Team