Package org.frankframework.jdbc
Class AbstractJdbcSender<H>
java.lang.Object
org.frankframework.jndi.JndiBase
org.frankframework.jdbc.JdbcFacade
org.frankframework.jdbc.AbstractJdbcSender<H>
- All Implemented Interfaces:
FrankElement
,HasApplicationContext
,HasName
,HasPhysicalDestination
,IBlockEnabledSender<H>
,IConfigurable
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,IXAEnabled
,NameAware
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.context.Lifecycle
- Direct Known Subclasses:
AbstractJdbcQuerySender
Base class for building JDBC-senders.
- Since:
- 4.2.h
- Author:
- Gerrit van Brakel
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Configure this component.Obtains a connection to the datasource.int
final SenderResult
sendMessage
(Message message, PipeLineSession session) Send a message to some destination (as configured in the Sender object).void
setConfigurationMetrics
(MetricsInitializer configurationMetrics) void
setTimeout
(int i) The number of seconds the JDBC driver will wait for a statement object to execute.void
start()
This method will be called to start the sender.void
stop()
Stop/close the sender and deallocate resources.toString()
Methods inherited from class org.frankframework.jdbc.JdbcFacade
getAuthAlias, getConnectionWithTimeout, getDatasource, getDataSourceFactory, getDatasourceInfo, getDatasourceName, getDbmsSupport, getDomain, getLogPrefix, getPassword, getPhysicalDestinationName, getUsername, isConnectionsArePooled, isRunning, isTransacted, setAuthAlias, setConnectionsArePooled, setDataSourceFactory, setDatasourceName, setDbmsSupportFactory, setJmsRealm, setPassword, setTransacted, setUsername
Methods inherited from class org.frankframework.jndi.JndiBase
getApplicationContext, getAuthentication, getConfigurationClassLoader, getContext, getCredentials, getInitialContextFactoryName, getJmsRealmName, getJndiAuthAlias, getJndiContextPrefix, getJndiEnv, getJndiProperties, getName, getPrincipal, getProviderURL, getSecurityProtocol, getUrlPkgPrefixes, setApplicationContext, setAuthentication, setCredentials, setInitialContextFactoryName, setJndiAuthAlias, setJndiContextPrefix, setJndiProperties, setName, setPrincipal, setProviderURL, setSecurityProtocol, setUrlPkgPrefixes
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContext
Methods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
Methods inherited from interface org.frankframework.core.IBlockEnabledSender
closeBlock, openBlock, sendMessage
Methods inherited from interface org.frankframework.core.ISender
isSynchronous, sendMessageOrThrow
Methods inherited from interface org.frankframework.core.ISenderWithParameters
consumesSessionVariable
-
Field Details
-
connection
-
paramList
-
-
Constructor Details
-
AbstractJdbcSender
public AbstractJdbcSender()
-
-
Method Details
-
addParameter
- Specified by:
addParameter
in interfaceIWithParameters
-
getParameterList
- Specified by:
getParameterList
in interfaceIWithParameters
-
configure
Description copied from interface:IConfigurable
Configure this component.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classJdbcFacade
- Throws:
ConfigurationException
- in case it was not able to configure the component.
-
start
public void start()Description copied from interface:ISender
This method will be called to start the sender. After this method is called the sendMessage method may be called. Purpose of this method is to reduce creating connections to databases etc. in thesendMessage()
method.- Specified by:
start
in interfaceISender
- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
- Overrides:
start
in classJdbcFacade
-
stop
public void stop()Description copied from interface:ISender
Stop/close the sender and deallocate resources.- Specified by:
stop
in interfaceISender
- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
- Overrides:
stop
in classJdbcFacade
-
getConnection
Description copied from class:JdbcFacade
Obtains a connection to the datasource.- Overrides:
getConnection
in classJdbcFacade
- Throws:
JdbcException
-
sendMessage
@Nonnull public final SenderResult sendMessage(@Nonnull Message message, @Nonnull PipeLineSession session) throws SenderException, TimeoutException Description copied from interface:ISender
Send a message to some destination (as configured in the Sender object). This method may only be called after theconfigure()
method is called.The following table shows the difference between synchronous and a-synchronous senders:
synchronous a-synchronous ISender.isSynchronous()
returnstrue
false
return value of sendMessage()
isthe reply-message the messageId of the message sent the correlationID specified with sendMessage()
may be ignored is sent with the message a {link TimeOutException} may be thrown if a timeout occurs waiting for a reply should not be expected Multiple objects may try to call this method at the same time, from different threads. Implementations of this method should therefore be thread-safe, or
synchronized
.- Specified by:
sendMessage
in interfaceISender
- Throws:
SenderException
TimeoutException
-
toString
-
setTimeout
public void setTimeout(int i) The number of seconds the JDBC driver will wait for a statement object to execute. If the limit is exceeded, a TimeoutException is thrown. A value of 0 means execution time is not limited- Default value
- 0
-
setConfigurationMetrics
-
getTimeout
public int getTimeout()
-