Package com.helger.as2lib
Class AbstractDynamicComponent
java.lang.Object
com.helger.as2lib.AbstractDynamicComponent
- All Implemented Interfaces:
IDynamicComponent
- Direct Known Subclasses:
AbstractCertificateFactory
,AbstractMessageProcessor
,AbstractPartnershipFactory
,AbstractProcessorModule
Abstract implementation of
IDynamicComponent
.- Author:
- Philip Helger
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.helger.commons.concurrent.SimpleReadWriteLock
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal com.helger.commons.collection.attr.StringMap
attrs()
boolean
final int
final String
getName()
Returns a name for the component.final IAS2Session
Returns the Session used to initialize this Component.int
hashCode()
void
initDynamicComponent
(IAS2Session aSession, com.helger.commons.collection.attr.IStringMap aParameters) After creating a Component object, this method should be called to set any parameters used by the component.toString()
-
Field Details
-
m_aRWLock
protected final com.helger.commons.concurrent.SimpleReadWriteLock m_aRWLock
-
-
Constructor Details
-
AbstractDynamicComponent
public AbstractDynamicComponent()
-
-
Method Details
-
attrs
- Specified by:
attrs
in interfaceIDynamicComponent
- Returns:
- The attributes of this component.
-
getName
Description copied from interface:IDynamicComponent
Returns a name for the component. These names are not guaranteed to be unique, and are intended for display and logging. Generally this is the class name of the Component object, without package information.- Specified by:
getName
in interfaceIDynamicComponent
- Returns:
- name of the component
-
getAttributeAsStringRequired
@Nonnull public final String getAttributeAsStringRequired(@Nonnull String sKey) throws AS2InvalidParameterException - Throws:
AS2InvalidParameterException
-
getAttributeAsIntRequired
public final int getAttributeAsIntRequired(@Nonnull String sKey) throws AS2InvalidParameterException - Throws:
AS2InvalidParameterException
-
getSession
Description copied from interface:IDynamicComponent
Returns the Session used to initialize this Component. The returned session is also used to locate other components if needed.- Specified by:
getSession
in interfaceIDynamicComponent
- Returns:
- this component's session. Never
null
.
-
initDynamicComponent
@OverridingMethodsMustInvokeSuper public void initDynamicComponent(@Nonnull IAS2Session aSession, @Nullable com.helger.commons.collection.attr.IStringMap aParameters) throws AS2Exception Description copied from interface:IDynamicComponent
After creating a Component object, this method should be called to set any parameters used by the component. Component implementations typically have required parameter checking and code to start timers and threads within this method.- Specified by:
initDynamicComponent
in interfaceIDynamicComponent
- Parameters:
aSession
- the component uses this object to access other componentsaParameters
- configuration values for the component. All parameters will be stored as attributes of this component. All attributes existing before this method is called will be removed!- Throws:
AS2Exception
- If an error occurs while initializing the componentAS2InvalidParameterException
- If a required parameter is null in the parameters Map- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
-