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:
AdapterAware
,HasPhysicalDestination
,IBlockEnabledSender<H>
,IConfigurable
,IConfigurationAware
,INamedObject
,IScopeProvider
,ISender
,ISenderWithParameters
,IWithParameters
,IXAEnabled
,HasStatistics
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
AbstractJdbcQuerySender
public abstract class AbstractJdbcSender<H>
extends JdbcFacade
implements IBlockEnabledSender<H>, HasStatistics, AdapterAware
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()
is called once at startup of the framework in the configure method of the owner of this sender.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
setAdapter
(Adapter adapter) 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, 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.IBlockEnabledSender
closeBlock, openBlock, sendMessage
Methods inherited from interface org.frankframework.core.IConfigurationAware
getApplicationContext, getName
Methods inherited from interface org.frankframework.core.INamedObject
getName, setName
Methods inherited from interface org.frankframework.core.IScopeProvider
getConfigurationClassLoader
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:ISender
configure()
is called once at startup of the framework in the configure method of the owner of this sender. Purpose of this method is to check whether the static configuration of the sender is correct. As much as possible class-instantiating should take place in theconfigure()
oropen()
method, to improve performance.- Specified by:
configure
in interfaceIConfigurable
- Specified by:
configure
in interfaceISender
- Overrides:
configure
in classJdbcFacade
- Throws:
ConfigurationException
-
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. -
stop
public void stop()Description copied from interface:ISender
Stop/close the sender and deallocate resources. -
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
-
getAdapter
- Specified by:
getAdapter
in interfaceHasStatistics
-
setAdapter
- Specified by:
setAdapter
in interfaceAdapterAware
-
getTimeout
public int getTimeout()
-