📄 jdbcmessagerequester.java
字号:
/* * $Id: JdbcMessageRequester.java 12935 2008-10-07 11:55:16Z dfeist $ * -------------------------------------------------------------------------------------- * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com * * The software in this package is published under the terms of the CPAL v1.0 * license, a copy of which has been included with this distribution in the * LICENSE.txt file. */package org.mule.transport.jdbc;import org.mule.api.MuleEvent;import org.mule.api.MuleMessage;import org.mule.api.endpoint.InboundEndpoint;import org.mule.transport.AbstractMessageRequester;import org.mule.transport.jdbc.sqlstrategy.SQLStrategy;public class JdbcMessageRequester extends AbstractMessageRequester{ private JdbcConnector connector; public JdbcMessageRequester(InboundEndpoint endpoint) { super(endpoint); this.connector = (JdbcConnector) endpoint.getConnector(); } /* * (non-Javadoc) * * @see org.mule.transport.AbstractMessageDispatcher#doDispose() */ protected void doDispose() { // template method } /** * Make a specific request to the underlying transport * * @param timeout the maximum time the operation should block before returning. * The call should return immediately if there is data available. If * no data becomes available before the timeout elapses, null will be * returned * @return the result of the request wrapped in a MuleMessage object. Null will be * returned if no data was available * @throws Exception if the call to the underlying protocol causes an exception */ protected MuleMessage doRequest(long timeout) throws Exception { return doRequest(timeout, null); } /** * Make a specific request to the underlying transport * Special case: The event is need when doReceive was called from doSend * @param timeout only for compatibility with doRequest(long timeout) * @param event There is a need to get params from message * @return the result of the request wrapped in a MuleMessage object. Null will be * returned if no data was available * @throws Exception if the call to the underlying protocol causes an exception */ protected MuleMessage doRequest(long timeout, MuleEvent event) throws Exception { SQLStrategy strategy = connector.getSqlStrategyFactory().create("select", null); return strategy.executeStatement(connector, endpoint, event, timeout); } protected void doConnect() throws Exception { // template method } protected void doDisconnect() throws Exception { // template method }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -