code
stringlengths 25
201k
| docstring
stringlengths 19
96.2k
| func_name
stringlengths 0
235
| language
stringclasses 1
value | repo
stringlengths 8
51
| path
stringlengths 11
314
| url
stringlengths 62
377
| license
stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public void setUniqueId(byte[] uniqueId) {
this.uniqueId = uniqueId;
}
|
@param uniqueId The uniqueId to send.
|
setUniqueId
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
MIT
|
@Override
public void setOptions(int options) {
this.options = options;
}
|
Sets the message options.
@param options the message options
|
setOptions
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
MIT
|
@Override
public Member getAddress() {
return address;
}
|
Returns the source or reply-to address
@return Member
|
getAddress
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
MIT
|
@Override
public void setAddress(Member address) {
this.address = address;
}
|
Sets the source or reply-to address
@param address Member
|
setAddress
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
MIT
|
@Override
public boolean equals(Object o) {
if ( o instanceof ChannelData) {
return Arrays.equals(getUniqueId(),((ChannelData)o).getUniqueId());
} else return false;
}
|
Compares to ChannelData objects, only compares on getUniqueId().equals(o.getUniqueId())
@param o Object
@return boolean
|
equals
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
MIT
|
@Override
public ChannelData clone() {
ChannelData clone;
try {
clone = (ChannelData) super.clone();
} catch (CloneNotSupportedException e) {
// Cannot happen
throw new AssertionError();
}
if (this.message != null) {
clone.message = new XByteBuffer(this.message.getBytesDirect(),false);
}
return clone;
}
|
Create a shallow clone, only the data gets recreated
@return ClusterData
|
clone
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/ChannelData.java
|
MIT
|
@Override
public String getName() {
return "tcp://"+getHostname()+":"+getPort();
}
|
Return the name of this object
@return a unique name to the cluster
|
getName
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/MemberImpl.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/MemberImpl.java
|
MIT
|
@Override
public int getPort() {
return this.port;
}
|
Return the listen port of this member
@return - tcp listen port
|
getPort
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/MemberImpl.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/MemberImpl.java
|
MIT
|
@Override
public int hashCode() {
return getHost()[0]+getHost()[1]+getHost()[2]+getHost()[3];
}
|
@see Object#hashCode()
@return The hash code
|
hashCode
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/MemberImpl.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/MemberImpl.java
|
MIT
|
@Override
public int getEventType() { return mEvtType; }
|
returns the event type
@return one of the event types EVT_XXXX
|
getEventType
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/SessionMessageImpl.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/SessionMessageImpl.java
|
MIT
|
@Override
public byte[] getSession() { return mSession;}
|
@return the serialized data for the session
|
getSession
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/SessionMessageImpl.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/SessionMessageImpl.java
|
MIT
|
@Override
public String getSessionID(){ return mSessionID; }
|
@return the session ID for the session
|
getSessionID
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/SessionMessageImpl.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/SessionMessageImpl.java
|
MIT
|
public static void nextBytes(byte[] into, int offset, int length, Random r) {
int numRequested = length;
int numGot = 0, rnd = 0;
while (true) {
for (int i = 0; i < BYTES_PER_INT; i++) {
if (numGot == numRequested) return;
rnd = (i == 0 ? r.nextInt() : rnd >> BITS_PER_BYTE);
into[offset+numGot] = (byte) rnd;
numGot++;
}
}
}
|
Same as java.util.Random.nextBytes except this one we dont have to allocate a new byte array
@param into byte[]
@param offset int
@param length int
@param r Random
|
nextBytes
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/UUIDGenerator.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/UUIDGenerator.java
|
MIT
|
public byte[] getBytes() {
byte[] b = new byte[bufSize];
System.arraycopy(buf,0,b,0,bufSize);
return b;
}
|
@return the bytes in the buffer, in its exact length
|
getBytes
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
public boolean doesPackageExist() {
return (countPackages(true)>0);
}
|
Method to check if a package exists in this byte buffer.
@return - true if a complete package (header,options,size,data,footer) exists within the buffer
|
doesPackageExist
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
public static int toInt(byte[] b,int off){
return ( ( b[off+3]) & 0xFF) +
( ( ( b[off+2]) & 0xFF) << 8) +
( ( ( b[off+1]) & 0xFF) << 16) +
( ( ( b[off+0]) & 0xFF) << 24);
}
|
Convert four bytes to an int
@param b - the byte array containing the four bytes
@param off - the offset
@return the integer value constructed from the four bytes
|
toInt
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
public static long toLong(byte[] b,int off){
return ( ( (long) b[off+7]) & 0xFF) +
( ( ( (long) b[off+6]) & 0xFF) << 8) +
( ( ( (long) b[off+5]) & 0xFF) << 16) +
( ( ( (long) b[off+4]) & 0xFF) << 24) +
( ( ( (long) b[off+3]) & 0xFF) << 32) +
( ( ( (long) b[off+2]) & 0xFF) << 40) +
( ( ( (long) b[off+1]) & 0xFF) << 48) +
( ( ( (long) b[off+0]) & 0xFF) << 56);
}
|
Convert eight bytes to a long
@param b - the byte array containing the four bytes
@param off - the offset
@return the long value constructed from the eight bytes
|
toLong
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
public static byte[] toBytes(boolean bool, byte[] data, int offset) {
data[offset] = (byte)(bool?1:0);
return data;
}
|
Converts a boolean and put it in a byte array.
@param bool the integer
@param data the byte buffer in which the boolean will be placed
@param offset the offset in the byte array
@return the byte array
|
toBytes
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
public static boolean toBoolean(byte[] b, int offset) {
return b[offset] != 0;
}
|
Converts a byte array entry to boolean.
@param b byte array
@param offset within byte array
@return true if byte array entry is non-zero, false otherwise
|
toBoolean
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
public static byte[] toBytes(int n, byte[] b, int offset) {
b[offset+3] = (byte) (n);
n >>>= 8;
b[offset+2] = (byte) (n);
n >>>= 8;
b[offset+1] = (byte) (n);
n >>>= 8;
b[offset+0] = (byte) (n);
return b;
}
|
Converts an integer to four bytes.
@param n the integer
@param b the byte buffer in which the integer will be placed
@param offset the offset in the byte array
@return four bytes in an array
|
toBytes
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
public static byte[] toBytes(long n, byte[] b, int offset) {
b[offset+7] = (byte) (n);
n >>>= 8;
b[offset+6] = (byte) (n);
n >>>= 8;
b[offset+5] = (byte) (n);
n >>>= 8;
b[offset+4] = (byte) (n);
n >>>= 8;
b[offset+3] = (byte) (n);
n >>>= 8;
b[offset+2] = (byte) (n);
n >>>= 8;
b[offset+1] = (byte) (n);
n >>>= 8;
b[offset+0] = (byte) (n);
return b;
}
|
Converts a long to eight bytes.
@param n the long
@param b the byte buffer in which the integer will be placed
@param offset the offset in the byte array
@return eight bytes in an array
|
toBytes
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
public static int firstIndexOf(byte[] src, int srcOff, byte[] find){
int result = -1;
if (find.length > src.length) return result;
if (find.length == 0 || src.length == 0) return result;
if (srcOff >= src.length ) throw new ArrayIndexOutOfBoundsException();
boolean found = false;
int srclen = src.length;
int findlen = find.length;
byte first = find[0];
int pos = srcOff;
while (!found) {
//find the first byte
while (pos < srclen){
if (first == src[pos])
break;
pos++;
}
if (pos >= srclen)
return -1;
//we found the first character
//match the rest of the bytes - they have to match
if ( (srclen - pos) < findlen)
return -1;
//assume it does exist
found = true;
for (int i = 1; ( (i < findlen) && found); i++) {
found = (find[i] == src[pos + i]);
}
if (found) {
result = pos;
} else if ( (srclen - pos) < findlen) {
return -1; //no more matches possible
} else {
pos++;
}
}
return result;
}
|
Similar to a String.IndexOf, but uses pure bytes.
@param src - the source bytes to be searched
@param srcOff - offset on the source buffer
@param find - the string to be found within src
@return - the index of the first matching byte. -1 if the find array is not found
|
firstIndexOf
|
java
|
threedr3am/learnjavabug
|
tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
https://github.com/threedr3am/learnjavabug/blob/master/tomcat/sync-session-bug/src/main/java/com/threedr3am/bug/tomcat/sync/session/support/XByteBuffer.java
|
MIT
|
private void rollbackPrepareFailure(RollbackException rbEx) throws BitronixSystemException {
List<XAResourceHolderState> interestedResources = resourceManager.getAllResources();
try {
rollbacker.rollback(this, interestedResources);
if (log.isDebugEnabled()) { log.debug("rollback after prepare failure succeeded"); }
} catch (Exception ex) {
// let's merge both exceptions' PhaseException to report a complete error message
PhaseException preparePhaseEx = (PhaseException) rbEx.getCause();
PhaseException rollbackPhaseEx = (PhaseException) ex.getCause();
List<Exception> exceptions = new ArrayList<Exception>();
List<XAResourceHolderState> resources = new ArrayList<XAResourceHolderState>();
exceptions.addAll(preparePhaseEx.getExceptions());
exceptions.addAll(rollbackPhaseEx.getExceptions());
resources.addAll(preparePhaseEx.getResourceStates());
resources.addAll(rollbackPhaseEx.getResourceStates());
throw new BitronixSystemException("transaction partially prepared and only partially rolled back. Some resources might be left in doubt!", new PhaseException(exceptions, resources));
}
}
|
Rollback resources after a phase 1 prepare failure. All resources must be rolled back as prepared ones
are in-doubt and non-prepared ones have started/ended work done that must also be cleaned.
@param rbEx the thrown rollback exception.
@throws BitronixSystemException when a resource could not rollback prepapared state.
|
rollbackPrepareFailure
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransaction.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransaction.java
|
Apache-2.0
|
StackTrace getActivationStackTrace() {
return activationStackTrace;
}
|
Returns the activation {@link StackTrace} if it is available.
@return the call stack of where the transaction began
|
getActivationStackTrace
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransaction.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransaction.java
|
Apache-2.0
|
@Override
public Reference getReference() throws NamingException {
return new Reference(
BitronixTransactionManager.class.getName(),
new StringRefAddr("TransactionManager", "BitronixTransactionManager"),
BitronixTransactionManagerObjectFactory.class.getName(),
null
);
}
|
BitronixTransactionManager can only have a single instance per JVM so this method always returns a reference
with no special information to find back the sole instance. BitronixTransactionManagerObjectFactory will be used
by the JNDI server to get the BitronixTransactionManager instance of the JVM.
@return an empty reference to get the BitronixTransactionManager.
|
getReference
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
Apache-2.0
|
public int getInFlightTransactionCount() {
return inFlightTransactions.size();
}
|
Return a count of the current in-flight transactions. Currently this method is only called by unit tests.
@return a count of in-flight transactions
|
getInFlightTransactionCount
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
Apache-2.0
|
public long getOldestInFlightTransactionTimestamp() {
try {
// The inFlightTransactions map is sorted by timestamp, so the first transaction is always the oldest
BitronixTransaction oldestTransaction = inFlightTransactions.firstKey();
long oldestTimestamp = oldestTransaction.getResourceManager().getGtrid().extractTimestamp();
if (log.isDebugEnabled()) { log.debug("oldest in-flight transaction's timestamp: " + oldestTimestamp); }
return oldestTimestamp;
} catch (NoSuchElementException e) {
if (log.isDebugEnabled()) { log.debug("oldest in-flight transaction's timestamp: " + Long.MIN_VALUE); }
return Long.MIN_VALUE;
}
}
|
Return the timestamp of the oldest in-flight transaction.
@return the timestamp or Long.MIN_VALUE if there is no in-flight transaction.
|
getOldestInFlightTransactionTimestamp
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
Apache-2.0
|
public BitronixTransaction getCurrentTransaction() {
return ThreadContext.getThreadContext().getTransaction();
}
|
Get the transaction currently registered on the current thread context.
@return the current transaction or null if no transaction has been started on the current thread.
|
getCurrentTransaction
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
Apache-2.0
|
private boolean isShuttingDown() {
return shuttingDown;
}
|
Check if the transaction manager is in the process of shutting down.
@return true if the transaction manager is in the process of shutting down.
|
isShuttingDown
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
Apache-2.0
|
public void dumpTransactionContexts() {
if (!log.isDebugEnabled())
return;
// We're using an iterator, so we must synchronize on the collection
synchronized (inFlightTransactions) {
log.debug("dumping " + inFlightTransactions.size() + " transaction context(s)");
for (BitronixTransaction tx : inFlightTransactions.keySet()) {
log.debug(tx.toString());
}
}
}
|
Dump an overview of all running transactions as debug logs.
|
dumpTransactionContexts
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
Apache-2.0
|
private void logVersion() {
log.info("Bitronix Transaction Manager version " + Version.getVersion());
if (log.isDebugEnabled()) { log.debug("JVM version " + System.getProperty("java.version")); }
}
|
Output BTM version information as INFO log.
|
logVersion
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
Apache-2.0
|
private BitronixTransaction createTransaction() {
BitronixTransaction transaction = new BitronixTransaction();
ThreadContext.getThreadContext().setTransaction(transaction);
MDC.put(MDC_GTRID_KEY, transaction.getGtrid());
return transaction;
}
|
Create a new transaction on the current thread's context.
@return the created transaction.
|
createTransaction
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManager.java
|
Apache-2.0
|
@Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception {
if (log.isDebugEnabled()) { log.debug("returning the unique transaction manager instance"); }
return TransactionManagerServices.getTransactionManager();
}
|
Since there can be only one transaction manager per VM instance, this method always returns a reference
to the unique BitronixTransactionManager object.
@throws java.lang.Exception thrown if an instance of the transaction manager cannot be created
@see BitronixTransactionManager
@return the unique transaction manager instance.
|
getObjectInstance
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionManagerObjectFactory.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionManagerObjectFactory.java
|
Apache-2.0
|
@Override
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception {
if (log.isDebugEnabled()) { log.debug("returning the unique synchronization registry instance"); }
return TransactionManagerServices.getTransactionSynchronizationRegistry();
}
|
Since there can be only one synchronization registry per VM instance, this method always returns a reference
to the unique BitronixTransactionSynchronizationRegistry object.
@throws java.lang.Exception throw if an instance cannot be created
@see bitronix.tm.BitronixTransactionSynchronizationRegistry
@return the unique synchronization registry instance.
|
getObjectInstance
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixTransactionSynchronizationRegistryObjectFactory.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixTransactionSynchronizationRegistryObjectFactory.java
|
Apache-2.0
|
@Override
public int getFormatId() {
return FORMAT_ID;
}
|
Get Bitronix XID format ID. Defined by {@link BitronixXid#FORMAT_ID}.
@return the Bitronix XID format ID.
|
getFormatId
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixXid.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixXid.java
|
Apache-2.0
|
@Override
public boolean equals(Object obj) {
if (!(obj instanceof BitronixXid))
return false;
BitronixXid otherXid = (BitronixXid) obj;
return FORMAT_ID == otherXid.getFormatId() &&
globalTransactionId.equals(otherXid.getGlobalTransactionIdUid()) &&
branchQualifier.equals(otherXid.getBranchQualifierUid());
}
|
Compare two XIDs for equality.
@param obj the XID to compare to.
@return true if both XIDs have the same format ID and contain exactly the same GTRID and BQUAL.
|
equals
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/BitronixXid.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/BitronixXid.java
|
Apache-2.0
|
public String getServerId() {
return serverId;
}
|
ASCII ID that must uniquely identify this TM instance. It must not exceed 51 characters or it will be truncated.
<p>Property name:<br><b>bitronix.tm.serverId -</b> <i>(defaults to server's IP address but that's unsafe for
production use)</i></p>
@return the unique ID of this TM instance.
|
getServerId
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setServerId(String serverId) {
checkNotStarted();
this.serverId = serverId;
return this;
}
|
Set the ASCII ID that must uniquely identify this TM instance. It must not exceed 51 characters or it will be
truncated.
@see #getServerId()
@param serverId the unique ID of this TM instance.
@return this.
|
setServerId
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public String getLogPart1Filename() {
return logPart1Filename;
}
|
Get the journal fragment file 1 name.
<p>Property name:<br><b>bitronix.tm.journal.disk.logPart1Filename -</b> <i>(defaults to btm1.tlog)</i></p>
@return the journal fragment file 1 name.
|
getLogPart1Filename
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setLogPart1Filename(String logPart1Filename) {
checkNotStarted();
this.logPart1Filename = logPart1Filename;
return this;
}
|
Set the journal fragment file 1 name.
@see #getLogPart1Filename()
@param logPart1Filename the journal fragment file 1 name.
@return this.
|
setLogPart1Filename
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public String getLogPart2Filename() {
return logPart2Filename;
}
|
Get the journal fragment file 2 name.
<p>Property name:<br><b>bitronix.tm.journal.disk.logPart2Filename -</b> <i>(defaults to btm2.tlog)</i></p>
@return the journal fragment file 2 name.
|
getLogPart2Filename
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setLogPart2Filename(String logPart2Filename) {
checkNotStarted();
this.logPart2Filename = logPart2Filename;
return this;
}
|
Set the journal fragment file 2 name.
@see #getLogPart2Filename()
@param logPart2Filename the journal fragment file 2 name.
@return this.
|
setLogPart2Filename
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isForcedWriteEnabled() {
return forcedWriteEnabled;
}
|
Are logs forced to disk? Do not set to false in production since without disk force, integrity is not
guaranteed.
<p>Property name:<br><b>bitronix.tm.journal.disk.forcedWriteEnabled -</b> <i>(defaults to true)</i></p>
@return true if logs are forced to disk, false otherwise.
|
isForcedWriteEnabled
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setForcedWriteEnabled(boolean forcedWriteEnabled) {
checkNotStarted();
this.forcedWriteEnabled = forcedWriteEnabled;
return this;
}
|
Set if logs are forced to disk. Do not set to false in production since without disk force, integrity is not
guaranteed.
@see #isForcedWriteEnabled()
@param forcedWriteEnabled true if logs should be forced to disk, false otherwise.
@return this.
|
setForcedWriteEnabled
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isForceBatchingEnabled() {
return forceBatchingEnabled;
}
|
Are disk forces batched? Disabling batching can seriously lower the transaction manager's throughput.
<p>Property name:<br><b>bitronix.tm.journal.disk.forceBatchingEnabled -</b> <i>(defaults to true)</i></p>
@return true if disk forces are batched, false otherwise.
|
isForceBatchingEnabled
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setForceBatchingEnabled(boolean forceBatchingEnabled) {
checkNotStarted();
log.warn("forceBatchingEnabled is not longer used");
this.forceBatchingEnabled = forceBatchingEnabled;
return this;
}
|
Set if disk forces are batched. Disabling batching can seriously lower the transaction manager's throughput.
@see #isForceBatchingEnabled()
@param forceBatchingEnabled true if disk forces are batched, false otherwise.
@return this.
|
setForceBatchingEnabled
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public int getMaxLogSizeInMb() {
return maxLogSizeInMb;
}
|
Maximum size in megabytes of the journal fragments. Larger logs allow transactions to stay longer in-doubt but
the TM pauses longer when a fragment is full.
<p>Property name:<br><b>bitronix.tm.journal.disk.maxLogSize -</b> <i>(defaults to 2)</i></p>
@return the maximum size in megabytes of the journal fragments.
|
getMaxLogSizeInMb
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setMaxLogSizeInMb(int maxLogSizeInMb) {
checkNotStarted();
this.maxLogSizeInMb = maxLogSizeInMb;
return this;
}
|
Set the Maximum size in megabytes of the journal fragments. Larger logs allow transactions to stay longer
in-doubt but the TM pauses longer when a fragment is full.
@see #getMaxLogSizeInMb()
@param maxLogSizeInMb the maximum size in megabytes of the journal fragments.
@return this.
|
setMaxLogSizeInMb
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isFilterLogStatus() {
return filterLogStatus;
}
|
Should only mandatory logs be written? Enabling this parameter lowers space usage of the fragments but makes
debugging more complex.
<p>Property name:<br><b>bitronix.tm.journal.disk.filterLogStatus -</b> <i>(defaults to false)</i></p>
@return true if only mandatory logs should be written.
|
isFilterLogStatus
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setFilterLogStatus(boolean filterLogStatus) {
checkNotStarted();
this.filterLogStatus = filterLogStatus;
return this;
}
|
Set if only mandatory logs should be written. Enabling this parameter lowers space usage of the fragments but
makes debugging more complex.
@see #isFilterLogStatus()
@param filterLogStatus true if only mandatory logs should be written.
@return this.
|
setFilterLogStatus
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isSkipCorruptedLogs() {
return skipCorruptedLogs;
}
|
Should corrupted logs be skipped?
<p>Property name:<br><b>bitronix.tm.journal.disk.skipCorruptedLogs -</b> <i>(defaults to false)</i></p>
@return true if corrupted logs should be skipped.
|
isSkipCorruptedLogs
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setSkipCorruptedLogs(boolean skipCorruptedLogs) {
checkNotStarted();
this.skipCorruptedLogs = skipCorruptedLogs;
return this;
}
|
Set if corrupted logs should be skipped.
@see #isSkipCorruptedLogs()
@param skipCorruptedLogs true if corrupted logs should be skipped.
@return this.
|
setSkipCorruptedLogs
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isWarnAboutZeroResourceTransaction() {
return warnAboutZeroResourceTransaction;
}
|
Should transactions executed without a single enlisted resource result in a warning or not? Most of the time
transactions executed with no enlisted resource reflect a bug or a mis-configuration somewhere.
<p>Property name:<br><b>bitronix.tm.2pc.warnAboutZeroResourceTransactions -</b> <i>(defaults to true)</i></p>
@return true if transactions executed without a single enlisted resource should result in a warning.
|
isWarnAboutZeroResourceTransaction
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setWarnAboutZeroResourceTransaction(boolean warnAboutZeroResourceTransaction) {
checkNotStarted();
this.warnAboutZeroResourceTransaction = warnAboutZeroResourceTransaction;
return this;
}
|
Set if transactions executed without a single enlisted resource should result in a warning or not. Most of the
time transactions executed with no enlisted resource reflect a bug or a mis-configuration somewhere.
@see #isWarnAboutZeroResourceTransaction()
@param warnAboutZeroResourceTransaction true if transactions executed without a single enlisted resource should
result in a warning.
@return this.
|
setWarnAboutZeroResourceTransaction
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public int getDefaultTransactionTimeout() {
return defaultTransactionTimeout;
}
|
Default transaction timeout in seconds.
<p>Property name:<br><b>bitronix.tm.timer.defaultTransactionTimeout -</b> <i>(defaults to 60)</i></p>
@return the default transaction timeout in seconds.
|
getDefaultTransactionTimeout
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setDefaultTransactionTimeout(int defaultTransactionTimeout) {
checkNotStarted();
this.defaultTransactionTimeout = defaultTransactionTimeout;
return this;
}
|
Set the default transaction timeout in seconds.
@see #getDefaultTransactionTimeout()
@param defaultTransactionTimeout the default transaction timeout in seconds.
@return this.
|
setDefaultTransactionTimeout
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public int getGracefulShutdownInterval() {
return gracefulShutdownInterval;
}
|
Maximum amount of seconds the TM will wait for transactions to get done before aborting them at shutdown time.
<p>Property name:<br><b>bitronix.tm.timer.gracefulShutdownInterval -</b> <i>(defaults to 60)</i></p>
@return the maximum amount of time in seconds.
|
getGracefulShutdownInterval
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setGracefulShutdownInterval(int gracefulShutdownInterval) {
checkNotStarted();
this.gracefulShutdownInterval = gracefulShutdownInterval;
return this;
}
|
Set the maximum amount of seconds the TM will wait for transactions to get done before aborting them at shutdown
time.
@see #getGracefulShutdownInterval()
@param gracefulShutdownInterval the maximum amount of time in seconds.
@return this.
|
setGracefulShutdownInterval
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
@Deprecated
public int getBackgroundRecoveryInterval() {
return getBackgroundRecoveryIntervalSeconds() / 60;
}
|
Interval in minutes at which to run the recovery process in the background. Disabled when set to 0.
<p>Property name:<br><b>bitronix.tm.timer.backgroundRecoveryInterval -</b> <i>(defaults to 0)</i></p>
@return the interval in minutes.
@deprecated superceded by #getBackgroundRecoveryIntervalSeconds().
|
getBackgroundRecoveryInterval
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
@Deprecated
public Configuration setBackgroundRecoveryInterval(int backgroundRecoveryInterval) {
log.warn("setBackgroundRecoveryInterval() is deprecated, consider using setBackgroundRecoveryIntervalSeconds() instead.");
setBackgroundRecoveryIntervalSeconds(backgroundRecoveryInterval * 60);
return this;
}
|
Set the interval in minutes at which to run the recovery process in the background. Disabled when set to 0.
@see #getBackgroundRecoveryInterval()
@param backgroundRecoveryInterval the interval in minutes.
@deprecated superceded by #setBackgroundRecoveryIntervalSeconds(int).
@return this.
|
setBackgroundRecoveryInterval
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public int getBackgroundRecoveryIntervalSeconds() {
return backgroundRecoveryIntervalSeconds;
}
|
Interval in seconds at which to run the recovery process in the background. Disabled when set to 0.
<p>Property name:<br><b>bitronix.tm.timer.backgroundRecoveryIntervalSeconds -</b> <i>(defaults to 60)</i></p>
@return the interval in seconds.
|
getBackgroundRecoveryIntervalSeconds
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setBackgroundRecoveryIntervalSeconds(int backgroundRecoveryIntervalSeconds) {
checkNotStarted();
this.backgroundRecoveryIntervalSeconds = backgroundRecoveryIntervalSeconds;
return this;
}
|
Set the interval in seconds at which to run the recovery process in the background. Disabled when set to 0.
@see #getBackgroundRecoveryIntervalSeconds()
@param backgroundRecoveryIntervalSeconds the interval in minutes.
@return this.
|
setBackgroundRecoveryIntervalSeconds
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isDisableJmx() {
return disableJmx;
}
|
Should JMX Mbeans not be registered even if a JMX MBean server is detected?
<p>Property name:<br><b>bitronix.tm.disableJmx -</b> <i>(defaults to false)</i></p>
@return true if JMX MBeans should never be registered.
|
isDisableJmx
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setDisableJmx(boolean disableJmx) {
checkNotStarted();
this.disableJmx = disableJmx;
return this;
}
|
Set to true if JMX Mbeans should not be registered even if a JMX MBean server is detected.
@see #isDisableJmx()
@param disableJmx true if JMX MBeans should never be registered.
@return this.
|
setDisableJmx
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isSynchronousJmxRegistration() {
return synchronousJmxRegistration;
}
|
Should JMX registrations and un-registrations be done in a synchronous / blocking way.
<p>
By default all JMX registrations are done asynchronously. Registrations and un-registrations
are combined to avoid the registration of short lived instances and increase the overall throughput.
@return true if the caller should be blocked when MBeans are registered (defaults to false).
|
isSynchronousJmxRegistration
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setSynchronousJmxRegistration(boolean synchronousJmxRegistration) {
checkNotStarted();
this.synchronousJmxRegistration = synchronousJmxRegistration;
return this;
}
|
Toggles synchronous and asynchronous JMX registration mode.
@param synchronousJmxRegistration true if the caller should be blocked when MBeans are registered
(defaults to false).
@return this.
|
setSynchronousJmxRegistration
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public String getJndiUserTransactionName() {
return jndiUserTransactionName;
}
|
Get the name the {@link javax.transaction.UserTransaction} should be bound under in the
{@link bitronix.tm.jndi.BitronixContext}.
@return the name the {@link javax.transaction.UserTransaction} should
be bound under in the {@link bitronix.tm.jndi.BitronixContext}.
|
getJndiUserTransactionName
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setJndiUserTransactionName(String jndiUserTransactionName) {
checkNotStarted();
this.jndiUserTransactionName = jndiUserTransactionName;
return this;
}
|
Set the name the {@link javax.transaction.UserTransaction} should be bound under in the
{@link bitronix.tm.jndi.BitronixContext}.
@see #getJndiUserTransactionName()
@param jndiUserTransactionName the name the {@link javax.transaction.UserTransaction} should
be bound under in the {@link bitronix.tm.jndi.BitronixContext}.
@return this.
|
setJndiUserTransactionName
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public String getJndiTransactionSynchronizationRegistryName() {
return jndiTransactionSynchronizationRegistryName;
}
|
Get the name the {@link javax.transaction.TransactionSynchronizationRegistry} should be bound under in the
{@link bitronix.tm.jndi.BitronixContext}.
@return the name the {@link javax.transaction.TransactionSynchronizationRegistry} should
be bound under in the {@link bitronix.tm.jndi.BitronixContext}.
|
getJndiTransactionSynchronizationRegistryName
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setJndiTransactionSynchronizationRegistryName(String jndiTransactionSynchronizationRegistryName) {
checkNotStarted();
this.jndiTransactionSynchronizationRegistryName = jndiTransactionSynchronizationRegistryName;
return this;
}
|
Set the name the {@link javax.transaction.TransactionSynchronizationRegistry} should be bound under in the
{@link bitronix.tm.jndi.BitronixContext}.
@see #getJndiUserTransactionName()
@param jndiTransactionSynchronizationRegistryName the name the {@link javax.transaction.TransactionSynchronizationRegistry} should
be bound under in the {@link bitronix.tm.jndi.BitronixContext}.
@return this.
|
setJndiTransactionSynchronizationRegistryName
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public String getJournal() {
return journal;
}
|
Get the journal implementation. Can be <code>disk</code>, <code>null</code> or a class name.
@return the journal name.
|
getJournal
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setJournal(String journal) {
checkNotStarted();
this.journal = journal;
return this;
}
|
Set the journal name. Can be <code>disk</code>, <code>null</code> or a class name.
@see #getJournal()
@param journal the journal name.
@return this.
|
setJournal
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public String getExceptionAnalyzer() {
return exceptionAnalyzer;
}
|
Get the exception analyzer implementation. Can be <code>null</code> for the default one or a class name.
@return the exception analyzer name.
|
getExceptionAnalyzer
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setExceptionAnalyzer(String exceptionAnalyzer) {
checkNotStarted();
this.exceptionAnalyzer = exceptionAnalyzer;
return this;
}
|
Set the exception analyzer implementation. Can be <code>null</code> for the default one or a class name.
@see #getExceptionAnalyzer()
@param exceptionAnalyzer the exception analyzer name.
@return this.
|
setExceptionAnalyzer
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isCurrentNodeOnlyRecovery() {
return currentNodeOnlyRecovery;
}
|
Should the recovery process <b>not</b> recover XIDs generated with another JVM unique ID? Setting this property to true
is useful in clustered environments where multiple instances of BTM are running on different nodes.
@see #getServerId() contains the value used as the JVM unique ID.
@return true if recovery should filter out recovered XIDs that do not contain this JVM's unique ID, false otherwise.
|
isCurrentNodeOnlyRecovery
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setCurrentNodeOnlyRecovery(boolean currentNodeOnlyRecovery) {
checkNotStarted();
this.currentNodeOnlyRecovery = currentNodeOnlyRecovery;
return this;
}
|
Set to true if recovery should filter out recovered XIDs that do not contain this JVM's unique ID, false otherwise.
@see #isCurrentNodeOnlyRecovery()
@param currentNodeOnlyRecovery true if recovery should filter out recovered XIDs that do not contain this JVM's unique ID, false otherwise.
@return this.
|
setCurrentNodeOnlyRecovery
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isAllowMultipleLrc() {
return allowMultipleLrc;
}
|
Should the transaction manager allow enlistment of multiple LRC resources in a single transaction?
This is highly unsafe but could be useful for testing.
@return true if the transaction manager should allow enlistment of multiple LRC resources in a single transaction, false otherwise.
|
isAllowMultipleLrc
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setAllowMultipleLrc(boolean allowMultipleLrc) {
checkNotStarted();
this.allowMultipleLrc = allowMultipleLrc;
return this;
}
|
Set to true if the transaction manager should allow enlistment of multiple LRC resources in a single transaction.
@param allowMultipleLrc true if the transaction manager should allow enlistment of multiple LRC resources in a single transaction, false otherwise.
@return this
|
setAllowMultipleLrc
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public boolean isConservativeJournaling() {
return conservativeJournaling;
}
|
Should the Disk Journal follow a conservative (sequential write) policy?
@return true if the Disk Journal should serialize writes to the transaction log, false otherwise.
|
isConservativeJournaling
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setConservativeJournaling(boolean conservativeJournaling) {
checkNotStarted();
this.conservativeJournaling = conservativeJournaling;
return this;
}
|
Set to true if the Disk Journal should follow a conservative (sequential write) policy.
@param conservativeJournaling true if the Disk Journal should follow a conservative (sequential write) policy
@return this
|
setConservativeJournaling
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public String getJdbcProxyFactoryClass() {
return jdbcProxyFactoryClass;
}
|
Get the factory class for creating JDBC proxy instances.
@return the name of the factory class
|
getJdbcProxyFactoryClass
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public void setJdbcProxyFactoryClass(String jdbcProxyFactoryClass) {
this.jdbcProxyFactoryClass = jdbcProxyFactoryClass;
}
|
Set the name of the factory class for creating JDBC proxy instances.
@param jdbcProxyFactoryClass the name of the proxy class
|
setJdbcProxyFactoryClass
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public String getResourceConfigurationFilename() {
return resourceConfigurationFilename;
}
|
{@link bitronix.tm.resource.ResourceLoader} configuration file name. {@link bitronix.tm.resource.ResourceLoader}
will be disabled if this value is null.
<p>Property name:<br><b>bitronix.tm.resource.configuration -</b> <i>(defaults to null)</i></p>
@return the filename of the resources configuration file or null if not configured.
|
getResourceConfigurationFilename
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public Configuration setResourceConfigurationFilename(String resourceConfigurationFilename) {
checkNotStarted();
this.resourceConfigurationFilename = resourceConfigurationFilename;
return this;
}
|
Set the {@link bitronix.tm.resource.ResourceLoader} configuration file name.
@see #getResourceConfigurationFilename()
@param resourceConfigurationFilename the filename of the resources configuration file or null you do not want to
use the {@link bitronix.tm.resource.ResourceLoader}.
@return this.
|
setResourceConfigurationFilename
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/Configuration.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/Configuration.java
|
Apache-2.0
|
public static BitronixTransactionManager getTransactionManager() {
transactionManagerLock.lock();
try {
if (transactionManager == null) {
transactionManager = new BitronixTransactionManager();
}
return transactionManager;
} finally {
transactionManagerLock.unlock();
}
}
|
Create an initialized transaction manager.
@return the transaction manager.
|
getTransactionManager
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static BitronixTransactionSynchronizationRegistry getTransactionSynchronizationRegistry() {
BitronixTransactionSynchronizationRegistry transactionSynchronizationRegistry = transactionSynchronizationRegistryRef.get();
if (transactionSynchronizationRegistry == null) {
transactionSynchronizationRegistry = new BitronixTransactionSynchronizationRegistry();
if (!transactionSynchronizationRegistryRef.compareAndSet(null, transactionSynchronizationRegistry)) {
transactionSynchronizationRegistry = transactionSynchronizationRegistryRef.get();
}
}
return transactionSynchronizationRegistry;
}
|
Create the JTA 1.1 TransactionSynchronizationRegistry.
@return the TransactionSynchronizationRegistry.
|
getTransactionSynchronizationRegistry
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static Configuration getConfiguration() {
Configuration configuration = configurationRef.get();
if (configuration == null) {
configuration = new Configuration();
if (!configurationRef.compareAndSet(null, configuration)) {
configuration = configurationRef.get();
}
}
return configuration;
}
|
Create the configuration of all the components of the transaction manager.
@return the global configuration.
|
getConfiguration
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static Journal getJournal() {
Journal journal = journalRef.get();
if (journal == null) {
String configuredJournal = getConfiguration().getJournal();
if ("null".equals(configuredJournal) || null == configuredJournal) {
journal = new NullJournal();
} else if ("disk".equals(configuredJournal)) {
journal = new DiskJournal();
} else {
try {
Class<?> clazz = ClassLoaderUtils.loadClass(configuredJournal);
journal = (Journal) clazz.newInstance();
} catch (Exception ex) {
throw new InitializationException("invalid journal implementation '" + configuredJournal + "'", ex);
}
}
if (log.isDebugEnabled()) { log.debug("using journal " + configuredJournal); }
if (!journalRef.compareAndSet(null, journal)) {
journal = journalRef.get();
}
}
return journal;
}
|
Create the transactions journal.
@return the transactions journal.
|
getJournal
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static TaskScheduler getTaskScheduler() {
TaskScheduler taskScheduler = taskSchedulerRef.get();
if (taskScheduler == null) {
taskScheduler = new TaskScheduler();
if (!taskSchedulerRef.compareAndSet(null, taskScheduler)) {
taskScheduler = taskSchedulerRef.get();
} else {
taskScheduler.start();
}
}
return taskScheduler;
}
|
Create the task scheduler.
@return the task scheduler.
|
getTaskScheduler
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static ResourceLoader getResourceLoader() {
ResourceLoader resourceLoader = resourceLoaderRef.get();
if (resourceLoader == null) {
resourceLoader = new ResourceLoader();
if (!resourceLoaderRef.compareAndSet(null, resourceLoader)) {
resourceLoader = resourceLoaderRef.get();
}
}
return resourceLoader;
}
|
Create the resource loader.
@return the resource loader.
|
getResourceLoader
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static Recoverer getRecoverer() {
Recoverer recoverer = recovererRef.get();
if (recoverer == null) {
recoverer = new Recoverer();
if (!recovererRef.compareAndSet(null, recoverer)) {
recoverer = recovererRef.get();
}
}
return recoverer;
}
|
Create the transaction recoverer.
@return the transaction recoverer.
|
getRecoverer
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static Executor getExecutor() {
Executor executor = executorRef.get();
if (executor == null) {
if (getConfiguration().isAsynchronous2Pc()) {
if (log.isDebugEnabled()) { log.debug("using AsyncExecutor"); }
executor = new AsyncExecutor();
} else {
if (log.isDebugEnabled()) { log.debug("using SyncExecutor"); }
executor = new SyncExecutor();
}
if (!executorRef.compareAndSet(null, executor)) {
executor.shutdown();
executor = executorRef.get();
}
}
return executor;
}
|
Create the 2PC executor.
@return the 2PC executor.
|
getExecutor
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static ExceptionAnalyzer getExceptionAnalyzer() {
ExceptionAnalyzer analyzer = exceptionAnalyzerRef.get();
if (analyzer == null) {
String exceptionAnalyzerName = getConfiguration().getExceptionAnalyzer();
analyzer = new DefaultExceptionAnalyzer();
if (exceptionAnalyzerName != null) {
try {
analyzer = (ExceptionAnalyzer) ClassLoaderUtils.loadClass(exceptionAnalyzerName).newInstance();
} catch (Exception ex) {
log.warn("failed to initialize custom exception analyzer, using default one instead", ex);
}
}
if (!exceptionAnalyzerRef.compareAndSet(null, analyzer)) {
analyzer.shutdown();
analyzer = exceptionAnalyzerRef.get();
}
}
return analyzer;
}
|
Create the exception analyzer.
@return the exception analyzer.
|
getExceptionAnalyzer
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static boolean isTransactionManagerRunning() {
return transactionManager != null;
}
|
Check if the transaction manager has started.
@return true if the transaction manager has started.
|
isTransactionManagerRunning
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public static boolean isTaskSchedulerRunning() {
return taskSchedulerRef.get() != null;
}
|
Check if the task scheduler has started.
@return true if the task scheduler has started.
|
isTaskSchedulerRunning
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
protected static synchronized void clear() {
transactionManager = null;
transactionSynchronizationRegistryRef.set(null);
configurationRef.set(null);
journalRef.set(null);
taskSchedulerRef.set(null);
resourceLoaderRef.set(null);
recovererRef.set(null);
executorRef.set(null);
exceptionAnalyzerRef.set(null);
}
|
Clear services references. Called at the end of the shutdown procedure.
|
clear
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/TransactionManagerServices.java
|
Apache-2.0
|
public List<? extends Exception> getExceptions() {
return exceptions;
}
|
Get the list of exceptions that have been thrown during execution.
@return the list of exceptions that have been thrown during execution.
|
getExceptions
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/internal/BitronixMultiSystemException.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/BitronixMultiSystemException.java
|
Apache-2.0
|
public List<XAResourceHolderState> getResourceStates() {
return resourceStates;
}
|
Get the list of XAResourceHolderStates which threw an exception during execution.
This list always contains exactly one resource per exception present in {@link #getExceptions} list.
Indices of both list always match a resource against the exception it threw.
@return the list of resource which threw an exception during execution.
|
getResourceStates
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/internal/BitronixMultiSystemException.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/BitronixMultiSystemException.java
|
Apache-2.0
|
public static boolean isUnilateralRollback(XAException ex) {
return (ex.errorCode >= XAException.XA_RBBASE && ex.errorCode <= XAException.XA_RBEND) || ex.errorCode == XAException.XAER_NOTA;
}
|
Subclass of {@link javax.transaction.xa.XAException} supporting nested {@link Throwable}s.
@author Ludovic Orban
|
isUnilateralRollback
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/internal/BitronixXAException.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/BitronixXAException.java
|
Apache-2.0
|
@Override
protected ThreadContext initialValue() {
return new ThreadContext();
}
|
Transactional context of a thread. It contains both the active transaction (if any) and all default parameters
that a transaction running on a thread must inherit.
@author Ludovic Orban
|
initialValue
|
java
|
scalar-labs/btm
|
btm/src/main/java/bitronix/tm/internal/ThreadContext.java
|
https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/ThreadContext.java
|
Apache-2.0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.