use of org.glassfish.api.invocation.ComponentInvocation in project Payara by payara.
the class PoolManagerImpl method postInvoke.
private void postInvoke(ComponentInvocation curInv) {
ComponentInvocation invToUse = curInv;
/*
if(invToUse == null){
invToUse = getConnectorRuntime().getInvocationManager().getCurrentInvocation();
}
*/
if (invToUse == null) {
return;
}
Object comp = invToUse.getInstance();
if (comp == null) {
return;
}
handleLazilyAssociatedConnectionPools(comp, invToUse);
}
use of org.glassfish.api.invocation.ComponentInvocation in project Payara by payara.
the class JavaEETransactionManagerSimplified method begin.
/**
* This method is introduced as part of implementing the local transaction timeout
* capability. Implementation of begin() moved here. Previpusly there is no timeout
* infrastructure for local txns, so when ever a timeout required for local txn, it
* uses the globaltxn timeout infrastructure by doing an XA simulation.
*/
public void begin(int timeout) throws NotSupportedException, SystemException {
// Check if tx already exists
if (transactions.get() != null)
throw new NotSupportedException(sm.getString("enterprise_distributedtx.notsupported_nested_transaction"));
setDelegate();
// This is needed in case the JTS tx was imported from a client.
if (getStatus() != Status.STATUS_NO_TRANSACTION)
throw new NotSupportedException(sm.getString("enterprise_distributedtx.notsupported_nested_transaction"));
// START IASRI 4662745
if (monitoringEnabled) {
// XXX acquireReadLock();
getDelegate().getReadLock().lock();
try {
JavaEETransactionImpl tx = initJavaEETransaction(timeout);
activeTransactions.add(tx);
monitor.transactionActivatedEvent();
ComponentInvocation inv = invMgr.getCurrentInvocation();
if (inv != null && inv.getInstance() != null) {
tx.setComponentName(inv.getInstance().getClass().getName());
}
} finally {
// XXX releaseReadLock();
getDelegate().getReadLock().unlock();
}
} else {
initJavaEETransaction(timeout);
}
// START IASRI 4662745
}
use of org.glassfish.api.invocation.ComponentInvocation in project Payara by payara.
the class JavaEETransactionManagerSimplified method registerComponentResource.
public void registerComponentResource(TransactionalResource h) {
ComponentInvocation inv = invMgr.getCurrentInvocation();
if (inv != null) {
Object instance = inv.getInstance();
if (instance == null)
return;
h.setComponentInstance(instance);
List l = getResourceList(instance, inv);
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE, "\n\nIn JavaEETransactionManagerSimplified.registerComponentResource, h=" + h + " h.xares=" + h.getXAResource());
}
l.add(h);
}
}
use of org.glassfish.api.invocation.ComponentInvocation in project Payara by payara.
the class JavaEETransactionManagerSimplified method enlistComponentResources.
public void enlistComponentResources() throws RemoteException {
if (_logger.isLoggable(Level.FINE))
_logger.log(Level.FINE, "TM: enlistComponentResources");
ComponentInvocation inv = invMgr.getCurrentInvocation();
if (inv == null)
return;
try {
Transaction tran = getTransaction();
inv.setTransaction((JavaEETransaction) tran);
enlistComponentResources(inv);
} catch (InvocationException ex) {
_logger.log(Level.SEVERE, "enterprise_distributedtx.excep_in_enlist", ex);
throw new RemoteException(ex.getMessage(), ex.getNestedException());
} catch (Exception ex) {
_logger.log(Level.SEVERE, "enterprise_distributedtx.excep_in_enlist", ex);
throw new RemoteException(ex.getMessage(), ex);
}
}
use of org.glassfish.api.invocation.ComponentInvocation in project Payara by payara.
the class UserTransactionImpl method rollback.
public void rollback() throws IllegalStateException, SecurityException, SystemException {
if (!initialized)
init();
if (userTx != null) {
userTx.rollback();
return;
}
ComponentInvocation inv = invocationManager.getCurrentInvocation();
if (inv != null) {
checkUserTransactionMethodAccess(inv);
}
try {
// TMSUCCESS
transactionManager.delistComponentResources(false);
transactionManager.rollback();
} catch (RemoteException ex) {
_logger.log(Level.SEVERE, "enterprise_distributedtx.excep_in_utx_rollback", ex);
throw new SystemException();
} finally {
if (inv != null)
inv.setTransaction(null);
}
}
Aggregations