You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2014/02/19 16:48:09 UTC
svn commit: r1569795 [20/35] - in
/tomee/tomee/trunk/container/openejb-core/src/main: config/pmd/
java/javax/xml/ws/ java/javax/xml/ws/wsaddressing/ java/org/apache/openejb/
java/org/apache/openejb/assembler/
java/org/apache/openejb/assembler/classic/ ...
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngine.java Wed Feb 19 15:47:58 2014
@@ -77,27 +77,27 @@ public class JpaCmpEngine implements Cmp
*/
protected Object entityManagerListener;
- public JpaCmpEngine(CmpCallback cmpCallback) {
+ public JpaCmpEngine(final CmpCallback cmpCallback) {
this.cmpCallback = cmpCallback;
}
- public synchronized void deploy(BeanContext beanContext) throws OpenEJBException {
+ public synchronized void deploy(final BeanContext beanContext) throws OpenEJBException {
configureKeyGenerator(beanContext);
}
- public synchronized void undeploy(BeanContext beanContext) throws OpenEJBException {
+ public synchronized void undeploy(final BeanContext beanContext) throws OpenEJBException {
beanContext.setKeyGenerator(null);
}
- private EntityManager getEntityManager(BeanContext beanContext) {
+ private EntityManager getEntityManager(final BeanContext beanContext) {
EntityManager entityManager = null;
try {
entityManager = (EntityManager) beanContext.getJndiEnc().lookup(CMP_PERSISTENCE_CONTEXT_REF_NAME);
- } catch (NamingException ignored) {
+ } catch (final NamingException ignored) {
//TODO see OPENEJB-1259 temporary hack until geronimo jndi integration works better
try {
entityManager = (EntityManager) new InitialContext().lookup("java:" + CMP_PERSISTENCE_CONTEXT_REF_NAME);
- } catch (NamingException ignored2) {
+ } catch (final NamingException ignored2) {
//ignore
}
}
@@ -111,10 +111,10 @@ public class JpaCmpEngine implements Cmp
return entityManager;
}
- private synchronized void registerListener(EntityManager entityManager) {
+ private synchronized void registerListener(final EntityManager entityManager) {
if (entityManager instanceof OpenJPAEntityManagerSPI) {
- OpenJPAEntityManagerSPI openjpaEM = (OpenJPAEntityManagerSPI) entityManager;
- OpenJPAEntityManagerFactorySPI openjpaEMF = (OpenJPAEntityManagerFactorySPI) openjpaEM.getEntityManagerFactory();
+ final OpenJPAEntityManagerSPI openjpaEM = (OpenJPAEntityManagerSPI) entityManager;
+ final OpenJPAEntityManagerFactorySPI openjpaEMF = (OpenJPAEntityManagerFactorySPI) openjpaEM.getEntityManagerFactory();
if (entityManagerListener == null) {
entityManagerListener = new OpenJPALifecycleListener();
@@ -123,27 +123,27 @@ public class JpaCmpEngine implements Cmp
return;
}
- Object delegate = entityManager.getDelegate();
+ final Object delegate = entityManager.getDelegate();
if (delegate != entityManager && delegate instanceof EntityManager) {
registerListener((EntityManager) delegate);
}
}
- public Object createBean(EntityBean bean, ThreadContext callContext) throws CreateException {
+ public Object createBean(EntityBean bean, final ThreadContext callContext) throws CreateException {
// TODO verify that extract primary key requires a flush followed by a merge
- TransactionPolicy txPolicy = startTransaction("persist", callContext);
+ final TransactionPolicy txPolicy = startTransaction("persist", callContext);
creating.get().add(bean);
try {
- BeanContext beanContext = callContext.getBeanContext();
- EntityManager entityManager = getEntityManager(beanContext);
+ final BeanContext beanContext = callContext.getBeanContext();
+ final EntityManager entityManager = getEntityManager(beanContext);
entityManager.persist(bean);
entityManager.flush();
bean = entityManager.merge(bean);
// extract the primary key from the bean
- KeyGenerator kg = beanContext.getKeyGenerator();
- Object primaryKey = kg.getPrimaryKey(bean);
+ final KeyGenerator kg = beanContext.getKeyGenerator();
+ final Object primaryKey = kg.getPrimaryKey(bean);
return primaryKey;
} finally {
@@ -152,31 +152,31 @@ public class JpaCmpEngine implements Cmp
}
}
- public Object loadBean(ThreadContext callContext, Object primaryKey) {
- TransactionPolicy txPolicy = startTransaction("load", callContext);
+ public Object loadBean(final ThreadContext callContext, final Object primaryKey) {
+ final TransactionPolicy txPolicy = startTransaction("load", callContext);
try {
- BeanContext beanContext = callContext.getBeanContext();
- Class<?> beanClass = beanContext.getCmpImplClass();
+ final BeanContext beanContext = callContext.getBeanContext();
+ final Class<?> beanClass = beanContext.getCmpImplClass();
// Try to load it from the entity manager
- EntityManager entityManager = getEntityManager(beanContext);
+ final EntityManager entityManager = getEntityManager(beanContext);
return entityManager.find(beanClass, primaryKey);
} finally {
commitTransaction("load", callContext, txPolicy);
}
}
- public void storeBeanIfNoTx(ThreadContext callContext, Object bean) {
- TransactionPolicy callerTxPolicy = callContext.getTransactionPolicy();
+ public void storeBeanIfNoTx(final ThreadContext callContext, final Object bean) {
+ final TransactionPolicy callerTxPolicy = callContext.getTransactionPolicy();
if (callerTxPolicy != null && callerTxPolicy.isTransactionActive()) {
return;
}
- TransactionPolicy txPolicy = startTransaction("store", callContext);
+ final TransactionPolicy txPolicy = startTransaction("store", callContext);
try {
// only store if we started a new transaction
if (txPolicy.isNewTransaction()) {
- EntityManager entityManager = getEntityManager(callContext.getBeanContext());
+ final EntityManager entityManager = getEntityManager(callContext.getBeanContext());
entityManager.merge(bean);
}
} finally {
@@ -184,17 +184,17 @@ public class JpaCmpEngine implements Cmp
}
}
- public void removeBean(ThreadContext callContext) {
- TransactionPolicy txPolicy = startTransaction("remove", callContext);
+ public void removeBean(final ThreadContext callContext) {
+ final TransactionPolicy txPolicy = startTransaction("remove", callContext);
try {
- BeanContext deploymentInfo = callContext.getBeanContext();
- Class<?> beanClass = deploymentInfo.getCmpImplClass();
+ final BeanContext deploymentInfo = callContext.getBeanContext();
+ final Class<?> beanClass = deploymentInfo.getCmpImplClass();
- EntityManager entityManager = getEntityManager(deploymentInfo);
- Object primaryKey = callContext.getPrimaryKey();
+ final EntityManager entityManager = getEntityManager(deploymentInfo);
+ final Object primaryKey = callContext.getPrimaryKey();
// Try to load it from the entity manager
- Object bean = entityManager.find(beanClass, primaryKey);
+ final Object bean = entityManager.find(beanClass, primaryKey);
// remove the bean
entityManager.remove(bean);
} finally {
@@ -202,17 +202,17 @@ public class JpaCmpEngine implements Cmp
}
}
- public List<Object> queryBeans(ThreadContext callContext, Method queryMethod, Object[] args) throws FinderException {
- BeanContext deploymentInfo = callContext.getBeanContext();
- EntityManager entityManager = getEntityManager(deploymentInfo);
+ public List<Object> queryBeans(final ThreadContext callContext, final Method queryMethod, final Object[] args) throws FinderException {
+ final BeanContext deploymentInfo = callContext.getBeanContext();
+ final EntityManager entityManager = getEntityManager(deploymentInfo);
- StringBuilder queryName = new StringBuilder();
+ final StringBuilder queryName = new StringBuilder();
queryName.append(deploymentInfo.getAbstractSchemaName()).append(".").append(queryMethod.getName());
- String shortName = queryName.toString();
+ final String shortName = queryName.toString();
if (queryMethod.getParameterTypes().length > 0) {
queryName.append('(');
boolean first = true;
- for (Class<?> parameterType : queryMethod.getParameterTypes()) {
+ for (final Class<?> parameterType : queryMethod.getParameterTypes()) {
if (!first) queryName.append(',');
queryName.append(parameterType.getCanonicalName());
first = false;
@@ -221,7 +221,7 @@ public class JpaCmpEngine implements Cmp
}
- String fullName = queryName.toString();
+ final String fullName = queryName.toString();
Query query = createNamedQuery(entityManager, fullName);
if (query == null) {
query = createNamedQuery(entityManager, shortName);
@@ -232,14 +232,14 @@ public class JpaCmpEngine implements Cmp
return executeSelectQuery(query, args);
}
- public List<Object> queryBeans(BeanContext beanContext, String signature, Object[] args) throws FinderException {
- EntityManager entityManager = getEntityManager(beanContext);
+ public List<Object> queryBeans(final BeanContext beanContext, final String signature, final Object[] args) throws FinderException {
+ final EntityManager entityManager = getEntityManager(beanContext);
Query query = createNamedQuery(entityManager, signature);
if (query == null) {
- int parenIndex = signature.indexOf('(');
+ final int parenIndex = signature.indexOf('(');
if (parenIndex > 0) {
- String shortName = signature.substring(0, parenIndex);
+ final String shortName = signature.substring(0, parenIndex);
query = createNamedQuery(entityManager, shortName);
}
if (query == null) {
@@ -249,7 +249,7 @@ public class JpaCmpEngine implements Cmp
return executeSelectQuery(query, args);
}
- private List<Object> executeSelectQuery(Query query, Object[] args) {
+ private List<Object> executeSelectQuery(final Query query, Object[] args) {
// process args
if (args == null) {
args = NO_ARGS;
@@ -265,7 +265,7 @@ public class JpaCmpEngine implements Cmp
}
try {
query.getParameter(i + 1);
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
// IllegalArgumentException means that the parameter with the
// specified position does not exist
continue;
@@ -275,11 +275,11 @@ public class JpaCmpEngine implements Cmp
// todo results should not be iterated over, but should instead
// perform all work in a wrapper list on demand by the application code
- List results = query.getResultList();
- for (Object value : results) {
+ final List results = query.getResultList();
+ for (final Object value : results) {
if (value instanceof EntityBean) {
// todo don't activate beans already activated
- EntityBean entity = (EntityBean) value;
+ final EntityBean entity = (EntityBean) value;
cmpCallback.setEntityContext(entity);
cmpCallback.ejbActivate(entity);
}
@@ -288,14 +288,14 @@ public class JpaCmpEngine implements Cmp
return results;
}
- public int executeUpdateQuery(BeanContext beanContext, String signature, Object[] args) throws FinderException {
- EntityManager entityManager = getEntityManager(beanContext);
+ public int executeUpdateQuery(final BeanContext beanContext, final String signature, Object[] args) throws FinderException {
+ final EntityManager entityManager = getEntityManager(beanContext);
Query query = createNamedQuery(entityManager, signature);
if (query == null) {
- int parenIndex = signature.indexOf('(');
+ final int parenIndex = signature.indexOf('(');
if (parenIndex > 0) {
- String shortName = signature.substring(0, parenIndex);
+ final String shortName = signature.substring(0, parenIndex);
query = createNamedQuery(entityManager, shortName);
}
if (query == null) {
@@ -319,43 +319,43 @@ public class JpaCmpEngine implements Cmp
query.setParameter(i + 1, arg);
}
- int result = query.executeUpdate();
+ final int result = query.executeUpdate();
return result;
}
- private Query createNamedQuery(EntityManager entityManager, String name) {
+ private Query createNamedQuery(final EntityManager entityManager, final String name) {
try {
return entityManager.createNamedQuery(name);
- } catch (IllegalArgumentException ignored) {
+ } catch (final IllegalArgumentException ignored) {
// soooo lame that jpa throws an exception instead of returning null....
ignored.printStackTrace();
return null;
}
}
- private TransactionPolicy startTransaction(String operation, ThreadContext callContext) {
+ private TransactionPolicy startTransaction(final String operation, final ThreadContext callContext) {
try {
- TransactionPolicy txPolicy = createTransactionPolicy(TransactionType.Required, callContext);
+ final TransactionPolicy txPolicy = createTransactionPolicy(TransactionType.Required, callContext);
return txPolicy;
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new EJBException("Unable to start transaction for " + operation + " operation", e);
}
}
- private void commitTransaction(String operation, ThreadContext callContext, TransactionPolicy txPolicy) {
+ private void commitTransaction(final String operation, final ThreadContext callContext, final TransactionPolicy txPolicy) {
try {
afterInvoke(txPolicy, callContext);
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new EJBException("Unable to complete transaction for " + operation + " operation", e);
}
}
- private void configureKeyGenerator(BeanContext di) throws OpenEJBException {
+ private void configureKeyGenerator(final BeanContext di) throws OpenEJBException {
if (di.isCmp2()) {
di.setKeyGenerator(new Cmp2KeyGenerator());
} else {
- String primaryKeyField = di.getPrimaryKeyField();
- Class cmpBeanImpl = di.getCmpImplClass();
+ final String primaryKeyField = di.getPrimaryKeyField();
+ final Class cmpBeanImpl = di.getCmpImplClass();
if (primaryKeyField != null) {
di.setKeyGenerator(new SimpleKeyGenerator(cmpBeanImpl, primaryKeyField));
} else if (Object.class.equals(di.getPrimaryKeyClass())) {
@@ -431,9 +431,9 @@ public class JpaCmpEngine implements Cmp
// super.eventOccurred(event);
// }
- public void afterLoad(LifecycleEvent lifecycleEvent) {
+ public void afterLoad(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
- Object bean = lifecycleEvent.getSource();
+ final Object bean = lifecycleEvent.getSource();
// This may seem a bit strange to call ejbActivate immedately followed by ejbLoad,
// but it is completely legal. Since the ejbActivate method is not allowed to access
// persistent state of the bean (EJB 3.0fr 8.5.2) there should be no concern that the
@@ -443,51 +443,51 @@ public class JpaCmpEngine implements Cmp
cmpCallback.ejbLoad((EntityBean) bean);
}
- public void beforeStore(LifecycleEvent lifecycleEvent) {
+ public void beforeStore(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
- EntityBean bean = (EntityBean) lifecycleEvent.getSource();
+ final EntityBean bean = (EntityBean) lifecycleEvent.getSource();
if (!creating.get().contains(bean)) {
cmpCallback.ejbStore(bean);
}
}
- public void afterAttach(LifecycleEvent lifecycleEvent) {
+ public void afterAttach(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
- Object bean = lifecycleEvent.getSource();
+ final Object bean = lifecycleEvent.getSource();
cmpCallback.setEntityContext((EntityBean) bean);
}
- public void beforeDelete(LifecycleEvent lifecycleEvent) {
+ public void beforeDelete(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
try {
- Object bean = lifecycleEvent.getSource();
+ final Object bean = lifecycleEvent.getSource();
cmpCallback.ejbRemove((EntityBean) bean);
- } catch (RemoveException e) {
+ } catch (final RemoveException e) {
throw new PersistenceException(e);
}
}
- public void afterDetach(LifecycleEvent lifecycleEvent) {
+ public void afterDetach(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
// todo detach is called after ejbRemove which does not need ejbPassivate
- Object bean = lifecycleEvent.getSource();
+ final Object bean = lifecycleEvent.getSource();
cmpCallback.ejbPassivate((EntityBean) bean);
cmpCallback.unsetEntityContext((EntityBean) bean);
}
- public void beforePersist(LifecycleEvent lifecycleEvent) {
+ public void beforePersist(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
}
- public void afterRefresh(LifecycleEvent lifecycleEvent) {
+ public void afterRefresh(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
}
- public void beforeDetach(LifecycleEvent lifecycleEvent) {
+ public void beforeDetach(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
}
- public void beforeAttach(LifecycleEvent lifecycleEvent) {
+ public void beforeAttach(final LifecycleEvent lifecycleEvent) {
eventOccurred(lifecycleEvent);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngineFactory.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngineFactory.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngineFactory.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/jpa/JpaCmpEngineFactory.java Wed Feb 19 15:47:58 2014
@@ -33,7 +33,7 @@ public class JpaCmpEngineFactory impleme
return transactionManager;
}
- public void setTransactionManager(TransactionManager transactionManager) {
+ public void setTransactionManager(final TransactionManager transactionManager) {
this.transactionManager = transactionManager;
}
@@ -41,7 +41,7 @@ public class JpaCmpEngineFactory impleme
return transactionSynchronizationRegistry;
}
- public void setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry transactionSynchronizationRegistry) {
+ public void setTransactionSynchronizationRegistry(final TransactionSynchronizationRegistry transactionSynchronizationRegistry) {
this.transactionSynchronizationRegistry = transactionSynchronizationRegistry;
}
@@ -49,7 +49,7 @@ public class JpaCmpEngineFactory impleme
return cmpCallback;
}
- public void setCmpCallback(CmpCallback cmpCallback) {
+ public void setCmpCallback(final CmpCallback cmpCallback) {
this.cmpCallback = cmpCallback;
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContainer.java Wed Feb 19 15:47:58 2014
@@ -234,7 +234,7 @@ public class EntityContainer implements
returnValue = runMethod.invoke(bean, args);
ejbStore_If_No_Transaction(callContext, bean);
instanceManager.poolInstance(callContext, bean, callContext.getPrimaryKey());
- } catch (Throwable e) {
+ } catch (final Throwable e) {
handleException(txPolicy, e, callContext, bean);
} finally {
entrancyTracker.exit(callContext.getBeanContext(), callContext.getPrimaryKey());
@@ -261,10 +261,10 @@ public class EntityContainer implements
callContext.setCurrentOperation(Operation.LOAD);
bean.ejbLoad();
}
- } catch (NoSuchEntityException e) {
+ } catch (final NoSuchEntityException e) {
instanceManager.discardInstance(callContext, bean);
throw new ApplicationException(new NoSuchObjectException("Entity not found: " + callContext.getPrimaryKey())/*.initCause(e)*/);
- } catch (Exception e) {
+ } catch (final Exception e) {
instanceManager.discardInstance(callContext, bean);
throw e;
} finally {
@@ -292,7 +292,7 @@ public class EntityContainer implements
callContext.setCurrentOperation(Operation.STORE);
bean.ejbStore();
}
- } catch (Exception e) {
+ } catch (final Exception e) {
instanceManager.discardInstance(callContext, bean);
throw e;
} finally {
@@ -364,7 +364,7 @@ public class EntityContainer implements
// update pool
instanceManager.poolInstance(callContext, bean, primaryKey);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
handleException(txPolicy, e, callContext, bean);
} finally {
afterInvoke(txPolicy, callContext);
@@ -448,7 +448,7 @@ public class EntityContainer implements
bean.ejbRemove();
didRemove(bean, callContext);
instanceManager.poolInstance(callContext, bean, callContext.getPrimaryKey());
- } catch (Throwable e) {
+ } catch (final Throwable e) {
handleException(txPolicy, e, callContext, bean);
} finally {
afterInvoke(txPolicy, callContext);
@@ -475,7 +475,7 @@ public class EntityContainer implements
if (bean != null) {
try {
instanceManager.discardInstance(callContext, bean);
- } catch (SystemException e1) {
+ } catch (final SystemException e1) {
logger.error("The instance manager encountered an unkown system exception while trying to discard the entity instance with primary key " +
callContext.getPrimaryKey());
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityContext.java Wed Feb 19 15:47:58 2014
@@ -36,26 +36,26 @@ import java.util.ArrayList;
*/
public class EntityContext extends BaseContext implements javax.ejb.EntityContext {
- public EntityContext(SecurityService securityService) {
+ public EntityContext(final SecurityService securityService) {
super(securityService);
}
public EJBLocalObject getEJBLocalObject() throws IllegalStateException {
check(Call.getEJBLocalObject);
- ThreadContext threadContext = ThreadContext.getThreadContext();
- BeanContext di = threadContext.getBeanContext();
+ final ThreadContext threadContext = ThreadContext.getThreadContext();
+ final BeanContext di = threadContext.getBeanContext();
if (di.getLocalInterface() == null) {
throw new IllegalStateException("EJB " + di.getDeploymentID() + " does not have a local interface");
}
- EjbObjectProxyHandler handler = new EntityEjbObjectHandler(di, threadContext.getPrimaryKey(), InterfaceType.EJB_LOCAL, new ArrayList<Class>(), di.getLocalInterface());
+ final EjbObjectProxyHandler handler = new EntityEjbObjectHandler(di, threadContext.getPrimaryKey(), InterfaceType.EJB_LOCAL, new ArrayList<Class>(), di.getLocalInterface());
try {
- Class[] interfaces = new Class[]{di.getLocalInterface(), IntraVmProxy.class};
+ final Class[] interfaces = new Class[]{di.getLocalInterface(), IntraVmProxy.class};
return (EJBLocalObject) ProxyManager.newProxyInstance(interfaces, handler);
- } catch (IllegalAccessException iae) {
+ } catch (final IllegalAccessException iae) {
throw new InternalErrorException("Could not create IVM proxy for " + di.getLocalInterface() + " interface", iae);
}
}
@@ -63,29 +63,29 @@ public class EntityContext extends BaseC
public EJBObject getEJBObject() throws IllegalStateException {
check(Call.getEJBObject);
- ThreadContext threadContext = ThreadContext.getThreadContext();
- BeanContext di = threadContext.getBeanContext();
+ final ThreadContext threadContext = ThreadContext.getThreadContext();
+ final BeanContext di = threadContext.getBeanContext();
if (di.getRemoteInterface() == null) {
throw new IllegalStateException("EJB " + di.getDeploymentID() + " does not have a remote interface");
}
- EjbObjectProxyHandler handler = new EntityEjbObjectHandler(di.getContainer().getBeanContext(di.getDeploymentID()), threadContext.getPrimaryKey(), InterfaceType.EJB_OBJECT, new ArrayList<Class>(), di.getRemoteInterface());
+ final EjbObjectProxyHandler handler = new EntityEjbObjectHandler(di.getContainer().getBeanContext(di.getDeploymentID()), threadContext.getPrimaryKey(), InterfaceType.EJB_OBJECT, new ArrayList<Class>(), di.getRemoteInterface());
try {
- Class[] interfaces = new Class[]{di.getRemoteInterface(), IntraVmProxy.class};
+ final Class[] interfaces = new Class[]{di.getRemoteInterface(), IntraVmProxy.class};
return (EJBObject) ProxyManager.newProxyInstance(interfaces, handler);
- } catch (IllegalAccessException iae) {
+ } catch (final IllegalAccessException iae) {
throw new InternalErrorException("Could not create IVM proxy for " + di.getRemoteInterface() + " interface", iae);
}
}
public Object getPrimaryKey() throws IllegalStateException {
check(Call.getPrimaryKey);
- ThreadContext threadContext = ThreadContext.getThreadContext();
+ final ThreadContext threadContext = ThreadContext.getThreadContext();
return threadContext.getPrimaryKey();
}
- public void check(Call call) {
+ public void check(final Call call) {
final Operation operation = ThreadContext.getThreadContext().getCurrentOperation();
switch (call) {
case getUserTransaction:
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityEjbHomeHandler.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityEjbHomeHandler.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityEjbHomeHandler.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityEjbHomeHandler.java Wed Feb 19 15:47:58 2014
@@ -38,13 +38,13 @@ import java.util.Vector;
public class EntityEjbHomeHandler extends EjbHomeProxyHandler {
- public EntityEjbHomeHandler(BeanContext beanContext, InterfaceType interfaceType, List<Class> interfaces, Class mainInterface) {
+ public EntityEjbHomeHandler(final BeanContext beanContext, final InterfaceType interfaceType, final List<Class> interfaces, final Class mainInterface) {
super(beanContext, interfaceType, interfaces, mainInterface);
}
- public Object createProxy(Object primaryKey, Class mainInterface) {
- Object proxy = super.createProxy(primaryKey, mainInterface);
- EjbObjectProxyHandler handler = (EjbObjectProxyHandler) ProxyManager.getInvocationHandler(proxy);
+ public Object createProxy(final Object primaryKey, final Class mainInterface) {
+ final Object proxy = super.createProxy(primaryKey, mainInterface);
+ final EjbObjectProxyHandler handler = (EjbObjectProxyHandler) ProxyManager.getInvocationHandler(proxy);
/*
* Register the handle with the BaseEjbProxyHandler.liveHandleRegistry
@@ -58,41 +58,41 @@ public class EntityEjbHomeHandler extend
}
- protected Object findX(Class interfce, Method method, Object[] args, Object proxy) throws Throwable {
- Object retValue;
+ protected Object findX(final Class interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
+ final Object retValue;
try {
retValue = container.invoke(deploymentID, interfaceType, interfce, method, args, null);
- } catch (OpenEJBException e) {
+ } catch (final OpenEJBException e) {
logger.debug("entityEjbHomeHandler.containerInvocationFailure", e, e.getMessage());
throw e;
}
if (retValue instanceof Collection) {
- Object [] proxyInfos = ((Collection) retValue).toArray();
- Vector proxies = new Vector();
+ final Object [] proxyInfos = ((Collection) retValue).toArray();
+ final Vector proxies = new Vector();
for (int i = 0; i < proxyInfos.length; i++) {
- ProxyInfo proxyInfo = (ProxyInfo) proxyInfos[i];
+ final ProxyInfo proxyInfo = (ProxyInfo) proxyInfos[i];
proxies.addElement(createProxy(proxyInfo.getPrimaryKey(), getMainInterface()));
}
return proxies;
} else if (retValue instanceof ArrayEnumeration) {
- ArrayEnumeration enumeration = (ArrayEnumeration) retValue;
+ final ArrayEnumeration enumeration = (ArrayEnumeration) retValue;
for (int i = enumeration.size() - 1; i >= 0; --i) {
- ProxyInfo proxyInfo = (ProxyInfo) enumeration.get(i);
+ final ProxyInfo proxyInfo = (ProxyInfo) enumeration.get(i);
enumeration.set(i, createProxy(proxyInfo.getPrimaryKey(), getMainInterface()));
}
return enumeration;
} else if (retValue instanceof Enumeration) {
- Enumeration enumeration = (Enumeration) retValue;
+ final Enumeration enumeration = (Enumeration) retValue;
- List proxies = new ArrayList();
+ final List proxies = new ArrayList();
while (enumeration.hasMoreElements()) {
- ProxyInfo proxyInfo = (ProxyInfo) enumeration.nextElement();
+ final ProxyInfo proxyInfo = (ProxyInfo) enumeration.nextElement();
proxies.add(createProxy(proxyInfo.getPrimaryKey(), getMainInterface()));
}
return new ArrayEnumeration(proxies);
} else {
- ProxyInfo proxyInfo = (ProxyInfo) retValue;
+ final ProxyInfo proxyInfo = (ProxyInfo) retValue;
return createProxy(proxyInfo.getPrimaryKey(), getMainInterface());
@@ -100,15 +100,15 @@ public class EntityEjbHomeHandler extend
}
- protected Object removeByPrimaryKey(Class interfce, Method method, Object[] args, Object proxy) throws Throwable {
- Object primKey = args[0];
+ protected Object removeByPrimaryKey(final Class interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
+ final Object primKey = args[0];
// Check for the common mistake of passing the ejbObject instead of ejbObject.getPrimaryKey()
if (primKey instanceof EJBLocalObject) {
- Class ejbObjectProxyClass = primKey.getClass();
+ final Class ejbObjectProxyClass = primKey.getClass();
String ejbObjectName = null;
- for (Class clazz : ejbObjectProxyClass.getInterfaces()) {
+ for (final Class clazz : ejbObjectProxyClass.getInterfaces()) {
if (EJBLocalObject.class.isAssignableFrom(clazz)) {
ejbObjectName = clazz.getSimpleName();
break;
@@ -118,10 +118,10 @@ public class EntityEjbHomeHandler extend
throw new RemoveException("Invalid argument '" + ejbObjectName + "', expected primary key. Update to ejbLocalHome.remove(" + lcfirst(ejbObjectName) + ".getPrimaryKey())");
} else if (primKey instanceof EJBObject) {
- Class ejbObjectProxyClass = primKey.getClass();
+ final Class ejbObjectProxyClass = primKey.getClass();
String ejbObjectName = null;
- for (Class clazz : ejbObjectProxyClass.getInterfaces()) {
+ for (final Class clazz : ejbObjectProxyClass.getInterfaces()) {
if (EJBObject.class.isAssignableFrom(clazz)) {
ejbObjectName = clazz.getSimpleName();
break;
@@ -141,15 +141,15 @@ public class EntityEjbHomeHandler extend
return null;
}
- private static String lcfirst(String s){
+ private static String lcfirst(final String s){
if (s == null || s.length() < 1) return s;
- StringBuilder sb = new StringBuilder(s);
+ final StringBuilder sb = new StringBuilder(s);
sb.setCharAt(0, Character.toLowerCase(sb.charAt(0)));
return sb.toString();
}
- protected EjbObjectProxyHandler newEjbObjectHandler(BeanContext beanContext, Object pk, InterfaceType interfaceType, List<Class> interfaces, Class mainInterface) {
+ protected EjbObjectProxyHandler newEjbObjectHandler(final BeanContext beanContext, final Object pk, final InterfaceType interfaceType, final List<Class> interfaces, final Class mainInterface) {
return new EntityEjbObjectHandler(getBeanContext(), pk, interfaceType, interfaces, mainInterface);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityEjbObjectHandler.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityEjbObjectHandler.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityEjbObjectHandler.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityEjbObjectHandler.java Wed Feb 19 15:47:58 2014
@@ -39,7 +39,7 @@ public class EntityEjbObjectHandler exte
*/
private Object registryId;
- public EntityEjbObjectHandler(BeanContext beanContext, Object pk, InterfaceType interfaceType, List<Class> interfaces, Class mainInterface) {
+ public EntityEjbObjectHandler(final BeanContext beanContext, final Object pk, final InterfaceType interfaceType, final List<Class> interfaces, final Class mainInterface) {
super(beanContext, pk, interfaceType, interfaces, mainInterface);
}
@@ -50,7 +50,7 @@ public class EntityEjbObjectHandler exte
* handler for the same bean identity so that they can removed together when one of the remove() operations
* is called.
*/
- public static Object getRegistryId(Container container, Object deploymentId, Object primaryKey) {
+ public static Object getRegistryId(final Container container, final Object deploymentId, final Object primaryKey) {
return new RegistryId(container, deploymentId, primaryKey);
}
@@ -61,22 +61,22 @@ public class EntityEjbObjectHandler exte
return registryId;
}
- protected Object getPrimaryKey(Method method, Object[] args, Object proxy) throws Throwable {
+ protected Object getPrimaryKey(final Method method, final Object[] args, final Object proxy) throws Throwable {
return primaryKey;
}
- protected Object isIdentical(Method method, Object[] args, Object proxy) throws Throwable {
+ protected Object isIdentical(final Method method, final Object[] args, final Object proxy) throws Throwable {
checkAuthorization(method);
if (args.length != 1) {
throw new IllegalArgumentException("Expected one argument to isIdentical, but received " + args.length);
}
- Object that = args[0];
- Object invocationHandler = ProxyManager.getInvocationHandler(that);
+ final Object that = args[0];
+ final Object invocationHandler = ProxyManager.getInvocationHandler(that);
if (invocationHandler instanceof EntityEjbObjectHandler) {
- EntityEjbObjectHandler handler = (EntityEjbObjectHandler) invocationHandler;
+ final EntityEjbObjectHandler handler = (EntityEjbObjectHandler) invocationHandler;
/*
* The registry id is a compound key composed of the bean's primary key, deployment id, and
@@ -88,9 +88,9 @@ public class EntityEjbObjectHandler exte
return false;
}
- protected Object remove(Class interfce, Method method, Object[] args, Object proxy) throws Throwable {
+ protected Object remove(final Class interfce, final Method method, final Object[] args, final Object proxy) throws Throwable {
checkAuthorization(method);
- Object value = container.invoke(deploymentID, interfaceType, interfce, method, args, primaryKey);
+ final Object value = container.invoke(deploymentID, interfaceType, interfce, method, args, primaryKey);
/*
* This operation takes care of invalidating all the EjbObjectProxyHanders associated with
* the same RegistryId. See this.createProxy().
@@ -112,7 +112,7 @@ public class EntityEjbObjectHandler exte
private final Object deploymentId;
private final Object primaryKey;
- public RegistryId(Container container, Object deploymentId, Object primaryKey) {
+ public RegistryId(final Container container, final Object deploymentId, final Object primaryKey) {
if (container == null) throw new NullPointerException("container is null");
if (deploymentId == null) throw new NullPointerException("deploymentId is null");
@@ -121,11 +121,11 @@ public class EntityEjbObjectHandler exte
this.primaryKey = primaryKey;
}
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- RegistryId that = (RegistryId) o;
+ final RegistryId that = (RegistryId) o;
return containerId.equals(that.containerId) &&
deploymentId.equals(that.deploymentId) &&
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntityInstanceManager.java Wed Feb 19 15:47:58 2014
@@ -57,33 +57,33 @@ public class EntityInstanceManager {
private SecurityService securityService;
- public EntityInstanceManager(EntityContainer container, SecurityService securityService, int poolSize) {
+ public EntityInstanceManager(final EntityContainer container, final SecurityService securityService, final int poolSize) {
this.securityService = securityService;
this.poolsize = poolSize;
poolMap = new HashMap<Object,LinkedListStack>();// put size in later
- BeanContext[] beanContexts = container.getBeanContexts();
- for (BeanContext beanContext : beanContexts) {
+ final BeanContext[] beanContexts = container.getBeanContexts();
+ for (final BeanContext beanContext : beanContexts) {
deploy(beanContext);
}
}
- public void deploy(BeanContext beanContext) {
+ public void deploy(final BeanContext beanContext) {
poolMap.put(beanContext.getDeploymentID(), new LinkedListStack(poolsize / 2));
beanContext.set(EJBContext.class, createEntityContext());
}
- public void undeploy(BeanContext beanContext) {
+ public void undeploy(final BeanContext beanContext) {
poolMap.remove(beanContext.getDeploymentID());
}
- public EntityBean obtainInstance(ThreadContext callContext) throws OpenEJBException {
+ public EntityBean obtainInstance(final ThreadContext callContext) throws OpenEJBException {
// primary key is null if its a servicing a home methods (create, find, ejbHome)
- Object primaryKey = callContext.getPrimaryKey();
- TransactionPolicy txPolicy = callContext.getTransactionPolicy();
+ final Object primaryKey = callContext.getPrimaryKey();
+ final TransactionPolicy txPolicy = callContext.getTransactionPolicy();
if (callContext.getPrimaryKey() != null && txPolicy != null && txPolicy.isTransactionActive()) {
- Key key = new Key(callContext.getBeanContext().getDeploymentID(), primaryKey);
+ final Key key = new Key(callContext.getBeanContext().getDeploymentID(), primaryKey);
SynchronizationWrapper wrapper = (SynchronizationWrapper) txPolicy.getResource(key);
if (wrapper != null) {// if true, the requested bean instance is already enrolled in a transaction
@@ -129,7 +129,7 @@ public class EntityInstanceManager {
* Then the bean entity is being access by this transaction for the first time,
* so it needs to be enrolled in the transaction.
*/
- EntityBean bean = getPooledInstance(callContext);
+ final EntityBean bean = getPooledInstance(callContext);
wrapper = new SynchronizationWrapper(callContext.getBeanContext(), primaryKey, bean, false, key, txPolicy);
if (callContext.getCurrentOperation() == Operation.REMOVE) {
@@ -147,14 +147,14 @@ public class EntityInstanceManager {
txPolicy.registerSynchronization(wrapper);
loadingBean(bean, callContext);
- Operation orginalOperation = callContext.getCurrentOperation();
+ final Operation orginalOperation = callContext.getCurrentOperation();
callContext.setCurrentOperation(Operation.LOAD);
try {
bean.ejbLoad();
- } catch (NoSuchEntityException e) {
+ } catch (final NoSuchEntityException e) {
wrapper.disassociate();
throw new InvalidateReferenceException(new NoSuchObjectException("Entity not found: " + primaryKey, e));
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.error("Exception encountered during ejbLoad():", e);
//djencks not sure about this dissociate call
wrapper.disassociate();
@@ -175,27 +175,27 @@ public class EntityInstanceManager {
}
}
- protected void loadingBean(EntityBean bean, ThreadContext callContext) throws OpenEJBException {
+ protected void loadingBean(final EntityBean bean, final ThreadContext callContext) throws OpenEJBException {
}
- protected void reusingBean(EntityBean bean, ThreadContext callContext) throws OpenEJBException {
+ protected void reusingBean(final EntityBean bean, final ThreadContext callContext) throws OpenEJBException {
}
- protected EntityBean getPooledInstance(ThreadContext callContext) throws OpenEJBException {
- BeanContext beanContext = callContext.getBeanContext();
- Stack methodReadyPool = poolMap.get(beanContext.getDeploymentID());
+ protected EntityBean getPooledInstance(final ThreadContext callContext) throws OpenEJBException {
+ final BeanContext beanContext = callContext.getBeanContext();
+ final Stack methodReadyPool = poolMap.get(beanContext.getDeploymentID());
if (methodReadyPool == null) throw new SystemException("Invalid deployment id " + beanContext.getDeploymentID() + " for this container");
EntityBean bean = (EntityBean) methodReadyPool.pop();
if (bean == null) {
try {
bean = (EntityBean) beanContext.getBeanClass().newInstance();
- } catch (Exception e) {
+ } catch (final Exception e) {
logger.error("Bean instantiation failed for class " + beanContext.getBeanClass(), e);
throw new SystemException(e);
}
- Operation currentOp = callContext.getCurrentOperation();
+ final Operation currentOp = callContext.getCurrentOperation();
callContext.setCurrentOperation(Operation.SET_CONTEXT);
try {
@@ -210,7 +210,7 @@ public class EntityInstanceManager {
* to do.
*/
bean.setEntityContext(createEntityContext());
- } catch (Exception e) {
+ } catch (final Exception e) {
/*
* The EJB 1.1 specification does not specify how exceptions thrown by setEntityContext impact the
* transaction, if there is one. In this case we choose the least disruptive operation, throwing an
@@ -235,7 +235,7 @@ public class EntityInstanceManager {
* 3. Its being retrieved to service an ejbRemove() method.
* See section 9.1.4 of the EJB 1.1 specification.
*/
- Operation currentOp = callContext.getCurrentOperation();
+ final Operation currentOp = callContext.getCurrentOperation();
callContext.setCurrentOperation(Operation.ACTIVATE);
try {
@@ -246,9 +246,9 @@ public class EntityInstanceManager {
See EJB 1.1 specification, section 12.3.2
*/
bean.ejbActivate();
- } catch (Throwable e) {
+ } catch (final Throwable e) {
logger.error("Encountered exception during call to ejbActivate()", e);
- TransactionPolicy txPolicy = callContext.getTransactionPolicy();
+ final TransactionPolicy txPolicy = callContext.getTransactionPolicy();
if (txPolicy != null && txPolicy.isTransactionActive()) {
txPolicy.setRollbackOnly(e);
throw new ApplicationException(new TransactionRolledbackException("Reflection exception thrown while attempting to call ejbActivate() on the instance", e));
@@ -266,16 +266,16 @@ public class EntityInstanceManager {
return new EntityContext(securityService);
}
- public void poolInstance(ThreadContext callContext, EntityBean bean, Object primaryKey) throws OpenEJBException {
+ public void poolInstance(final ThreadContext callContext, final EntityBean bean, final Object primaryKey) throws OpenEJBException {
if (bean == null) {
return;
}
// primary key is null if its a servicing a home methods (create, find, ejbHome)
- TransactionPolicy txPolicy = callContext.getTransactionPolicy();
+ final TransactionPolicy txPolicy = callContext.getTransactionPolicy();
if (primaryKey != null && txPolicy != null && txPolicy.isTransactionActive()) {
- Key key = new Key(callContext.getBeanContext().getDeploymentID(), primaryKey);
+ final Key key = new Key(callContext.getBeanContext().getDeploymentID(), primaryKey);
SynchronizationWrapper wrapper = (SynchronizationWrapper) txPolicy.getResource(key);
if (wrapper != null) {
@@ -291,7 +291,7 @@ public class EntityInstanceManager {
* If the bean has been removed then the bean instance is no longer needed and can return to the methodReadyPool
* to service another identity.
*/
- Stack methodReadyPool = poolMap.get(callContext.getBeanContext().getDeploymentID());
+ final Stack methodReadyPool = poolMap.get(callContext.getBeanContext().getDeploymentID());
methodReadyPool.push(bean);
} else {
if (callContext.getCurrentOperation() == Operation.CREATE) {
@@ -327,7 +327,7 @@ public class EntityInstanceManager {
* method. In this case we need to call the bean instance's ejbPassivate before returning it to the pool per EJB 1.1
* Section 9.1.
*/
- Operation currentOp = callContext.getCurrentOperation();
+ final Operation currentOp = callContext.getCurrentOperation();
callContext.setCurrentOperation(Operation.PASSIVATE);
@@ -339,7 +339,7 @@ public class EntityInstanceManager {
See EJB 1.1 specification, section 12.3.2
*/
bean.ejbPassivate();
- } catch (Throwable e) {
+ } catch (final Throwable e) {
if (txPolicy.isTransactionActive()) {
txPolicy.setRollbackOnly(e);
throw new ApplicationException(new TransactionRolledbackException("Reflection exception thrown while attempting to call ejbPassivate() on the instance", e));
@@ -355,17 +355,17 @@ public class EntityInstanceManager {
* method and is not still part of a tx. While in the method ready pool the bean instance is not associated with a
* primary key and may be used to service a request for any bean of the same class.
*/
- Stack methodReadyPool = poolMap.get(callContext.getBeanContext().getDeploymentID());
+ final Stack methodReadyPool = poolMap.get(callContext.getBeanContext().getDeploymentID());
methodReadyPool.push(bean);
}
}
- public void freeInstance(ThreadContext callContext, EntityBean bean) throws SystemException {
+ public void freeInstance(final ThreadContext callContext, final EntityBean bean) throws SystemException {
discardInstance(callContext, bean);
- Operation currentOp = callContext.getCurrentOperation();
+ final Operation currentOp = callContext.getCurrentOperation();
callContext.setCurrentOperation(Operation.UNSET_CONTEXT);
try {
@@ -380,7 +380,7 @@ public class EntityInstanceManager {
* to do.
*/
bean.unsetEntityContext();
- } catch (Exception e) {
+ } catch (final Exception e) {
/*
* The EJB 1.1 specification does not specify how exceptions thrown by unsetEntityContext impact the
* transaction, if there is one. In this case we choose to do nothing since the instance is being disposed
@@ -394,9 +394,9 @@ public class EntityInstanceManager {
}
- public void discardInstance(ThreadContext callContext, EntityBean bean) throws SystemException {
- Object primaryKey = callContext.getPrimaryKey();
- TransactionPolicy txPolicy = callContext.getTransactionPolicy();
+ public void discardInstance(final ThreadContext callContext, final EntityBean bean) throws SystemException {
+ final Object primaryKey = callContext.getPrimaryKey();
+ final TransactionPolicy txPolicy = callContext.getTransactionPolicy();
if (primaryKey == null || txPolicy == null || !txPolicy.isTransactionActive()) {
return;
}
@@ -405,8 +405,8 @@ public class EntityInstanceManager {
// especially important in the obtainInstance( ) method where a disassociated wrapper
// in the txReadyPool is indicative of an entity bean that has been removed via
// ejbRemove() rather than freed because of an error condition as is the case here.
- Key key = new Key(callContext.getBeanContext().getDeploymentID(), primaryKey);
- SynchronizationWrapper wrapper = (SynchronizationWrapper) txPolicy.getResource(key);
+ final Key key = new Key(callContext.getBeanContext().getDeploymentID(), primaryKey);
+ final SynchronizationWrapper wrapper = (SynchronizationWrapper) txPolicy.getResource(key);
if (wrapper != null) {
/*
It's not possible to deregister a wrapper with the transaction,
@@ -433,7 +433,7 @@ public class EntityInstanceManager {
private final Object deploymentId;
private final Object primaryKey;
- public Key(Object deploymentId, Object primaryKey) {
+ public Key(final Object deploymentId, final Object primaryKey) {
if (deploymentId == null) throw new NullPointerException("deploymentId is null");
if (primaryKey == null) throw new NullPointerException("primaryKey is null");
@@ -441,11 +441,11 @@ public class EntityInstanceManager {
this.primaryKey = primaryKey;
}
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- Key key = (Key) o;
+ final Key key = (Key) o;
return deploymentId.equals(key.deploymentId) && primaryKey.equals(key.primaryKey);
}
@@ -479,7 +479,7 @@ public class EntityInstanceManager {
private final Object primaryKey;
private final TransactionPolicy txPolicy;
- public SynchronizationWrapper(BeanContext beanContext, Object primaryKey, EntityBean bean, boolean available, Key readyPoolKey, TransactionPolicy txPolicy) {
+ public SynchronizationWrapper(final BeanContext beanContext, final Object primaryKey, final EntityBean bean, final boolean available, final Key readyPoolKey, final TransactionPolicy txPolicy) {
if (bean == null) throw new IllegalArgumentException("bean is null");
if (readyPoolKey == null) throw new IllegalArgumentException("key is null");
if (beanContext == null) throw new IllegalArgumentException("deploymentInfo is null");
@@ -511,7 +511,7 @@ public class EntityInstanceManager {
return available;
}
- public synchronized void setEntityBean(EntityBean ebean) {
+ public synchronized void setEntityBean(final EntityBean ebean) {
available = true;
bean = ebean;
}
@@ -523,19 +523,19 @@ public class EntityInstanceManager {
public void beforeCompletion() {
if (associated) {
- EntityBean bean;
+ final EntityBean bean;
synchronized (this) {
bean = this.bean;
}
- ThreadContext callContext = new ThreadContext(beanContext, primaryKey);
+ final ThreadContext callContext = new ThreadContext(beanContext, primaryKey);
callContext.setCurrentOperation(Operation.STORE);
- ThreadContext oldCallContext = ThreadContext.enter(callContext);
+ final ThreadContext oldCallContext = ThreadContext.enter(callContext);
try {
bean.ejbStore();
- } catch (Exception re) {
+ } catch (final Exception re) {
logger.error("Exception occured during ejbStore()", re);
txPolicy.setRollbackOnly(re);
} finally {
@@ -544,7 +544,7 @@ public class EntityInstanceManager {
}
}
- public void afterCompletion(Status status) {
+ public void afterCompletion(final Status status) {
txPolicy.removeResource(readyPoolKey);
}
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntrancyTracker.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntrancyTracker.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntrancyTracker.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/entity/EntrancyTracker.java Wed Feb 19 15:47:58 2014
@@ -37,17 +37,17 @@ public class EntrancyTracker {
private final TransactionSynchronizationRegistry synchronizationRegistry;
- public EntrancyTracker(TransactionSynchronizationRegistry synchronizationRegistry) {
+ public EntrancyTracker(final TransactionSynchronizationRegistry synchronizationRegistry) {
this.synchronizationRegistry = synchronizationRegistry;
}
- public void enter(BeanContext beanContext, Object primaryKey) throws ApplicationException {
+ public void enter(final BeanContext beanContext, final Object primaryKey) throws ApplicationException {
if (primaryKey == null || beanContext.isReentrant()) {
return;
}
- Object deploymentId = beanContext.getDeploymentID();
- InstanceKey key = new InstanceKey(deploymentId, primaryKey);
+ final Object deploymentId = beanContext.getDeploymentID();
+ final InstanceKey key = new InstanceKey(deploymentId, primaryKey);
Set<InstanceKey> inCall;
@@ -58,31 +58,31 @@ public class EntrancyTracker {
inCall = new HashSet<InstanceKey>();
synchronizationRegistry.putResource(EntrancyTracker.class, inCall);
}
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
inCall = inCallThreadLocal.get();
}
if (!inCall.add(key)) {
- ApplicationException exception = new ApplicationException(new RemoteException("Attempted reentrant access. " + "Bean " + deploymentId + " is not reentrant and instance " + primaryKey + " has already been entered : " +inCall));
+ final ApplicationException exception = new ApplicationException(new RemoteException("Attempted reentrant access. " + "Bean " + deploymentId + " is not reentrant and instance " + primaryKey + " has already been entered : " +inCall));
exception.printStackTrace();
throw exception;
}
}
- public void exit(BeanContext beanContext, Object primaryKey) throws ApplicationException {
+ public void exit(final BeanContext beanContext, final Object primaryKey) throws ApplicationException {
if (primaryKey == null || beanContext.isReentrant()) {
return;
}
- Object deploymentId = beanContext.getDeploymentID();
- InstanceKey key = new InstanceKey(deploymentId, primaryKey);
+ final Object deploymentId = beanContext.getDeploymentID();
+ final InstanceKey key = new InstanceKey(deploymentId, primaryKey);
Set<InstanceKey> inCall = null;
try {
//noinspection unchecked
inCall = (Set<InstanceKey>) synchronizationRegistry.getResource(EntrancyTracker.class);
- } catch (IllegalStateException e) {
+ } catch (final IllegalStateException e) {
inCall = inCallThreadLocal.get();
}
@@ -96,16 +96,16 @@ public class EntrancyTracker {
private final Object primaryKey;
- public InstanceKey(Object deploymentId, Object primaryKey) {
+ public InstanceKey(final Object deploymentId, final Object primaryKey) {
this.deploymentId = deploymentId;
this.primaryKey = primaryKey;
}
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
- InstanceKey that = (InstanceKey) o;
+ final InstanceKey that = (InstanceKey) o;
return deploymentId.equals(that.deploymentId) && primaryKey.equals(that.primaryKey);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/Interceptor.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/Interceptor.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/Interceptor.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/Interceptor.java Wed Feb 19 15:47:58 2014
@@ -25,7 +25,7 @@ public class Interceptor {
private final Object instance;
private final Method method;
- public Interceptor(Object instance, Method method) {
+ public Interceptor(final Object instance, final Method method) {
if (instance == null) throw new NullPointerException("instance is null");
if (method == null) throw new NullPointerException("method is null");
this.instance = instance;
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorData.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorData.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorData.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorData.java Wed Feb 19 15:47:58 2014
@@ -63,7 +63,7 @@ public class InterceptorData {
private final Map<Class<?>, Object> data = new HashMap<Class<?>, Object>();
- public InterceptorData(Class clazz) {
+ public InterceptorData(final Class clazz) {
this.clazz = clazz;
}
@@ -107,7 +107,7 @@ public class InterceptorData {
return aroundTimeout;
}
- public Set<Method> getMethods(Operation operation) {
+ public Set<Method> getMethods(final Operation operation) {
switch(operation) {
case BUSINESS: return getAroundInvoke();
case BUSINESS_WS: return getAroundInvoke();
@@ -124,7 +124,7 @@ public class InterceptorData {
return Collections.EMPTY_SET;
}
- public boolean equals(Object o) {
+ public boolean equals(final Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
@@ -143,7 +143,7 @@ public class InterceptorData {
CACHE.put(clazz, scan(clazz));
}
- public static InterceptorData scan(Class<?> clazz) {
+ public static InterceptorData scan(final Class<?> clazz) {
final InterceptorData model = CACHE.get(clazz);
if (model != null) {
final InterceptorData data = new InterceptorData(clazz);
@@ -175,10 +175,10 @@ public class InterceptorData {
return data;
}
- private static void add(ClassFinder finder, Set<Method> methods, Class<? extends Annotation> annotation) {
+ private static void add(final ClassFinder finder, final Set<Method> methods, final Class<? extends Annotation> annotation) {
final List<Method> annotatedMethods = finder.findAnnotatedMethods(annotation);
- for (Method method : annotatedMethods) {
+ for (final Method method : annotatedMethods) {
SetAccessible.on(method);
methods.add(method);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorInstance.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorInstance.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorInstance.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorInstance.java Wed Feb 19 15:47:58 2014
@@ -23,12 +23,12 @@ public class InterceptorInstance {
private final Object interceptor;
private final InterceptorData data;
- public InterceptorInstance(Object interceptor, InterceptorData data) {
+ public InterceptorInstance(final Object interceptor, final InterceptorData data) {
this.interceptor = interceptor;
this.data = data;
}
- public InterceptorInstance(Object interceptor) {
+ public InterceptorInstance(final Object interceptor) {
this(interceptor, InterceptorData.scan(interceptor.getClass()));
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorStack.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorStack.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorStack.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/InterceptorStack.java Wed Feb 19 15:47:58 2014
@@ -36,7 +36,7 @@ public class InterceptorStack {
private final Method targetMethod;
private final Operation operation;
- public InterceptorStack(Object beanInstance, Method targetMethod, Operation operation, List<InterceptorData> interceptorDatas, Map<String, Object> interceptorInstances) {
+ public InterceptorStack(final Object beanInstance, final Method targetMethod, final Operation operation, final List<InterceptorData> interceptorDatas, final Map<String, Object> interceptorInstances) {
if (interceptorDatas == null) throw new NullPointerException("interceptorDatas is null");
if (interceptorInstances == null) throw new NullPointerException("interceptorInstances is null");
this.beanInstance = beanInstance;
@@ -45,17 +45,17 @@ public class InterceptorStack {
interceptors = new ArrayList<Interceptor>(interceptorDatas.size());
- for (InterceptorData interceptorData : interceptorDatas) {
- Class interceptorClass = interceptorData.getInterceptorClass();
- Object interceptorInstance = interceptorInstances.get(interceptorClass.getName());
+ for (final InterceptorData interceptorData : interceptorDatas) {
+ final Class interceptorClass = interceptorData.getInterceptorClass();
+ final Object interceptorInstance = interceptorInstances.get(interceptorClass.getName());
if (interceptorInstance == null) {
throw new IllegalArgumentException("No interceptor of type " + interceptorClass.getName());
}
- Set<Method> methods = interceptorData.getMethods(operation);
- for (Method method : methods) {
+ final Set<Method> methods = interceptorData.getMethods(operation);
+ for (final Method method : methods) {
final Interceptor interceptor;
- Object handler = DynamicProxyImplFactory.realHandler(interceptorInstance);
+ final Object handler = DynamicProxyImplFactory.realHandler(interceptorInstance);
if (handler != null && method.getDeclaringClass().equals(handler.getClass())) { // dynamic impl
interceptor = new Interceptor(handler, method);
} else {
@@ -67,13 +67,13 @@ public class InterceptorStack {
}
- public InvocationContext createInvocationContext(Object... parameters) {
+ public InvocationContext createInvocationContext(final Object... parameters) {
return new ReflectionInvocationContext(operation, interceptors, beanInstance, targetMethod, parameters);
}
- public Object invoke(Object... parameters) throws Exception {
+ public Object invoke(final Object... parameters) throws Exception {
try {
- InvocationContext invocationContext = createInvocationContext(parameters);
+ final InvocationContext invocationContext = createInvocationContext(parameters);
if (ThreadContext.getThreadContext() != null) {
ThreadContext.getThreadContext().set(InvocationContext.class, invocationContext);
}
@@ -85,9 +85,9 @@ public class InterceptorStack {
}
}
- public Object invoke(javax.xml.ws.handler.MessageContext messageContext, Object... parameters) throws Exception {
+ public Object invoke(final javax.xml.ws.handler.MessageContext messageContext, final Object... parameters) throws Exception {
try {
- InvocationContext invocationContext = new JaxWsInvocationContext(operation, interceptors, beanInstance, targetMethod, messageContext, parameters);
+ final InvocationContext invocationContext = new JaxWsInvocationContext(operation, interceptors, beanInstance, targetMethod, messageContext, parameters);
ThreadContext.getThreadContext().set(InvocationContext.class, invocationContext);
return invocationContext.proceed();
} finally {
@@ -95,9 +95,9 @@ public class InterceptorStack {
}
}
- public Object invoke(javax.xml.rpc.handler.MessageContext messageContext, Object... parameters) throws Exception {
+ public Object invoke(final javax.xml.rpc.handler.MessageContext messageContext, final Object... parameters) throws Exception {
try {
- InvocationContext invocationContext = new JaxRpcInvocationContext(operation, interceptors, beanInstance, targetMethod, messageContext, parameters);
+ final InvocationContext invocationContext = new JaxRpcInvocationContext(operation, interceptors, beanInstance, targetMethod, messageContext, parameters);
ThreadContext.getThreadContext().set(InvocationContext.class, invocationContext);
return invocationContext.proceed();
} finally {
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/JaxRpcInvocationContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/JaxRpcInvocationContext.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/JaxRpcInvocationContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/JaxRpcInvocationContext.java Wed Feb 19 15:47:58 2014
@@ -31,7 +31,7 @@ import java.util.List;
*/
public class JaxRpcInvocationContext extends ReflectionInvocationContext {
- public JaxRpcInvocationContext(Operation operation, List<Interceptor> interceptors, Object target, Method method, MessageContext messageContext, Object... parameters) {
+ public JaxRpcInvocationContext(final Operation operation, final List<Interceptor> interceptors, final Object target, final Method method, final MessageContext messageContext, final Object... parameters) {
super(operation, interceptors, target, method, parameters);
getContextData().put(MessageContext.class.getName(), messageContext);
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/JaxWsInvocationContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/JaxWsInvocationContext.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/JaxWsInvocationContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/JaxWsInvocationContext.java Wed Feb 19 15:47:58 2014
@@ -29,7 +29,7 @@ import java.util.Map;
public class JaxWsInvocationContext extends ReflectionInvocationContext {
private final MessageContext messageContext;
- public JaxWsInvocationContext(Operation operation, List<Interceptor> interceptors, Object target, Method method, MessageContext messageContext, Object... parameters) {
+ public JaxWsInvocationContext(final Operation operation, final List<Interceptor> interceptors, final Object target, final Method method, final MessageContext messageContext, final Object... parameters) {
super(operation, interceptors, target, method, parameters);
this.messageContext = messageContext;
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/interceptor/ReflectionInvocationContext.java Wed Feb 19 15:47:58 2014
@@ -40,7 +40,7 @@ public class ReflectionInvocationContext
private final Operation operation;
- public ReflectionInvocationContext(Operation operation, List<Interceptor> interceptors, Object target, Method method, Object... parameters) {
+ public ReflectionInvocationContext(final Operation operation, final List<Interceptor> interceptors, final Object target, final Method method, final Object... parameters) {
if (operation == null) throw new NullPointerException("operation is null");
if (interceptors == null) throw new NullPointerException("interceptors is null");
if (target == null) throw new NullPointerException("target is null");
@@ -94,7 +94,7 @@ public class ReflectionInvocationContext
return m;
}
- public void setParameters(Object[] parameters) {
+ public void setParameters(final Object[] parameters) {
if (operation.isCallback() && !operation.equals(Operation.TIMEOUT)) {
throw new IllegalStateException(getIllegalParameterAccessMessage());
}
@@ -103,8 +103,8 @@ public class ReflectionInvocationContext
throw new IllegalArgumentException("Expected " + this.parameters.length + " parameters, but only got " + parameters.length + " parameters");
}
for (int i = 0; i < parameters.length; i++) {
- Object parameter = parameters[i];
- Class<?> parameterType = parameterTypes[i];
+ final Object parameter = parameters[i];
+ final Class<?> parameterType = parameterTypes[i];
if (parameter == null) {
if (parameterType.isPrimitive()) {
@@ -113,8 +113,8 @@ public class ReflectionInvocationContext
}
} else {
//check that types are applicable
- Class<?> actual = Classes.deprimitivize(parameterType);
- Class<?> given = Classes.deprimitivize(parameter.getClass());
+ final Class<?> actual = Classes.deprimitivize(parameterType);
+ final Class<?> given = Classes.deprimitivize(parameter.getClass());
if (!actual.isAssignableFrom(given)) {
throw new IllegalArgumentException("Expected parameter " + i + " to be of type " + parameterType.getName() +
@@ -131,9 +131,9 @@ public class ReflectionInvocationContext
private Invocation next() {
if (interceptors.hasNext()) {
- Interceptor interceptor = interceptors.next();
- Object nextInstance = interceptor.getInstance();
- Method nextMethod = interceptor.getMethod();
+ final Interceptor interceptor = interceptors.next();
+ final Object nextInstance = interceptor.getInstance();
+ final Method nextMethod = interceptor.getMethod();
if (nextMethod.getParameterTypes().length == 1 && nextMethod.getParameterTypes()[0] == InvocationContext.class) {
return new InterceptorInvocation(nextInstance, nextMethod, this);
@@ -143,7 +143,7 @@ public class ReflectionInvocationContext
} else if (method != null) {
//EJB 3.1, it is allowed that timeout method does not have parameter Timer.class,
//However, while invoking the timeout method, the timer value is passed, as it is also required by InnvocationContext.getTimer() method
- Object[] methodParameters;
+ final Object[] methodParameters;
if (operation.equals(Operation.TIMEOUT) && method.getParameterTypes().length == 0) {
methodParameters = new Object[0];
} else {
@@ -160,9 +160,9 @@ public class ReflectionInvocationContext
// out so stepping through a large stack in a debugger can be done quickly.
// Simply put one break point on 'next.invoke()' or one inside that method.
try {
- Invocation next = next();
+ final Invocation next = next();
return next.invoke();
- } catch (InvocationTargetException e) {
+ } catch (final InvocationTargetException e) {
throw unwrapInvocationTargetException(e);
}
}
@@ -172,14 +172,14 @@ public class ReflectionInvocationContext
private final Object[] args;
private final Object target;
- public Invocation(Object target, Method method, Object[] args) {
+ public Invocation(final Object target, final Method method, final Object[] args) {
this.target = target;
this.method = method;
this.args = args;
}
public Object invoke() throws Exception {
- Object value = method.invoke(target, args);
+ final Object value = method.invoke(target, args);
return value;
}
@@ -190,13 +190,13 @@ public class ReflectionInvocationContext
}
private static class BeanInvocation extends Invocation {
- public BeanInvocation(Object target, Method method, Object[] args) {
+ public BeanInvocation(final Object target, final Method method, final Object[] args) {
super(target, method, args);
}
}
private static class InterceptorInvocation extends Invocation {
- public InterceptorInvocation(Object target, Method method, InvocationContext invocationContext) {
+ public InterceptorInvocation(final Object target, final Method method, final InvocationContext invocationContext) {
super(target, method, new Object[] {invocationContext});
}
}
@@ -204,7 +204,7 @@ public class ReflectionInvocationContext
private static class LifecycleInvocation extends Invocation {
private final InvocationContext invocationContext;
- public LifecycleInvocation(Object target, Method method, InvocationContext invocationContext, Object[] args) {
+ public LifecycleInvocation(final Object target, final Method method, final InvocationContext invocationContext, final Object[] args) {
super(target, method, args);
this.invocationContext = invocationContext;
}
@@ -214,7 +214,7 @@ public class ReflectionInvocationContext
super.invoke();
// we need to call proceed so callbacks in subclasses get invoked
- Object value = invocationContext.proceed();
+ final Object value = invocationContext.proceed();
return value;
}
}
@@ -238,8 +238,8 @@ public class ReflectionInvocationContext
* @return the cause of the exception
* @throws AssertionError if the cause is not an Exception or Error.
*/
- private Exception unwrapInvocationTargetException(InvocationTargetException e) {
- Throwable cause = e.getCause();
+ private Exception unwrapInvocationTargetException(final InvocationTargetException e) {
+ final Throwable cause = e.getCause();
if (cause == null) {
return e;
} else if (cause instanceof Exception) {
@@ -252,7 +252,7 @@ public class ReflectionInvocationContext
}
public String toString() {
- String methodName = method != null ? method.getName(): null;
+ final String methodName = method != null ? method.getName(): null;
return "InvocationContext(operation=" + operation + ", target="+target.getClass().getName()+", method="+methodName+")";
}
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/BaseEjbProxyHandler.java Wed Feb 19 15:47:58 2014
@@ -460,7 +460,7 @@ public abstract class BaseEjbProxyHandle
String name = null;
try {
name = getProxyInfo().getInterface().getName();
- } catch (Exception e) {
+ } catch (final Exception e) {
//Ignore
}
return "proxy=" + name + ";deployment=" + this.deploymentID + ";pk=" + this.primaryKey;
@@ -482,7 +482,7 @@ public abstract class BaseEjbProxyHandle
}
try {
obj = ProxyManager.getInvocationHandler(obj);
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
return false;
}
if (this == obj) {
@@ -550,7 +550,7 @@ public abstract class BaseEjbProxyHandle
final ObjectOutputStream out = new ObjectOutputStream(baos);
out.writeObject(object);
out.close();
- } catch (NotSerializableException e) {
+ } catch (final NotSerializableException e) {
throw (IOException) new NotSerializableException(e.getMessage() +
" : The EJB specification restricts remote interfaces to only serializable data types. This can be disabled for in-vm use with the " +
OPENEJB_LOCALCOPY +
Modified: tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/ContextHandler.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/ContextHandler.java?rev=1569795&r1=1569794&r2=1569795&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/ContextHandler.java (original)
+++ tomee/tomee/trunk/container/openejb-core/src/main/java/org/apache/openejb/core/ivm/ContextHandler.java Wed Feb 19 15:47:58 2014
@@ -34,10 +34,10 @@ public class ContextHandler extends Cont
public Object lookup(final Name name) throws NamingException {
try {
return context.lookup(name);
- } catch (NameNotFoundException nnfe) {
+ } catch (final NameNotFoundException nnfe) {
try {
return SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup(name);
- } catch (NameNotFoundException nnfe2) {
+ } catch (final NameNotFoundException nnfe2) {
// ignore, let it be thrown
}
throw nnfe;
@@ -45,13 +45,13 @@ public class ContextHandler extends Cont
}
@Override
- public Object lookup(String name) throws NamingException {
+ public Object lookup(final String name) throws NamingException {
try {
return context.lookup(name);
- } catch (NameNotFoundException nnfe) {
+ } catch (final NameNotFoundException nnfe) {
try {
return SystemInstance.get().getComponent(ContainerSystem.class).getJNDIContext().lookup(name);
- } catch (NameNotFoundException nnfe2) {
+ } catch (final NameNotFoundException nnfe2) {
// ignore, let it be thrown
}
throw nnfe;