Skip to content

Commit

Permalink
Merge pull request #504 from dmatej/Payara-issue-502.2
Browse files Browse the repository at this point in the history
Payara issue 502.2
  • Loading branch information
smillidge committed Dec 11, 2015
2 parents c8494ef + 0846d19 commit d3023b3
Show file tree
Hide file tree
Showing 55 changed files with 1,624 additions and 1,707 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2015] [C2B2 Consulting Limited]

package com.sun.enterprise.container.common.impl;

Expand All @@ -54,7 +55,6 @@
import org.glassfish.internal.api.Globals;
import org.jvnet.hk2.annotations.Service;

import javax.ejb.EJBException;
import static javax.persistence.SynchronizationType.SYNCHRONIZED;
import static javax.persistence.SynchronizationType.UNSYNCHRONIZED;
import javax.persistence.criteria.*;
Expand Down Expand Up @@ -83,7 +83,7 @@
*/
public class EntityManagerWrapper implements EntityManager, Serializable {

static Logger _logger=LogDomains.getLogger(EntityManagerWrapper.class, LogDomains.UTIL_LOGGER);
static Logger _logger=LogDomains.getLogger(EntityManagerWrapper.class, LogDomains.UTIL_LOGGER, false);

// Serializable state

Expand Down Expand Up @@ -255,7 +255,7 @@ private JavaEETransaction getCurrentTransaction() {
private EntityManager getNonTxEMFromCurrentInvocation() {
// We store nonTxEM as a payload in a map from EMF to EM inside current invocation.
// It will be closed during NonTxEntityManagerCleaner.beforePostInvoke() below

ComponentInvocation currentInvocation = invMgr.getCurrentInvocation();
Map<EntityManagerFactory, EntityManager> nonTxEMs = getNonTxEMsFromCurrentInvocation(currentInvocation);
if(nonTxEMs == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2015] [C2B2 Consulting Limited]

package com.sun.enterprise.container.common.impl.managedbean;

Expand Down Expand Up @@ -95,7 +96,7 @@
public class ManagedBeanManagerImpl implements ManagedBeanManager, PostConstruct, EventListener {

private static final Logger _logger = LogDomains.getLogger(ManagedBeanManagerImpl.class,
LogDomains.CORE_LOGGER);
LogDomains.CORE_LOGGER, false);

@Inject
private ComponentEnvManager compEnvManager;
Expand Down Expand Up @@ -130,7 +131,7 @@ public void postConstruct() {
}

public void event(Event event) {

if (event.is(Deployment.APPLICATION_LOADED) ) {
ApplicationInfo info = Deployment.APPLICATION_LOADED.getHook(event);

Expand All @@ -139,7 +140,7 @@ public void event(Event event) {
registerAppLevelDependencies(info);

} else if( event.is(Deployment.APPLICATION_UNLOADED) ) {

ApplicationInfo info = Deployment.APPLICATION_UNLOADED.getHook(event);
Application app = info.getMetaData(Application.class);

Expand Down Expand Up @@ -206,7 +207,7 @@ private void loadManagedBeans(ApplicationInfo appInfo) {

loadManagedBeans(app);
}

public void loadManagedBeans(Application app) {

JCDIService jcdiService = habitat.getService(JCDIService.class);
Expand All @@ -226,7 +227,7 @@ public void loadManagedBeans(Application app) {

try {

// TODO Should move this to regular DOL processing stage
// TODO Should move this to regular DOL processing stage
if( validationRequired ) {
next.validate();
}
Expand All @@ -239,7 +240,7 @@ public void loadManagedBeans(Application app) {
interceptorInfo.setTargetClass(targetClass);
interceptorInfo.setInterceptorClassNames(interceptorClasses);
interceptorInfo.setAroundConstructInterceptors
(next.getAroundConstructCallbackInterceptors(targetClass,
(next.getAroundConstructCallbackInterceptors(targetClass,
getConstructor(targetClass, isCDIBundle)));
interceptorInfo.setPostConstructInterceptors
(next.getCallbackInterceptors(LifecycleCallbackDescriptor.CallbackType.POST_CONSTRUCT));
Expand Down Expand Up @@ -320,7 +321,7 @@ public Object getManagedBean(String globalJndiName) throws Exception {

}

return managedBean;
return managedBean;
}

/**
Expand Down Expand Up @@ -377,7 +378,7 @@ public void unloadManagedBeans(Application app) {
_logger.log(Level.FINE, "Managed bean " + next.getBeanClassName() + " PreDestroy", e);
}

}
}

com.sun.enterprise.container.common.spi.util.ComponentEnvManager compEnvManager =
habitat.getService(com.sun.enterprise.container.common.spi.util.ComponentEnvManager.class);
Expand Down Expand Up @@ -477,7 +478,7 @@ public <T> T createManagedBean(ManagedBeanDescriptor desc, Class<T> managedBeanC
}

T callerObject = null;

if( (jcdiService != null) && jcdiService.isJCDIEnabled(bundleDescriptor)) {

// Have 299 create, inject, and call PostConstruct on managed bean
Expand Down Expand Up @@ -691,12 +692,12 @@ public java.lang.Object run() throws Exception {

ManagedBeanDescriptor desc = bundle.getManagedBeanByBeanClass(
managedBeanInstance.getClass().getName());

if( desc == null ) {
throw new IllegalStateException("Could not retrieve managed bean descriptor for " +
managedBean + " of class " + managedBean.getClass());
}

InterceptorInvoker invoker = (InterceptorInvoker)
desc.getSupportingInfoForBeanInstance(managedBeanInstance);

Expand All @@ -707,7 +708,7 @@ public java.lang.Object run() throws Exception {
}

desc.clearBeanInstanceInfo(managedBeanInstance);
}
}
}

private BundleDescriptor getBundle() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2015] [C2B2 Consulting Limited]

package com.sun.enterprise.container.common.impl.util;

Expand Down Expand Up @@ -69,14 +70,14 @@ class GlassFishObjectInputStream extends ObjectInputStream
private ObjectInputOutputStreamFactory inputStreamHelper;

private Collection<GlassFishInputStreamHandler> handlers;

GlassFishObjectInputStream(Collection<GlassFishInputStreamHandler> handlers, InputStream in, ClassLoader appCl, boolean resolve)
throws IOException, StreamCorruptedException
{
super(in);
appLoader = appCl;
this.handlers = handlers;

if (resolve) {
enableResolveObject(resolve);

Expand All @@ -101,14 +102,14 @@ protected Object resolveObject(Object obj)
break;
}
}

return result;
}
} catch (IOException ioEx ) {
_logger.log(Level.SEVERE, "ejb.resolve_object_exception", ioEx);
_logger.log(Level.SEVERE, "Exception resolving object", ioEx);
throw ioEx;
} catch (Exception ex) {
_logger.log(Level.SEVERE, "ejb.resolve_object_exception", ex);
_logger.log(Level.SEVERE, "Exception resolving object", ex);
IOException ioe = new IOException();
ioe.initCause(ex);
throw ioe;
Expand Down Expand Up @@ -148,7 +149,7 @@ protected Class<?> resolveClass(ObjectStreamClass desc)
clazz = appLoader.loadClass(desc.getName());
} catch (ClassNotFoundException e) {

clazz = super.resolveClass(desc);
clazz = super.resolveClass(desc);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2015] [C2B2 Consulting Limited]

package com.sun.enterprise.container.common.impl.util;

import org.jvnet.hk2.annotations.Contract;
import javax.inject.Inject;
import org.jvnet.hk2.annotations.Service;
import org.glassfish.hk2.api.PostConstruct;
import org.glassfish.hk2.api.ServiceLocator;

import com.sun.enterprise.container.common.spi.util.GlassFishOutputStreamHandler;
Expand All @@ -60,19 +59,19 @@
/**
* A contract that defines a set of methods to serialize / deserialze Java EE
* objects (even if they are not directly serializable).
*
*
* Some of the objects that are expected to be serialized / de-serialized are a)
* Local EJB references b) EJB Handles c) JNDI (sub) contexts d) (Non
* serializable) StatefulSessionBeans
*
*
* @author Mahesh Kannan
*
*
*/
@Service
public class JavaEEIOUtilsImpl implements JavaEEIOUtils {

private static Logger _logger = LogDomains.getLogger(
JavaEEIOUtilsImpl.class, LogDomains.JNDI_LOGGER);
JavaEEIOUtilsImpl.class, LogDomains.JNDI_LOGGER, false);

@Inject
ServiceLocator habitat;
Expand Down
2 changes: 2 additions & 0 deletions appserver/connectors/connectors-runtime/osgi.bundle
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
# only if the new code is made subject to such option by the copyright
# holder.
#
// Portions Copyright [2015] [C2B2 Consulting Limited]

-exportcontents: \
com.sun.enterprise.connectors;\
Expand All @@ -48,6 +49,7 @@
com.sun.enterprise.resource.pool;\
com.sun.enterprise.resource.pool.waitqueue;\
com.sun.enterprise.resource.pool.monitor;\
com.sun.logging.enterprise.resource.resourceadapter;\
com.sun.enterprise.resource; version=${project.osgi.version}

# This module uses classes from this pkg using reflection, so
Expand Down
Loading

0 comments on commit d3023b3

Please sign in to comment.