Interface Component
-
- All Known Subinterfaces:
ComponentSelector
public interface ComponentThis interface identifies classes that can be used asComponentsby aComposable.The contract surrounding the
Componentis 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
Componentis the basic building block of the Avalon Framework. When a class implements this interface, it allows itself to be managed by aComponentManagerand used by an outside element called aComposable. TheComposablemust know what type ofComponentit is accessing, so it will re-cast theComponentinto the type it needs.In order for a
Componentto 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 theComposablethat 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
Componentto be aLoggingComponent.interface LoggingComponent extends Component { log(String message); }Now all
Composables that want to use this type of component, will re-cast theComponentinto aLoggingComponentand theComposablewill be able to use thelogmethod.Deprecated: Deprecated without replacement. Should only be used while migrating away from a system based on Composable/ComponentManager. A generic
java.lang.Objectcan be used as a replacement.- Version:
- $Id: Component.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
- Author:
- Avalon Development Team