public abstract class AbstractComponent<Type> extends Object implements Component<Type>
Modifier | Constructor and Description |
---|---|
protected |
AbstractComponent(String aName)
Creates a new AbstractComponent object.
|
protected |
AbstractComponent(String aName,
List<ProvidedInterface> aProvided,
List<RequiredInterface> aRequired)
Constructs the subsystem.
|
protected |
AbstractComponent(String aName,
ProvidedInterface[] aProvided,
RequiredInterface[] aRequired)
Constructs the subsystem.
|
Modifier and Type | Method and Description |
---|---|
void |
addContext(String aContext)
Prepends the context with a super context.
|
protected void |
addInterface(ProvidedInterface aDescriptor,
Object aService,
Scope aScope)
Implementations must call this method to indicate that a new service has
been started.
|
AbstractComponent<Type> |
addProvidedInterface(ProvidedInterface aProvided) |
AbstractComponent<Type> |
addRequiredInterface(RequiredInterface aRequired) |
protected abstract Type |
doStart(Scope aScope)
Must be implemented for initializing the subsystem.
|
protected abstract void |
doStop(Type aRuntime) |
ProvidedInterface |
findProvidedInterface(String aName) |
RequiredInterface |
findRequiredInterface(String aName) |
String |
getContext()
Getst the context.
|
String |
getName()
Gets the name of the subsystem.
|
List<ProvidedInterface> |
getProvidedInterfaces()
Gets a description of the provided interfaces.
|
String |
getQualifiedName()
Gets the fully qualified name of the component which includes the context
of the component.
|
List<RequiredInterface> |
getRequiredInterfaces()
Gets a description of the required interfaces.
|
Type |
start(Scope aScope)
Initialises the subsystem by starting all the services that it described
as provided.
|
void |
stop(Type aRuntime)
Stops a component.
|
String |
toString() |
protected AbstractComponent(String aName, List<ProvidedInterface> aProvided, List<RequiredInterface> aRequired)
aName
- Name of the system.aProvided
- Provided services.aRequired
- Required services.protected AbstractComponent(String aName, ProvidedInterface[] aProvided, RequiredInterface[] aRequired)
aName
- Name of the system.aProvided
- Provided services.aRequired
- Required services.protected AbstractComponent(String aName)
public AbstractComponent<Type> addProvidedInterface(ProvidedInterface aProvided)
public AbstractComponent<Type> addRequiredInterface(RequiredInterface aRequired)
public final String getName()
Component
public void addContext(String aContext)
Component
addContext
in interface Component<Type>
public String getContext()
Component
getContext
in interface Component<Type>
public String getQualifiedName()
Component
getQualifiedName
in interface Component<Type>
public final List<ProvidedInterface> getProvidedInterfaces()
Component
getProvidedInterfaces
in interface Component<Type>
public final List<RequiredInterface> getRequiredInterfaces()
Component
getRequiredInterfaces
in interface Component<Type>
public final Type start(Scope aScope)
Component
protected abstract Type doStart(Scope aScope)
addInterface(ProvidedInterface, Object, Scope)
for
each service that is started.protected final void addInterface(ProvidedInterface aDescriptor, Object aService, Scope aScope)
aDescriptor
- Provided interface.aService
- Implementation of the interface.aScope
- scope in which to publish the implementation.public void stop(Type aRuntime)
Component
protected abstract void doStop(Type aRuntime)
public ProvidedInterface findProvidedInterface(String aName)
public RequiredInterface findRequiredInterface(String aName)
Copyright © 2022. All rights reserved.