Drop deprecated dependencies on Log4j, JRuby, JExcel, Burlap, Commons Pool/DBCP

This commit also removes outdated support classes for Oracle, GlassFish, JBoss.

Issue: SPR-14429
This commit is contained in:
Juergen Hoeller
2016-07-05 15:46:53 +02:00
parent fb5a096ca2
commit 0fc0ce78ae
46 changed files with 24 additions and 4916 deletions

View File

@@ -1,81 +0,0 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.jca.work.glassfish;
import java.lang.reflect.Method;
import javax.resource.spi.work.WorkManager;
import org.springframework.jca.work.WorkManagerTaskExecutor;
import org.springframework.util.ReflectionUtils;
/**
* Spring TaskExecutor adapter for the GlassFish JCA WorkManager.
* Can be defined in web applications to make a TaskExecutor reference
* available, talking to the GlassFish WorkManager (thread pool) underneath.
*
* <p>This is the GlassFish equivalent of the CommonJ
* {@link org.springframework.scheduling.commonj.WorkManagerTaskExecutor}
* adapter for WebLogic and WebSphere.
*
* <p>Note: On GlassFish 4 and higher, a
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskExecutor}
* should be preferred, following JSR-236 support in Java EE 7.
*
* @author Juergen Hoeller
* @since 2.5.2
*/
public class GlassFishWorkManagerTaskExecutor extends WorkManagerTaskExecutor {
private static final String WORK_MANAGER_FACTORY_CLASS = "com.sun.enterprise.connectors.work.WorkManagerFactory";
private final Method getWorkManagerMethod;
public GlassFishWorkManagerTaskExecutor() {
try {
Class<?> wmf = getClass().getClassLoader().loadClass(WORK_MANAGER_FACTORY_CLASS);
this.getWorkManagerMethod = wmf.getMethod("getWorkManager", String.class);
}
catch (Exception ex) {
throw new IllegalStateException(
"Could not initialize GlassFishWorkManagerTaskExecutor because GlassFish API is not available", ex);
}
}
/**
* Identify a specific GlassFish thread pool to talk to.
* <p>The thread pool name matches the resource adapter name
* in default RAR deployment scenarios.
*/
public void setThreadPoolName(String threadPoolName) {
WorkManager wm = (WorkManager) ReflectionUtils.invokeMethod(this.getWorkManagerMethod, null, threadPoolName);
if (wm == null) {
throw new IllegalArgumentException("Specified thread pool name '" + threadPoolName +
"' does not correspond to an actual pool definition in GlassFish. Check your configuration!");
}
setWorkManager(wm);
}
/**
* Obtains GlassFish's default thread pool.
*/
@Override
protected WorkManager getDefaultWorkManager() {
return (WorkManager) ReflectionUtils.invokeMethod(this.getWorkManagerMethod, null, new Object[] {null});
}
}

View File

@@ -1,5 +0,0 @@
/**
* Convenience package for obtaining a GlassFish JCA WorkManager for use in
* web applications. Provides a Spring TaskExecutor adapter for GlassFish.
*/
package org.springframework.jca.work.glassfish;

View File

