DynamicServiceExecutor
with a URL based
ServiceExtractor
instead.@Deprecated @ComponentProfile(summary="Locate and execute a service definition based on attributes of the message", tag="service,dynamic") @Removal(version="3.11.0") public class DynamicServiceLocator extends ServiceImp implements EventHandlerAware
Implementation of Service
which dynamically obtains and applies a
Service
to an AdaptrisMessage
based on its
TradingRelationship
.
In the adapter configuration file this class is aliased as dynamic-service-locator which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
DynamicServiceLocator()
Deprecated.
Creates a new Instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeService()
Deprecated.
|
void |
doService(AdaptrisMessage msg)
Deprecated.
Performs the service.
|
MatchingStrategy |
getMatchingStrategy()
Deprecated.
Returns the
MatchingStrategy to use. |
ServiceNameProvider |
getServiceNameProvider()
Deprecated.
Returns the
ServiceNameProvider to use. |
ServiceStore |
getServiceStore()
Deprecated.
Returns the
ServiceStore to use. |
TradingRelationshipCreator |
getTradingRelationshipCreator()
Deprecated.
Returns the
TradingRelationshipCreator to use. |
java.lang.Boolean |
getTreatNotFoundAsError()
Deprecated.
|
protected void |
initService()
Deprecated.
|
void |
prepare()
Deprecated.
Prepare for initialisation.
|
void |
registerEventHandler(EventHandler eh)
Deprecated.
Register the current event handler against this component.
|
void |
setMatchingStrategy(MatchingStrategy m)
Deprecated.
Sets the
MatchingStrategy to use. |
void |
setServiceNameProvider(ServiceNameProvider s)
Deprecated.
Sets the
ServiceNameProvider to use. |
void |
setServiceStore(ServiceStore s)
Deprecated.
Sets the
ServiceStore to use. |
void |
setTradingRelationshipCreator(TradingRelationshipCreator t)
Deprecated.
Sets the
TradingRelationshipCreator to use. |
void |
setTreatNotFoundAsError(java.lang.Boolean b)
Deprecated.
Specify whether a failure to find a dynamic service is treated as an
exception.
|
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId, start, stop
public DynamicServiceLocator()
The following are the defaults
ExactMatchingStrategy
.public void doService(AdaptrisMessage msg) throws ServiceException
Creates the TradingRelationship
(which may not contain wildcards),
applies the configured MatchingStrategy
to obtain a list of other
TradingRelationship
to look for in the event of no exact match,
obtains the logical name to look for from the ServiceNameProvider
,
retrieves the Service
stored against this name in the
ServiceStore
, and then applies the service against the message.
doService
in interface Service
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
s(com.adaptris.core.AdaptrisMessage)
public void prepare() throws CoreException
ComponentLifecycleExtension
prepare
in interface ComponentLifecycleExtension
CoreException
protected void initService() throws CoreException
initService
in class ServiceImp
CoreException
protected void closeService()
closeService
in class ServiceImp
public ServiceStore getServiceStore()
Returns the ServiceStore
to use.
ServiceStore
to usepublic void setServiceStore(ServiceStore s)
Sets the ServiceStore
to use. May not be null.
s
- the ServiceStore
to usepublic TradingRelationshipCreator getTradingRelationshipCreator()
Returns the TradingRelationshipCreator
to use.
TradingRelationshipCreator
to usepublic void setTradingRelationshipCreator(TradingRelationshipCreator t)
Sets the TradingRelationshipCreator
to use. May not be null.
t
- the TradingRelationshipCreator
to usepublic ServiceNameProvider getServiceNameProvider()
Returns the ServiceNameProvider
to use.
ServiceNameProvider
to usepublic void setServiceNameProvider(ServiceNameProvider s)
Sets the ServiceNameProvider
to use. May not be null.
s
- the ServiceNameProvider
to usepublic MatchingStrategy getMatchingStrategy()
Returns the MatchingStrategy
to use.
MatchingStrategy
to usepublic void setMatchingStrategy(MatchingStrategy m)
Sets the MatchingStrategy
to use. May not be null.
m
- the MatchingStrategy
to usepublic java.lang.Boolean getTreatNotFoundAsError()
public void setTreatNotFoundAsError(java.lang.Boolean b)
b
- if true then a ServiceException is thrown if the
ServiceStore.obtain(String)
returns nullServiceStore.obtain(String)
public void registerEventHandler(EventHandler eh)
EventHandlerAware
registerEventHandler
in interface EventHandlerAware
eh
- the event handler currently in use.EventHandlerAware.registerEventHandler(com.adaptris.core.EventHandler)