code stringlengths 23 201k | docstring stringlengths 17 96.2k | func_name stringlengths 0 235 | language stringclasses 1
value | repo stringlengths 8 72 | path stringlengths 11 317 | url stringlengths 57 377 | license stringclasses 7
values |
|---|---|---|---|---|---|---|---|
public void start(int flags) throws XAException {
boolean suspended = this.suspended;
boolean started = this.started;
if (this.ended && (flags == XAResource.TMRESUME)) {
if (log.isDebugEnabled()) { log.debug("resource already ended, changing state to resumed: " + this); }
... | {@link XAResourceHolder} state container.
Instances are kept in the transaction and bound to / unbound from the {@link XAResourceHolder} as the
resource participates in different transactions. A {@link XAResourceHolder} without {@link XAResourceHolderState}
is considered to be in local transaction mode.
<p>Objects of t... | start | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | Apache-2.0 |
@Override
public int hashCode() {
return hashCode;
} | {@link XAResourceHolder} state container.
Instances are kept in the transaction and bound to / unbound from the {@link XAResourceHolder} as the
resource participates in different transactions. A {@link XAResourceHolder} without {@link XAResourceHolderState}
is considered to be in local transaction mode.
<p>Objects of t... | hashCode | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | Apache-2.0 |
@Override
public boolean equals(Object obj) {
if (!(obj instanceof XAResourceHolderState) || this.hashCode != obj.hashCode())
return false;
XAResourceHolderState other = (XAResourceHolderState) obj;
return equals(other.bean, bean) && equals(other.xid, xid);
} | {@link XAResourceHolder} state container.
Instances are kept in the transaction and bound to / unbound from the {@link XAResourceHolder} as the
resource participates in different transactions. A {@link XAResourceHolder} without {@link XAResourceHolderState}
is considered to be in local transaction mode.
<p>Objects of t... | equals | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | Apache-2.0 |
private boolean equals(Object obj1, Object obj2) {
if (obj1 == obj2)
return true;
if (obj1 == null || obj2 == null)
return false;
return obj1.equals(obj2);
} | {@link XAResourceHolder} state container.
Instances are kept in the transaction and bound to / unbound from the {@link XAResourceHolder} as the
resource participates in different transactions. A {@link XAResourceHolder} without {@link XAResourceHolderState}
is considered to be in local transaction mode.
<p>Objects of t... | equals | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | Apache-2.0 |
@Override
public String toString() {
return "an XAResourceHolderState with uniqueName=" + bean.getUniqueName() +
" XAResource=" + getXAResource() +
(started ? " (started)":"") +
(ended ? " (ended)":"") +
(suspended ? " (suspended)":"") +
... | {@link XAResourceHolder} state container.
Instances are kept in the transaction and bound to / unbound from the {@link XAResourceHolder} as the
resource participates in different transactions. A {@link XAResourceHolder} without {@link XAResourceHolderState}
is considered to be in local transaction mode.
<p>Objects of t... | toString | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceHolderState.java | Apache-2.0 |
public void enlist(XAResourceHolderState xaResourceHolderState) throws XAException, BitronixSystemException {
XAResourceHolderState alreadyEnlistedHolder = findXAResourceHolderState(xaResourceHolderState.getXAResource());
if (alreadyEnlistedHolder != null && !alreadyEnlistedHolder.isEnded()) {
... | Enlist the specified {@link XAResourceHolderState}. A XID is generated and the resource is started with
XAResource.TMNOFLAGS or XAResource.TMJOIN if it could be joined with another previously enlisted one.
<br>
There are 3 different cases that can happen when a {@link XAResourceHolderState} is enlisted:
<ul>
<li>alread... | enlist | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public boolean delist(XAResourceHolderState xaResourceHolderState, int flag) throws XAException, BitronixSystemException {
if (findXAResourceHolderState(xaResourceHolderState.getXAResource()) != null) {
if (log.isDebugEnabled()) { log.debug("delisting resource " + xaResourceHolderState); }
... | Delist the specified {@link XAResourceHolderState}. A reference to the resource is kept anyway.
@param xaResourceHolderState the {@link XAResourceHolderState} to be delisted.
@param flag the delistment flag.
@return true if the resource could be delisted, false otherwise.
@throws XAException if the resource threw an ex... | delist | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public void suspend() throws XAException {
for (XAResourceHolderState xaResourceHolderState : resources) {
if (!xaResourceHolderState.isEnded()) {
if (log.isDebugEnabled()) { log.debug("suspending " + xaResourceHolderState); }
xaResourceHolderState.end(XAResource.TMSU... | Suspend all enlisted resources from the current transaction context.
@throws XAException if the resource threw an exception during suspend. | suspend | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public void resume() throws XAException {
// all XAResource needs to be re-enlisted but this must happen
// outside the Scheduler's iteration as enlist() can change the
// collection's content and confuse the iterator.
List<XAResourceHolderState> toBeReEnlisted = new ArrayList<XAResource... | Resume all enlisted resources in the current transaction context.
@throws XAException if the resource threw an exception during resume. | resume | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public XAResourceHolderState findXAResourceHolderState(XAResource xaResource) throws BitronixSystemException {
for (XAResourceHolderState xaResourceHolderState : resources) {
if (xaResourceHolderState.getXAResource() == xaResource)
return xaResourceHolderState;
}
ret... | Look if an {@link XAResource} has already been enlisted.
@param xaResource the {@link XAResource} to look for.
@return the {@link XAResourceHolderState} of the enlisted resource or null if the {@link XAResource} has not
been enlisted in this {@link XAResourceManager}.
@throws BitronixSystemException if an inter... | findXAResourceHolderState | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
private XAResourceHolderState getManagedResourceWithSameRM(XAResourceHolderState xaResourceHolderState) throws XAException {
if (!xaResourceHolderState.getUseTmJoin()) {
if (log.isDebugEnabled()) { log.debug("join disabled on resource " + xaResourceHolderState); }
return null;
}
... | Search for an eventually already enlisted {@link XAResourceHolderState} that could be joined with the
{@link XAResourceHolderState} passed as parameter.<br/>
If datasource configuration property <code>bitronix.useTmJoin=false</code> is set this method always returns null.
@param xaResourceHolderState a {@link XAResourc... | getManagedResourceWithSameRM | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public void clearXAResourceHolderStates() {
if (log.isDebugEnabled()) { log.debug("clearing XAResourceHolder states on " + resources.size() + " resource(s)"); }
Iterator<XAResourceHolderState> it = resources.iterator();
while (it.hasNext()) {
XAResourceHolderState xaResourceHolderSta... | Remove this transaction's {@link XAResourceHolderState} from all enlisted
{@link bitronix.tm.resource.common.XAResourceHolder}s. | clearXAResourceHolderStates | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public Set<String> collectUniqueNames() {
Set<String> names = new HashSet<String>(resources.size());
for (XAResourceHolderState xaResourceHolderState : resources) {
names.add(xaResourceHolderState.getUniqueName());
}
return Collections.unmodifiableSet(names);
} | Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s.
@return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. | collectUniqueNames | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public SortedSet<Integer> getNaturalOrderPositions() {
return Collections.unmodifiableSortedSet(resources.getNaturalOrderPositions());
} | Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s.
@return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. | getNaturalOrderPositions | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public SortedSet<Integer> getReverseOrderPositions() {
return Collections.unmodifiableSortedSet(resources.getReverseOrderPositions());
} | Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s.
@return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. | getReverseOrderPositions | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public List<XAResourceHolderState> getNaturalOrderResourcesForPosition(Integer position) {
return Collections.unmodifiableList(resources.getByNaturalOrderForPosition(position));
} | Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s.
@return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. | getNaturalOrderResourcesForPosition | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public List<XAResourceHolderState> getReverseOrderResourcesForPosition(Integer position) {
return Collections.unmodifiableList(resources.getByReverseOrderForPosition(position));
} | Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s.
@return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. | getReverseOrderResourcesForPosition | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public List<XAResourceHolderState> getAllResources() {
List<XAResourceHolderState> result = new ArrayList<XAResourceHolderState>(resources.size());
for (Integer positionKey : resources.getNaturalOrderPositions()) {
result.addAll(resources.getByNaturalOrderForPosition(positionKey));
}... | Get a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s.
@return a {@link Set} of unique names of all the enlisted {@link XAResourceHolderState}s. | getAllResources | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public int size() {
return resources.size();
} | Get the enlisted resources count.
@return the enlisted resources count. | size | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
public Uid getGtrid() {
return gtrid;
} | Get the GTRID of the transaction the {@link XAResourceManager} instance is attached to.
@return the GTRID of the transaction the {@link XAResourceManager} instance is attached to. | getGtrid | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
@Override
public String toString() {
return "a XAResourceManager with GTRID [" + gtrid + "] and " + resources;
} | Return a human-readable representation of this object.
@return a human-readable representation of this object. | toString | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/internal/XAResourceManager.java | Apache-2.0 |
private void checkClosed() throws ServiceUnavailableException {
if (closed)
throw new ServiceUnavailableException("context is closed");
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | checkClosed | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void close() throws NamingException {
closed = true;
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | close | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Object lookup(Name name) throws NamingException {
return lookup(name.toString());
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | lookup | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Object lookup(String s) throws NamingException {
checkClosed();
if (log.isDebugEnabled()) { log.debug("looking up '" + s + "'"); }
Object o;
if (userTransactionName.equals(s))
o = TransactionManagerServices.getTransactionManager();
else if (synch... | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | lookup | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public String toString() {
return "a BitronixContext with userTransactionName='" + userTransactionName + "' and synchronizationRegistryName='" + synchronizationRegistryName + "'";
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | toString | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void bind(Name name, Object o) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | bind | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void bind(String s, Object o) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | bind | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void rebind(Name name, Object o) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | rebind | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void rebind(String s, Object o) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | rebind | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void unbind(Name name) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | unbind | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void unbind(String s) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | unbind | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void rename(Name name, Name name1) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | rename | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void rename(String s, String s1) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | rename | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | list | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public NamingEnumeration<NameClassPair> list(String s) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | list | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | listBindings | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public NamingEnumeration<Binding> listBindings(String s) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | listBindings | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void destroySubcontext(Name name) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | destroySubcontext | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public void destroySubcontext(String s) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | destroySubcontext | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Context createSubcontext(Name name) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | createSubcontext | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Context createSubcontext(String s) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | createSubcontext | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Object lookupLink(Name name) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | lookupLink | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Object lookupLink(String s) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | lookupLink | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public NameParser getNameParser(Name name) throws NamingException {
return BitronixNameParser.INSTANCE;
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | getNameParser | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public NameParser getNameParser(String s) throws NamingException {
return BitronixNameParser.INSTANCE;
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | getNameParser | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Name composeName(Name name, Name name1) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | composeName | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public String composeName(String s, String s1) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | composeName | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Object addToEnvironment(String s, Object o) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | addToEnvironment | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Object removeFromEnvironment(String s) throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | removeFromEnvironment | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Hashtable<?, ?> getEnvironment() throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | getEnvironment | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public String getNameInNamespace() throws NamingException {
throw new OperationNotSupportedException();
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | getNameInNamespace | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Name parse(final String name) throws NamingException {
return new CompositeName(name);
} | Implementation of {@link javax.naming.Context} that allows lookup of transaction manager
and registered resources.
<p>This implementation is trivial as only the <code>lookup</code> methods are implemented,
all the other ones will throw a {@link OperationNotSupportedException}.</p>
@author Ludovic Orban
@see bitronix.t... | parse | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixContext.java | Apache-2.0 |
@Override
public Context getInitialContext(Hashtable<?,?> hashtable) throws NamingException {
return new BitronixContext();
} | Implementation of {@link InitialContextFactory} that allows lookup of transaction manager
and registered resources.
<p>
The easiest way to use this provider is to create a <code>jndi.properties</code> file
in your classpath with this content:
<pre>java.naming.factory.initial=bitronix.tm.jndi.BitronixInitialContextFacto... | getInitialContext | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixInitialContextFactory.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixInitialContextFactory.java | Apache-2.0 |
@Override
public String toString() {
return "a BitronixInitialContextFactory";
} | Implementation of {@link InitialContextFactory} that allows lookup of transaction manager
and registered resources.
<p>
The easiest way to use this provider is to create a <code>jndi.properties</code> file
in your classpath with this content:
<pre>java.naming.factory.initial=bitronix.tm.jndi.BitronixInitialContextFacto... | toString | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/jndi/BitronixInitialContextFactory.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/jndi/BitronixInitialContextFactory.java | Apache-2.0 |
@Override
public void log(int status, Uid gtrid, Set<String> uniqueNames) throws IOException {
if (activeTla.get() == null)
throw new IOException("cannot write log, disk logger is not open");
if (configuration.isFilterLogStatus()) {
if (status != Status.STATUS_COMMITTING && ... | Log a new transaction status to journal. Note that the DiskJournal will not check the flow of the transaction.
If you call this method with erroneous data, it will be added to the journal anyway.
@param status transaction status to log. See {@link javax.transaction.Status} constants.
@param gtrid raw GTRID of the tran... | log | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
@Override
public void force() throws IOException {
if (activeTla.get() == null)
throw new IOException("cannot force log writing, disk logger is not open");
if (needsForce.get() && configuration.isForcedWriteEnabled()) {
swapForceLock.writeLock().lock();
try {
... | Force active log file to synchronize with the underlying disk device.
@throws java.io.IOException in case of disk IO failure or if the disk journal is not open. | force | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
@Override
public synchronized void open() throws IOException {
if (activeTla.get() != null) {
log.warn("disk journal already open");
return;
}
File file1 = new File(configuration.getLogPart1Filename());
File file2 = new File(configuration.getLogPart2Filename(... | Open the disk journal. Files are checked for integrity and DiskJournal will refuse to open corrupted log files.
If files are not present on disk, this method will create and pre-allocate them.
@throws java.io.IOException in case of disk IO failure. | open | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
@Override
public synchronized void close() throws IOException {
if (activeTla.get() == null) {
return;
}
try {
tla1.close();
} catch (IOException ex) {
log.error("cannot close " + tla1, ex);
}
tla1 = null;
try {
... | Close the disk journal and the underlying files.
@throws java.io.IOException in case of disk IO failure. | close | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
@Override
public void shutdown() {
try {
close();
} catch (IOException ex) {
log.error("error shutting down disk journal. Transaction log integrity could be compromised!", ex);
}
} | Close the disk journal and the underlying files.
@throws java.io.IOException in case of disk IO failure. | shutdown | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
@Override
public Map<Uid, JournalRecord> collectDanglingRecords() throws IOException {
if (activeTla.get() == null)
throw new IOException("cannot collect dangling records, disk logger is not open");
return collectDanglingRecords(activeTla.get());
} | Collect all dangling records of the active log file.
@return a Map using Uid objects GTRID as key and {@link TransactionLogRecord} as value
@throws java.io.IOException in case of disk IO failure or if the disk journal is not open. | collectDanglingRecords | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
private static void createLogfile(File logfile, int maxLogSizeInMb) throws IOException {
if (logfile.isDirectory())
throw new IOException("log file is referring to a directory: " + logfile.getAbsolutePath());
if (logfile.exists()) {
boolean deleted = logfile.delete();
... | Create a fresh log file on disk. If the specified file already exists it will be deleted then recreated.
@param logfile the file to create
@param maxLogSizeInMb the file size in megabytes to preallocate
@throws java.io.IOException in case of disk IO failure. | createLogfile | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
private synchronized byte pickActiveJournalFile(TransactionLogAppender tla1, TransactionLogAppender tla2) throws IOException {
if (tla1.getTimestamp() > tla2.getTimestamp()) {
activeTla.set(tla1);
if (log.isDebugEnabled()) { log.debug("logging to file 1: " + activeTla); }
}
... | Initialize the activeTla member variable with the TransactionLogAppender object having the latest timestamp
header.
@param tla1 the first of the two candidate active TransactionLogAppenders
@param tla2 the second of the two candidate active TransactionLogAppenders
@return the state of the designated active Transaction... | pickActiveJournalFile | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
private synchronized TransactionLogAppender getPassiveTransactionLogAppender() {
return (tla1 == activeTla.get() ? tla2 : tla1);
} | @return the TransactionFileAppender of the passive journal file. | getPassiveTransactionLogAppender | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
private static Iterator<TransactionLogRecord> iterateRecords(TransactionLogAppender tla, final boolean skipCrcCheck) throws IOException {
final TransactionLogCursor tlc = tla.getCursor();
final Iterator<TransactionLogRecord> it = new Iterator<TransactionLogRecord>() {
TransactionLogRecord tl... | Implements a low level iterator over all entries contained in the active TX log.
@param tla the TransactionLogAppender to scan
@param skipCrcCheck sets whether CRC checks are applied or not.
@return an iterator over all contained log records.
@throws java.io.IOException in case of the initial disk IO failed (... | iterateRecords | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
public boolean hasNext() {
while (tlog == null) {
try {
try {
tlog = tlc.readLog(skipCrcCheck);
if (tlog == null)
break;
} catch (CorruptedTransacti... | Implements a low level iterator over all entries contained in the active TX log.
@param tla the TransactionLogAppender to scan
@param skipCrcCheck sets whether CRC checks are applied or not.
@return an iterator over all contained log records.
@throws java.io.IOException in case of the initial disk IO failed (... | hasNext | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
public TransactionLogRecord next() {
if (!hasNext())
throw new NoSuchElementException();
try {
return tlog;
} finally {
tlog = null;
}
} | Implements a low level iterator over all entries contained in the active TX log.
@param tla the TransactionLogAppender to scan
@param skipCrcCheck sets whether CRC checks are applied or not.
@return an iterator over all contained log records.
@throws java.io.IOException in case of the initial disk IO failed (... | next | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
public void remove() {
throw new UnsupportedOperationException();
} | Implements a low level iterator over all entries contained in the active TX log.
@param tla the TransactionLogAppender to scan
@param skipCrcCheck sets whether CRC checks are applied or not.
@return an iterator over all contained log records.
@throws java.io.IOException in case of the initial disk IO failed (... | remove | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/DiskJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/DiskJournal.java | Apache-2.0 |
@Override
public void log(int status, Uid gtrid, Set<String> uniqueNames) throws IOException {
} | No-op journal. Do not use for anything else than testing as the transaction manager cannot guarantee
data integrity with this journal implementation.
@author Ludovic Orban | log | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/NullJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/NullJournal.java | Apache-2.0 |
@Override
public void open() throws IOException {
} | No-op journal. Do not use for anything else than testing as the transaction manager cannot guarantee
data integrity with this journal implementation.
@author Ludovic Orban | open | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/NullJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/NullJournal.java | Apache-2.0 |
@Override
public void close() throws IOException {
} | No-op journal. Do not use for anything else than testing as the transaction manager cannot guarantee
data integrity with this journal implementation.
@author Ludovic Orban | close | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/NullJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/NullJournal.java | Apache-2.0 |
@Override
public void force() throws IOException {
} | No-op journal. Do not use for anything else than testing as the transaction manager cannot guarantee
data integrity with this journal implementation.
@author Ludovic Orban | force | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/NullJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/NullJournal.java | Apache-2.0 |
@Override
public Map<Uid, JournalRecord> collectDanglingRecords() throws IOException {
return Collections.emptyMap();
} | No-op journal. Do not use for anything else than testing as the transaction manager cannot guarantee
data integrity with this journal implementation.
@author Ludovic Orban | collectDanglingRecords | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/NullJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/NullJournal.java | Apache-2.0 |
@Override
public void shutdown() {
} | No-op journal. Do not use for anything else than testing as the transaction manager cannot guarantee
data integrity with this journal implementation.
@author Ludovic Orban | shutdown | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/NullJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/NullJournal.java | Apache-2.0 |
@Override
public String toString() {
return "a NullJournal";
} | No-op journal. Do not use for anything else than testing as the transaction manager cannot guarantee
data integrity with this journal implementation.
@author Ludovic Orban | toString | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/NullJournal.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/NullJournal.java | Apache-2.0 |
protected boolean setPositionAndAdvance(TransactionLogRecord tlog) throws IOException {
int tlogSize = tlog.calculateTotalRecordSize();
if (position + tlogSize > maxFileLength) {
return true;
}
long writePosition = position;
position += tlogSize;
tlog.setWritePosition(writePositi... | Get the current file position and advance the position by recordSize if
the maximum file length won't be exceeded. Callers to this method are
synchronized within the DiskJournal and it is guaranteed there will
never be two callers to this method. This creates a Java memory barrier
that guarantees that 'position' will... | setPositionAndAdvance | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
protected void writeLog(TransactionLogRecord tlog) throws IOException {
try {
int status = tlog.getStatus();
Uid gtrid = tlog.getGtrid();
int recordSize = tlog.calculateTotalRecordSize();
ByteBuffer buf = ByteBuffer.allocate(recordSize);
buf.putInt(tlog.... | Write a {@link TransactionLogRecord} to disk.
@param tlog the record to write to disk.
@throws IOException if an I/O error occurs. | writeLog | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
protected List<TransactionLogRecord> getDanglingLogs() {
synchronized (danglingRecords) {
List<Uid> sortedUids = new ArrayList<Uid>(danglingRecords.keySet());
Collections.sort(sortedUids, new Comparator<Uid>() {
@Override
public int compare(Uid uid1, Uid uid2) {
... | Write a {@link TransactionLogRecord} to disk.
@param tlog the record to write to disk.
@throws IOException if an I/O error occurs. | getDanglingLogs | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
@Override
public int compare(Uid uid1, Uid uid2) {
return Integer.valueOf(uid1.extractSequence()).compareTo(uid2.extractSequence());
} | Write a {@link TransactionLogRecord} to disk.
@param tlog the record to write to disk.
@throws IOException if an I/O error occurs. | compare | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
protected void clearDanglingLogs() {
synchronized (danglingRecords) {
danglingRecords.clear();
}
} | Write a {@link TransactionLogRecord} to disk.
@param tlog the record to write to disk.
@throws IOException if an I/O error occurs. | clearDanglingLogs | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
void rewind() throws IOException {
header.rewind();
position = header.getPosition();
} | Return a {@link TransactionLogHeader} that allows reading and controlling the log file's header.
@throws IOException if an I/O error occurs | rewind | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
long getTimestamp() {
return header.getTimestamp();
} | Get the log file header timestamp.
@return the log file header timestamp | getTimestamp | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
public long getPosition() {
return position;
} | Get the current file position.
@return the file position | getPosition | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
protected void close() throws IOException {
header.setState(TransactionLogHeader.CLEAN_LOG_STATE);
fc.force(false);
if (lock != null)
lock.release();
fc.close();
randomeAccessFile.close();
} | Close the appender and the underlying file.
@throws IOException if an I/O error occurs. | close | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
protected TransactionLogCursor getCursor() throws IOException {
return new TransactionLogCursor(file);
} | Creates a cursor on this journal file allowing iteration of its records.
This opens a new read-only file descriptor independent of the write-only one
still used for writing transaction logs.
@return a TransactionLogCursor.
@throws IOException if an I/O error occurs. | getCursor | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
protected void force() throws IOException {
if (log.isDebugEnabled()) { log.debug("forcing log writing"); }
fc.force(false);
if (log.isDebugEnabled()) { log.debug("done forcing log"); }
} | Force flushing the logs to disk
@throws IOException if an I/O error occurs. | force | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
@Override
public String toString() {
return "a TransactionLogAppender on " + file.getName();
} | Force flushing the logs to disk
@throws IOException if an I/O error occurs. | toString | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogAppender.java | Apache-2.0 |
public TransactionLogRecord readLog() throws IOException {
return readLog(false);
} | Fetch the next TransactionLogRecord from log, recalculating the CRC and checking it against the stored one.
InvalidChecksumException is thrown if the check fails.
@return the TransactionLogRecord or null if the end of the log file has been reached
@throws IOException if an I/O error occurs. | readLog | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogCursor.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogCursor.java | Apache-2.0 |
public TransactionLogRecord readLog(boolean skipCrcCheck) throws IOException {
if (currentPosition >= endPosition) {
if (log.isDebugEnabled())
log.debug("end of transaction log file reached at " + currentPosition);
return null;
}
final int status = page.g... | Fetch the next TransactionLogRecord from log.
@param skipCrcCheck if set to false, the method will thow an InvalidChecksumException if the CRC on disk does
not match the recalculated one. Otherwise, the CRC is not recalculated nor checked agains the stored one.
@return the TransactionLogRecord or null if the end... | readLog | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogCursor.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogCursor.java | Apache-2.0 |
public void close() throws IOException {
fis.close();
fileChannel.close();
} | Close the cursor and the underlying file
@throws IOException if an I/O error occurs. | close | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogCursor.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogCursor.java | Apache-2.0 |
public void setFormatId(int formatId) throws IOException {
ByteBuffer buf = ByteBuffer.allocate(8);
buf.putInt(formatId);
buf.flip();
while (buf.hasRemaining()) {
fc.write(buf, FORMAT_ID_HEADER + buf.position());
}
this.formatId = formatId;
} | Set FORMAT_ID_HEADER.
@see #FORMAT_ID_HEADER
@param formatId the FORMAT_ID_HEADER value.
@throws IOException if an I/O error occurs. | setFormatId | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | Apache-2.0 |
public void setTimestamp(long timestamp) throws IOException {
ByteBuffer buf = ByteBuffer.allocate(8);
buf.putLong(timestamp);
buf.flip();
while (buf.hasRemaining()) {
fc.write(buf, TIMESTAMP_HEADER + buf.position());
}
this.timestamp = timestamp;
} | Set TIMESTAMP_HEADER.
@see #TIMESTAMP_HEADER
@param timestamp the TIMESTAMP_HEADER value.
@throws IOException if an I/O error occurs. | setTimestamp | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | Apache-2.0 |
public void setState(byte state) throws IOException {
ByteBuffer buf = ByteBuffer.allocate(1);
buf.put(state);
buf.flip();
while (buf.hasRemaining()) {
fc.write(buf, STATE_HEADER + buf.position());
}
this.state = state;
} | Set STATE_HEADER.
@see #STATE_HEADER
@param state the STATE_HEADER value.
@throws IOException if an I/O error occurs. | setState | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | Apache-2.0 |
public void setPosition(long position) throws IOException {
if (position < HEADER_LENGTH)
throw new IOException("invalid position " + position + " (too low)");
if (position > maxFileLength)
throw new IOException("invalid position " + position + " (too high)");
ByteBuffer... | Set CURRENT_POSITION_HEADER.
@see #CURRENT_POSITION_HEADER
@param position the CURRENT_POSITION_HEADER value.
@throws IOException if an I/O error occurs. | setPosition | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | Apache-2.0 |
@Override
public String toString() {
return "a Bitronix TransactionLogHeader with timestamp=" + timestamp +
", state=" + Decoder.decodeHeaderState(state) +
", position=" + position;
} | Create human-readable String representation.
@return a human-readable String representing this object's state. | toString | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogHeader.java | Apache-2.0 |
@Override
public int getStatus() {
return status;
} | Create a new transaction log ready to be stored.
@param status record type
@param gtrid global transaction id
@param uniqueNames unique names of XA data sources used in this transaction | getStatus | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | Apache-2.0 |
public int getRecordLength() {
return recordLength;
} | Create a new transaction log ready to be stored.
@param status record type
@param gtrid global transaction id
@param uniqueNames unique names of XA data sources used in this transaction | getRecordLength | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | Apache-2.0 |
public int getHeaderLength() {
return headerLength;
} | Create a new transaction log ready to be stored.
@param status record type
@param gtrid global transaction id
@param uniqueNames unique names of XA data sources used in this transaction | getHeaderLength | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | Apache-2.0 |
@Override
public long getTime() {
return time;
} | Create a new transaction log ready to be stored.
@param status record type
@param gtrid global transaction id
@param uniqueNames unique names of XA data sources used in this transaction | getTime | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | Apache-2.0 |
public int getSequenceNumber() {
return sequenceNumber;
} | Create a new transaction log ready to be stored.
@param status record type
@param gtrid global transaction id
@param uniqueNames unique names of XA data sources used in this transaction | getSequenceNumber | java | scalar-labs/btm | btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | https://github.com/scalar-labs/btm/blob/master/btm/src/main/java/bitronix/tm/journal/TransactionLogRecord.java | Apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.