Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-1738 Some minor refactoring #1668

Merged
merged 1 commit into from
Jun 16, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2016] [Payara Foundation and/or its affiliates]
// Portions Copyright [2016,2017] [Payara Foundation and/or its affiliates]
package com.sun.ejb.containers;

import com.sun.ejb.*;
Expand Down Expand Up @@ -101,6 +101,9 @@
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.transaction.*;

import static com.sun.enterprise.deployment.MethodDescriptor.EJB_WEB_SERVICE;

import java.io.Serializable;
import java.lang.reflect.*;
import java.rmi.AccessException;
Expand All @@ -121,9 +124,8 @@
*
*/

public abstract class BaseContainer
implements Container, EjbContainerFacade, JavaEEContainer
{
public abstract class BaseContainer implements Container, EjbContainerFacade, JavaEEContainer {

public enum ContainerType {
STATELESS, STATEFUL, SINGLETON, MESSAGE_DRIVEN, ENTITY, READ_ONLY
};
Expand Down Expand Up @@ -2760,38 +2762,30 @@ public void assertValidRemoteObject(Object o) throws EJBException
/**
*
*/
protected final int getTxAttr(Method method, String methodIntf)
throws EJBException
{
protected final int getTxAttr(Method method, String methodIntf) throws EJBException {

InvocationInfo invInfo =
methodIntf.equals(MethodDescriptor.EJB_WEB_SERVICE) ?
(InvocationInfo) webServiceInvocationInfoMap.get(method) :
(InvocationInfo) invocationInfoMap.get(method);
InvocationInfo invInfo = methodIntf.equals(EJB_WEB_SERVICE) ?
(InvocationInfo) webServiceInvocationInfoMap.get(method)
: (InvocationInfo) invocationInfoMap.get(method);

if( invInfo != null ) {
if (invInfo != null) {
return invInfo.txAttr;
} else {
throw new EJBException("Transaction Attribute not found for method"
+ method);
throw new EJBException("Transaction Attribute not found for method" + method);
}
}

// Get the transaction attribute for a method.
// Note: this method object is of the remote/EJBHome interface
// class, not the EJB class. (except for MDB's message listener
// class, not the EJB class. (except for MDB's message listener
// callback method or TimedObject ejbTimeout method)
protected final int getTxAttr(EjbInvocation inv)
throws EJBException
{
if ( inv.transactionAttribute != TX_NOT_INITIALIZED ) {
protected final int getTxAttr(EjbInvocation inv) throws EJBException {
if (inv.transactionAttribute != TX_NOT_INITIALIZED) {
return inv.transactionAttribute;
}

int txAttr = getTxAttr(inv.method, inv.getMethodInterface());
inv.transactionAttribute = txAttr;
inv.transactionAttribute = getTxAttr(inv.method, inv.getMethodInterface());
return inv.transactionAttribute;

}


Expand Down
Loading