Carbon requires that both Functional Interface and
Functional Implementation be specified in order to define a Component. This is
done via configuration (see the configuration documentation) using the interface
org.sape.carbon.core.component.ComponentConfiguration
.
The Component Configuration interface is a specific
extension of the Configuration interface that is designed to provide Carbon with
the necessary information to construct a component. In cases where a Component
requires more configuration, the ComponentConfiguration interface should be
extended to provide access to more specific configuration attributes.
All components in Carbon must have a ComponentConfiguration
instance. The Lookup Service of Carbon will provide the component to
clients by its name in the namespace. This name is the same for both
the Component and its configuration document.
An example interface and document is shown below. Note that
the interface to configure a component extends the ComponentConfiguration
interface.
Example Component Configuration
<Configuration
ConfigurationInterface="org.sape.carbon.core.component.startup.StartupServiceConfiguration">
<FunctionalImplementationClass>
org.sape.carbon.core.component.startup.DefaultStartupServiceImpl
</FunctionalImplementationClass>
<FunctionalInterface>
org.sape.carbon.core.component.startup.StartupService
</FunctionalInterface>
<StartupComponentNameArray>
<!-- The set of component names that will be loaded at system startup -->
<StartupComponentName>/deployment/DeploymentService</StartupComponentName>
<StartupComponentName>/manage/DefaultMBeanServer</StartupComponentName>
</StartupComponentNameArray>
</Configuration>
Example Component Configuration Interface
public interface StartupServiceConfiguration extends ComponentConfiguration {
/**
* <p>Gets the set of component names that need to be started.</p>
*/
String[] getStartupComponentName();
void setStartupComponentName(String[] startupComponents);
}