Package org.pipservices3.container.refer
Class RunReferencesDecorator
java.lang.Object
org.pipservices3.container.refer.ReferencesDecorator
org.pipservices3.container.refer.RunReferencesDecorator
- All Implemented Interfaces:
org.pipservices3.commons.refer.IReferences
,org.pipservices3.commons.run.IClosable
,org.pipservices3.commons.run.IOpenable
public class RunReferencesDecorator
extends ReferencesDecorator
implements org.pipservices3.commons.run.IOpenable
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the decorator.RunReferencesDecorator
(org.pipservices3.commons.refer.IReferences baseReferences) Creates a new instance of the decorator.RunReferencesDecorator
(org.pipservices3.commons.refer.IReferences nextReferences, org.pipservices3.commons.refer.IReferences topReferences) Creates a new instance of the decorator. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Closes component and frees used resources.boolean
isOpen()
Checks if the component is opened.void
Opens the component.void
Puts a new reference into this reference map.Removes a previously added reference that matches specified locator.Removes all component references that match the specified locator.Methods inherited from class org.pipservices3.container.refer.ReferencesDecorator
find, find, getAll, getAllLocators, getNextReferences, getOneOptional, getOneOptional, getOneRequired, getOneRequired, getOptional, getOptional, getRequired, getRequired, getTopReferences, setNextReferences, setTopReferences
-
Constructor Details
-
RunReferencesDecorator
public RunReferencesDecorator()Creates a new instance of the decorator. -
RunReferencesDecorator
public RunReferencesDecorator(org.pipservices3.commons.refer.IReferences baseReferences) Creates a new instance of the decorator.- Parameters:
baseReferences
- the next references or decorator in the chain.
-
RunReferencesDecorator
public RunReferencesDecorator(org.pipservices3.commons.refer.IReferences nextReferences, org.pipservices3.commons.refer.IReferences topReferences) Creates a new instance of the decorator.- Parameters:
nextReferences
- the next references or decorator in the chain.topReferences
- the decorator at the top of the chain.
-
-
Method Details
-
isOpen
public boolean isOpen()Checks if the component is opened.- Specified by:
isOpen
in interfaceorg.pipservices3.commons.run.IOpenable
- Returns:
- true if the component has been opened and false otherwise.
-
open
Opens the component.- Specified by:
open
in interfaceorg.pipservices3.commons.run.IOpenable
- Parameters:
correlationId
- (optional) transaction id to trace execution through call chain.- Throws:
org.pipservices3.commons.errors.ApplicationException
- when error occured.
-
close
Closes component and frees used resources.- Specified by:
close
in interfaceorg.pipservices3.commons.run.IClosable
- Parameters:
correlationId
- (optional) transaction id to trace execution through call chain.- Throws:
org.pipservices3.commons.errors.ApplicationException
- when error occured.
-
put
public void put(Object locator, Object component) throws org.pipservices3.commons.errors.ApplicationException Puts a new reference into this reference map.- Specified by:
put
in interfaceorg.pipservices3.commons.refer.IReferences
- Overrides:
put
in classReferencesDecorator
- Parameters:
locator
- a locator to find the reference by.component
- a component reference to be added.- Throws:
org.pipservices3.commons.errors.ApplicationException
- when error occured.
-
remove
Removes a previously added reference that matches specified locator. If many references match the locator, it removes only the first one. When all references shall be removed, use removeAll() method instead.- Specified by:
remove
in interfaceorg.pipservices3.commons.refer.IReferences
- Overrides:
remove
in classReferencesDecorator
- Parameters:
locator
- a locator to remove reference- Returns:
- the removed component reference.
- Throws:
org.pipservices3.commons.errors.ApplicationException
- when error occured.- See Also:
-
removeAll
public List<Object> removeAll(Object locator) throws org.pipservices3.commons.errors.ApplicationException Removes all component references that match the specified locator.- Specified by:
removeAll
in interfaceorg.pipservices3.commons.refer.IReferences
- Overrides:
removeAll
in classReferencesDecorator
- Parameters:
locator
- the locator to remove references by.- Returns:
- a list, containing all removed references.
- Throws:
org.pipservices3.commons.errors.ApplicationException
- when error occured.
-