Package com.helger.as2lib
Class AbstractDynamicComponent
- java.lang.Object
-
- com.helger.as2lib.AbstractDynamicComponent
-
- All Implemented Interfaces:
IDynamicComponent
- Direct Known Subclasses:
AbstractCertificateFactory,AbstractMessageProcessor,AbstractPartnershipFactory,AbstractProcessorModule
public abstract class AbstractDynamicComponent extends Object implements IDynamicComponent
Abstract implementation ofIDynamicComponent.- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description protected com.helger.commons.concurrent.SimpleReadWriteLockm_aRWLock
-
Constructor Summary
Constructors Constructor Description AbstractDynamicComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.helger.commons.collection.attr.StringMapattrs()booleanequals(Object o)intgetAttributeAsIntRequired(String sKey)StringgetAttributeAsStringRequired(String sKey)StringgetName()Returns a name for the component.IAS2SessiongetSession()Returns the Session used to initialize this Component.inthashCode()voidinitDynamicComponent(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.StringtoString()
-
-
-
Method Detail
-
attrs
@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.attr.StringMap attrs()
- Specified by:
attrsin interfaceIDynamicComponent- Returns:
- The attributes of this component.
-
getName
@Nullable public String getName()
Description copied from interface:IDynamicComponentReturns 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:
getNamein 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
@Nonnull public final IAS2Session getSession()
Description copied from interface:IDynamicComponentReturns the Session used to initialize this Component. The returned session is also used to locate other components if needed.- Specified by:
getSessionin 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:IDynamicComponentAfter 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:
initDynamicComponentin 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:
IAS2Session
-
-