@@ -1,67 +0,0 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.jca.work.jboss;
import javax.resource.spi.work.WorkManager;
import org.springframework.jca.work.WorkManagerTaskExecutor;
/**
* Spring TaskExecutor adapter for the JBoss JCA WorkManager.
* Can be defined in web applications to make a TaskExecutor reference
* available, talking to the JBoss WorkManager (thread pool) underneath.
*
* <p>This is the JBoss equivalent of the CommonJ
* {@link org.springframework.scheduling.commonj.WorkManagerTaskExecutor}
* adapter for WebLogic and WebSphere.
*
* <p>This class does not work on JBoss 7 or higher. There is no known
* immediate replacement, since JBoss does not want its JCA WorkManager
* to be exposed anymore. As of JBoss/WildFly 8, a
* {@link org.springframework.scheduling.concurrent.DefaultManagedTaskExecutor}
* may be used, following JSR-236 support in Java EE 7.
*
* @author Juergen Hoeller
* @since 2.5.2
* @see org.jboss.resource.work.JBossWorkManagerMBean
* @deprecated as of Spring 4.0, since there are no fully supported versions
* of JBoss that this class works with anymore
*/
@Deprecated
public class JBossWorkManagerTaskExecutor extends WorkManagerTaskExecutor {
/**
* Identify a specific JBossWorkManagerMBean to talk to,
* through its JMX object name.
* <p>The default MBean name is "jboss.jca:service=WorkManager".
* @see JBossWorkManagerUtils#getWorkManager(String)
*/
public void setWorkManagerMBeanName(String mbeanName) {
setWorkManager(JBossWorkManagerUtils.getWorkManager(mbeanName));
}
/**
* Obtains the default JBoss JCA WorkManager through a JMX lookup
* for the JBossWorkManagerMBean.
* @see JBossWorkManagerUtils#getWorkManager()
*/
@Override
protected WorkManager getDefaultWorkManager() {
return JBossWorkManagerUtils.getWorkManager();
}
}

View File

@@ -1,79 +0,0 @@
/*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.jca.work.jboss;
import java.lang.reflect.Method;
import javax.management.MBeanServerConnection;
import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
import javax.naming.InitialContext;
import javax.resource.spi.work.WorkManager;
import org.springframework.util.Assert;
/**
* Utility class for obtaining the JBoss JCA WorkManager,
* typically for use in web applications.
*
* @author Juergen Hoeller
* @since 2.5.2
* @deprecated as of Spring 4.0, since there are no fully supported versions
* of JBoss that this class works with anymore
*/
@Deprecated
public abstract class JBossWorkManagerUtils {
private static final String JBOSS_WORK_MANAGER_MBEAN_CLASS_NAME = "org.jboss.resource.work.JBossWorkManagerMBean";
private static final String MBEAN_SERVER_CONNECTION_JNDI_NAME = "jmx/invoker/RMIAdaptor";
private static final String DEFAULT_WORK_MANAGER_MBEAN_NAME = "jboss.jca:service=WorkManager";
/**
* Obtain the default JBoss JCA WorkManager through a JMX lookup
* for the default JBossWorkManagerMBean.
* @see org.jboss.resource.work.JBossWorkManagerMBean
*/
public static WorkManager getWorkManager() {
return getWorkManager(DEFAULT_WORK_MANAGER_MBEAN_NAME);
}
/**
* Obtain the default JBoss JCA WorkManager through a JMX lookup
* for the JBossWorkManagerMBean.
* @param mbeanName the JMX object name to use
* @see org.jboss.resource.work.JBossWorkManagerMBean
*/
public static WorkManager getWorkManager(String mbeanName) {
Assert.hasLength(mbeanName, "JBossWorkManagerMBean name must not be empty");
try {
Class<?> mbeanClass = JBossWorkManagerUtils.class.getClassLoader().loadClass(JBOSS_WORK_MANAGER_MBEAN_CLASS_NAME);
InitialContext jndiContext = new InitialContext();
MBeanServerConnection mconn = (MBeanServerConnection) jndiContext.lookup(MBEAN_SERVER_CONNECTION_JNDI_NAME);
ObjectName objectName = ObjectName.getInstance(mbeanName);
Object workManagerMBean = MBeanServerInvocationHandler.newProxyInstance(mconn, objectName, mbeanClass, false);
Method getInstanceMethod = workManagerMBean.getClass().getMethod("getInstance");
return (WorkManager) getInstanceMethod.invoke(workManagerMBean);
}
catch (Exception ex) {
throw new IllegalStateException(
"Could not initialize JBossWorkManagerTaskExecutor because JBoss API is not available", ex);
}
}
}

View File

@@ -1,5 +0,0 @@
/**
* Convenience package for obtaining a JBoss JCA WorkManager for use in
* web applications. Provides a Spring TaskExecutor adapter for JBoss.
*/
package org.springframework.jca.work.jboss;