Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DATABASE_NAME |
Constructor and Description |
---|
RMTxStore() |
Modifier and Type | Method and Description |
---|---|
protected void |
abort() |
protected void |
abort(Connection con) |
protected void |
beginTransaction() |
protected void |
cacheStatement(Connection con,
String sql) |
protected void |
cacheStatements() |
protected void |
commit()
This method assumes that the connection is held and reused.
|
protected void |
commit(Connection con) |
protected Connection |
createConnection() |
void |
createDestinationSequence(DestinationSequence seq)
Create a destination sequence in the persistent store, with the sequence attributes as specified in the
RMSDestinationSequence object. |
void |
createSourceSequence(SourceSequence seq)
Create a source sequence in the persistent store, with the sequence attributes as specified in the
RMSourceSequence object. |
protected void |
createTables() |
protected static ProtocolVariation |
decodeProtocolVersion(String pv) |
static void |
deleteDatabaseFiles() |
static void |
deleteDatabaseFiles(String dbName,
boolean now) |
void |
destroy() |
protected static String |
encodeProtocolVersion(ProtocolVariation pv) |
DataSource |
getDataSource() |
DestinationSequence |
getDestinationSequence(Identifier sid)
Retrieve the destination sequence with the specified identifier from persistent store.
|
Collection<DestinationSequence> |
getDestinationSequences(String endpointIdentifier)
Retrieves all sequences managed by the identified RM destination endpoint
from persistent store.
|
String |
getDriverClassName() |
long |
getInitialReconnectDelay() |
int |
getMaxReconnectAttempts() |
Collection<RMMessage> |
getMessages(Identifier sid,
boolean outbound)
Retrieves the outbound/inbound messages stored for the source/destination sequence with
the given identifier.
|
String |
getPassword() |
String |
getSchemaName() |
SourceSequence |
getSourceSequence(Identifier sid)
Retrieve the source sequence with the specified identifier from persistent store.
|
Collection<SourceSequence> |
getSourceSequences(String endpointIdentifier)
Retrieves all sequences managed by the identified RM source endpoint
from persistent store.
|
protected PreparedStatement |
getStatement(Connection con,
String sql)
Returns either the locally cached statement or the one from the specified connection
depending on whether the connection is held by this store.
|
int |
getTableExistsCode() |
String |
getTableExistsState() |
String |
getUrl() |
String |
getUserName() |
void |
init() |
boolean |
isKeepConnection() |
protected boolean |
isRecoverableError(SQLException ex) |
protected boolean |
isTableExistsError(SQLException ex) |
void |
persistIncoming(DestinationSequence seq,
RMMessage msg)
Called by an RM source upon processing an outbound message.
|
void |
persistOutgoing(SourceSequence seq,
RMMessage msg)
Called by an RM source upon processing an outbound message.
|
protected void |
releaseResources(PreparedStatement stmt,
ResultSet rs)
Releases the statement and any result set.
|
void |
removeDestinationSequence(Identifier sid)
Remove the destination sequence with the specified identifier from persistent store.
|
void |
removeMessages(Identifier sid,
Collection<Long> messageNrs,
boolean outbound)
Removes the messages with the given message numbers and identifiers from the store of
outbound/inbound messages.
|
void |
removeSourceSequence(Identifier sid)
Remove the source sequence with the specified identifier from persistent store.
|
void |
setConnection(Connection c) |
protected void |
setCurrentSchema()
Sets the current schema associated with the connection.
|
void |
setDataSource(DataSource ds) |
void |
setDriverClassName(String dcn) |
void |
setInitialReconnectDelay(long initialReconnectDelay) |
void |
setKeepConnection(boolean keepConnection) |
void |
setMaxReconnectAttempts(int maxReconnectAttempts) |
void |
setPassword(String p) |
void |
setSchemaName(String sn) |
void |
setTableExistsCode(int tableExistsCode) |
void |
setTableExistsState(String tableExistsState) |
void |
setUrl(String u) |
void |
setUserName(String un) |
protected void |
storeMessage(Connection con,
Identifier sid,
RMMessage msg,
boolean outbound) |
protected void |
storeMessage(Identifier sid,
RMMessage msg,
boolean outbound)
this method is only useful when keepConnection is set to true
|
protected void |
updateConnectionState(Connection con,
SQLException e) |
protected void |
updateDestinationSequence(Connection con,
DestinationSequence seq) |
protected void |
updateDestinationSequence(DestinationSequence seq) |
protected void |
updateSourceSequence(Connection con,
SourceSequence seq) |
protected void |
updateSourceSequence(SourceSequence seq) |
protected Connection |
verifyConnection() |
protected void |
verifyTable(Connection con,
String tableName,
String[][] tableCols) |
protected void |
verifyTable(String tableName,
String[][] tableCols) |
public static final String DEFAULT_DATABASE_NAME
public void destroy()
public void setDriverClassName(String dcn)
public String getDriverClassName()
public void setPassword(String p)
public String getPassword()
public void setUrl(String u)
public String getUrl()
public void setUserName(String un)
public String getUserName()
public String getSchemaName()
public void setSchemaName(String sn)
public DataSource getDataSource()
public void setDataSource(DataSource ds)
public String getTableExistsState()
public void setTableExistsState(String tableExistsState)
public int getTableExistsCode()
public void setTableExistsCode(int tableExistsCode)
public boolean isKeepConnection()
public void setKeepConnection(boolean keepConnection)
public long getInitialReconnectDelay()
public void setInitialReconnectDelay(long initialReconnectDelay)
public int getMaxReconnectAttempts()
public void setMaxReconnectAttempts(int maxReconnectAttempts)
public void setConnection(Connection c)
public void createDestinationSequence(DestinationSequence seq)
RMStore
RMSDestinationSequence
object.createDestinationSequence
in interface RMStore
seq
- the sequencepublic void createSourceSequence(SourceSequence seq)
RMStore
RMSourceSequence
object.createSourceSequence
in interface RMStore
seq
- the sequencepublic DestinationSequence getDestinationSequence(Identifier sid)
RMStore
getDestinationSequence
in interface RMStore
sid
- the sequencepublic SourceSequence getSourceSequence(Identifier sid)
RMStore
getSourceSequence
in interface RMStore
sid
- the sequencepublic void removeDestinationSequence(Identifier sid)
RMStore
removeDestinationSequence
in interface RMStore
sid
- the sequencepublic void removeSourceSequence(Identifier sid)
RMStore
removeSourceSequence
in interface RMStore
sid
- the sequencepublic Collection<DestinationSequence> getDestinationSequences(String endpointIdentifier)
RMStore
getDestinationSequences
in interface RMStore
endpointIdentifier
- the identifier for the destinationpublic Collection<SourceSequence> getSourceSequences(String endpointIdentifier)
RMStore
getSourceSequences
in interface RMStore
endpointIdentifier
- the identifier for the sourcepublic Collection<RMMessage> getMessages(Identifier sid, boolean outbound)
RMStore
getMessages
in interface RMStore
sid
- the source sequence identifieroutbound
- true if the message is outboundpublic void persistIncoming(DestinationSequence seq, RMMessage msg)
RMStore
RMMessage
parameter is null for non application (RM protocol) messages.persistIncoming
in interface RMStore
seq
- the destination sequencemsg
- the incoming messagepublic void persistOutgoing(SourceSequence seq, RMMessage msg)
RMStore
RMMessage
parameter is null for non application (RM protocol) messages.persistOutgoing
in interface RMStore
seq
- the source sequencemsg
- the outgoing messagepublic void removeMessages(Identifier sid, Collection<Long> messageNrs, boolean outbound)
RMStore
removeMessages
in interface RMStore
sid
- the identifier of the source sequencemessageNrs
- the collection of message numbersoutbound
- true if the message is outboundprotected void beginTransaction()
protected void commit(Connection con) throws SQLException
SQLException
protected void commit() throws SQLException
SQLException
protected void abort(Connection con)
protected void abort()
protected void storeMessage(Connection con, Identifier sid, RMMessage msg, boolean outbound) throws IOException, SQLException
IOException
SQLException
protected void storeMessage(Identifier sid, RMMessage msg, boolean outbound) throws IOException, SQLException
IOException
SQLException
protected void updateSourceSequence(Connection con, SourceSequence seq) throws SQLException
SQLException
protected void updateSourceSequence(SourceSequence seq) throws SQLException
SQLException
protected void updateDestinationSequence(Connection con, DestinationSequence seq) throws SQLException, IOException
SQLException
IOException
protected void updateDestinationSequence(DestinationSequence seq) throws SQLException, IOException
IOException
SQLException
protected void createTables() throws SQLException
SQLException
protected void verifyTable(Connection con, String tableName, String[][] tableCols)
protected void setCurrentSchema() throws SQLException
SQLException
protected PreparedStatement getStatement(Connection con, String sql) throws SQLException
con
- sql
- SQLException
protected void releaseResources(PreparedStatement stmt, ResultSet rs)
stmt
- rs
- protected void cacheStatement(Connection con, String sql) throws SQLException
SQLException
protected void cacheStatements() throws SQLException
SQLException
public void init()
protected Connection createConnection()
protected Connection verifyConnection()
protected void updateConnectionState(Connection con, SQLException e)
public static void deleteDatabaseFiles()
public static void deleteDatabaseFiles(String dbName, boolean now)
protected static String encodeProtocolVersion(ProtocolVariation pv)
protected static ProtocolVariation decodeProtocolVersion(String pv)
protected boolean isTableExistsError(SQLException ex)
protected boolean isRecoverableError(SQLException ex)
Apache CXF