Revert "Merge branch 'SPR-10130' into cleanup-master"
This reverts commit45fa50821a, reversing changes made toa312d900f8.
This commit is contained in:
@@ -73,12 +73,10 @@ public class PersistenceExceptionTranslationAdvisor extends AbstractPointcutAdvi
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
return this.advice;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this.pointcut;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,6 @@ public class PersistenceExceptionTranslationPostProcessor extends AbstractAdvisi
|
||||
this.repositoryAnnotationType = repositoryAnnotationType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
if (!(beanFactory instanceof ListableBeanFactory)) {
|
||||
throw new IllegalArgumentException(
|
||||
|
||||
@@ -53,7 +53,6 @@ public class ChainedPersistenceExceptionTranslator implements PersistenceExcepti
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DataAccessException translateExceptionIfPossible(RuntimeException ex) {
|
||||
for (PersistenceExceptionTranslator pet : this.delegates) {
|
||||
DataAccessException translatedDex = pet.translateExceptionIfPossible(ex);
|
||||
|
||||
@@ -39,7 +39,6 @@ public abstract class DaoSupport implements InitializingBean {
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
|
||||
@Override
|
||||
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException {
|
||||
// Let abstract subclasses check their configuration.
|
||||
checkDaoConfig();
|
||||
|
||||
@@ -107,7 +107,6 @@ public class PersistenceExceptionTranslationInterceptor
|
||||
this.alwaysTranslate = alwaysTranslate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
|
||||
if (this.persistenceExceptionTranslator == null) {
|
||||
// No explicit exception translator specified - perform autodetection.
|
||||
@@ -120,7 +119,6 @@ public class PersistenceExceptionTranslationInterceptor
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (this.persistenceExceptionTranslator == null) {
|
||||
throw new IllegalArgumentException("Property 'persistenceExceptionTranslator' is required");
|
||||
@@ -152,7 +150,6 @@ public class PersistenceExceptionTranslationInterceptor
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation mi) throws Throwable {
|
||||
try {
|
||||
return mi.proceed();
|
||||
|
||||
@@ -109,7 +109,6 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
||||
return this.connectionFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (getConnectionFactory() == null) {
|
||||
throw new IllegalArgumentException("Property 'connectionFactory' is required");
|
||||
@@ -117,7 +116,6 @@ public class CciLocalTransactionManager extends AbstractPlatformTransactionManag
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getResourceFactory() {
|
||||
return getConnectionFactory();
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@ public class DelegatingConnectionFactory implements ConnectionFactory, Initializ
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (getTargetConnectionFactory() == null) {
|
||||
throw new IllegalArgumentException("Property 'targetConnectionFactory' is required");
|
||||
@@ -68,32 +67,26 @@ public class DelegatingConnectionFactory implements ConnectionFactory, Initializ
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Connection getConnection() throws ResourceException {
|
||||
return getTargetConnectionFactory().getConnection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Connection getConnection(ConnectionSpec connectionSpec) throws ResourceException {
|
||||
return getTargetConnectionFactory().getConnection(connectionSpec);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecordFactory getRecordFactory() throws ResourceException {
|
||||
return getTargetConnectionFactory().getRecordFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceAdapterMetaData getMetaData() throws ResourceException {
|
||||
return getTargetConnectionFactory().getMetaData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Reference getReference() throws NamingException {
|
||||
return getTargetConnectionFactory().getReference();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReference(Reference reference) {
|
||||
getTargetConnectionFactory().setReference(reference);
|
||||
}
|
||||
|
||||
@@ -41,12 +41,10 @@ import javax.resource.cci.RecordFactory;
|
||||
*/
|
||||
public class NotSupportedRecordFactory implements RecordFactory {
|
||||
|
||||
@Override
|
||||
public MappedRecord createMappedRecord(String name) throws ResourceException {
|
||||
throw new NotSupportedException("The RecordFactory facility is not supported by the connector");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexedRecord createIndexedRecord(String name) throws ResourceException {
|
||||
throw new NotSupportedException("The RecordFactory facility is not supported by the connector");
|
||||
}
|
||||
|
||||
@@ -129,7 +129,6 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme
|
||||
* <p>As this bean implements DisposableBean, a bean factory will
|
||||
* automatically invoke this on destruction of its cached singletons.
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
resetConnection();
|
||||
}
|
||||
@@ -229,7 +228,6 @@ public class SingleConnectionFactory extends DelegatingConnectionFactory impleme
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
if (method.getName().equals("equals")) {
|
||||
// Only consider equal when proxies are identical.
|
||||
|
||||
@@ -128,7 +128,6 @@ public class TransactionAwareConnectionFactoryProxy extends DelegatingConnection
|
||||
this.connectionFactory = cf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
// Invocation on Connection interface coming in...
|
||||
|
||||
|
||||
@@ -187,7 +187,6 @@ public class CciTemplate implements CciOperations {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T> T execute(ConnectionCallback<T> action) throws DataAccessException {
|
||||
Assert.notNull(action, "Callback object must not be null");
|
||||
Connection con = ConnectionFactoryUtils.getConnection(getConnectionFactory(), getConnectionSpec());
|
||||
@@ -208,11 +207,9 @@ public class CciTemplate implements CciOperations {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T execute(final InteractionCallback<T> action) throws DataAccessException {
|
||||
Assert.notNull(action, "Callback object must not be null");
|
||||
return execute(new ConnectionCallback<T>() {
|
||||
@Override
|
||||
public T doInConnection(Connection connection, ConnectionFactory connectionFactory)
|
||||
throws ResourceException, SQLException, DataAccessException {
|
||||
Interaction interaction = connection.createInteraction();
|
||||
@@ -226,29 +223,24 @@ public class CciTemplate implements CciOperations {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Record execute(InteractionSpec spec, Record inputRecord) throws DataAccessException {
|
||||
return doExecute(spec, inputRecord, null, new SimpleRecordExtractor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(InteractionSpec spec, Record inputRecord, Record outputRecord) throws DataAccessException {
|
||||
doExecute(spec, inputRecord, outputRecord, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Record execute(InteractionSpec spec, RecordCreator inputCreator) throws DataAccessException {
|
||||
return doExecute(spec, createRecord(inputCreator), null, new SimpleRecordExtractor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T execute(InteractionSpec spec, Record inputRecord, RecordExtractor<T> outputExtractor)
|
||||
throws DataAccessException {
|
||||
|
||||
return doExecute(spec, inputRecord, null, outputExtractor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T execute(InteractionSpec spec, RecordCreator inputCreator, RecordExtractor<T> outputExtractor)
|
||||
throws DataAccessException {
|
||||
|
||||
@@ -271,7 +263,6 @@ public class CciTemplate implements CciOperations {
|
||||
final RecordExtractor<T> outputExtractor) throws DataAccessException {
|
||||
|
||||
return execute(new InteractionCallback<T>() {
|
||||
@Override
|
||||
public T doInInteraction(Interaction interaction, ConnectionFactory connectionFactory)
|
||||
throws ResourceException, SQLException, DataAccessException {
|
||||
Record outputRecordToUse = outputRecord;
|
||||
@@ -430,7 +421,6 @@ public class CciTemplate implements CciOperations {
|
||||
|
||||
private static class SimpleRecordExtractor implements RecordExtractor<Record> {
|
||||
|
||||
@Override
|
||||
public Record extractData(Record record) {
|
||||
return record;
|
||||
}
|
||||
|
||||
@@ -59,33 +59,27 @@ public class CommAreaRecord implements Record, Streamable {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setRecordName(String recordName) {
|
||||
this.recordName=recordName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecordName() {
|
||||
return recordName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecordShortDescription(String recordShortDescription) {
|
||||
this.recordShortDescription=recordShortDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecordShortDescription() {
|
||||
return recordShortDescription;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void read(InputStream in) throws IOException {
|
||||
this.bytes = FileCopyUtils.copyToByteArray(in);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(OutputStream out) throws IOException {
|
||||
out.write(this.bytes);
|
||||
out.flush();
|
||||
|
||||
@@ -82,7 +82,6 @@ public abstract class EisOperation implements InitializingBean {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
this.cciTemplate.afterPropertiesSet();
|
||||
|
||||
|
||||
@@ -129,7 +129,6 @@ public abstract class MappingRecordOperation extends EisOperation {
|
||||
this.inputObject = inObject;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Record createRecord(RecordFactory recordFactory) throws ResourceException, DataAccessException {
|
||||
return createInputRecord(recordFactory, this.inputObject);
|
||||
}
|
||||
@@ -142,7 +141,6 @@ public abstract class MappingRecordOperation extends EisOperation {
|
||||
*/
|
||||
protected class RecordExtractorImpl implements RecordExtractor {
|
||||
|
||||
@Override
|
||||
public Object extractData(Record record) throws ResourceException, SQLException, DataAccessException {
|
||||
return extractOutputData(record);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ class BootstrapContextAwareProcessor implements BeanPostProcessor {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||
if (this.bootstrapContext != null && bean instanceof BootstrapContextAware) {
|
||||
((BootstrapContextAware) bean).setBootstrapContext(this.bootstrapContext);
|
||||
@@ -54,7 +53,6 @@ class BootstrapContextAwareProcessor implements BeanPostProcessor {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||
return bean;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@ public class ResourceAdapterApplicationContext extends GenericApplicationContext
|
||||
|
||||
// JCA WorkManager resolved lazily - may not be available.
|
||||
beanFactory.registerResolvableDependency(WorkManager.class, new ObjectFactory<WorkManager>() {
|
||||
@Override
|
||||
public WorkManager getObject() {
|
||||
return bootstrapContext.getWorkManager();
|
||||
}
|
||||
|
||||
@@ -156,7 +156,6 @@ public class SpringContextResourceAdapter implements ResourceAdapter {
|
||||
* This implementation loads a Spring ApplicationContext through the
|
||||
* {@link #createApplicationContext} template method.
|
||||
*/
|
||||
@Override
|
||||
public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Starting SpringContextResourceAdapter with BootstrapContext: " + bootstrapContext);
|
||||
@@ -201,7 +200,6 @@ public class SpringContextResourceAdapter implements ResourceAdapter {
|
||||
/**
|
||||
* This implementation closes the Spring ApplicationContext.
|
||||
*/
|
||||
@Override
|
||||
public void stop() {
|
||||
logger.info("Stopping SpringContextResourceAdapter");
|
||||
this.applicationContext.close();
|
||||
@@ -211,7 +209,6 @@ public class SpringContextResourceAdapter implements ResourceAdapter {
|
||||
/**
|
||||
* This implementation always throws a NotSupportedException.
|
||||
*/
|
||||
@Override
|
||||
public void endpointActivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec)
|
||||
throws ResourceException {
|
||||
|
||||
@@ -221,14 +218,12 @@ public class SpringContextResourceAdapter implements ResourceAdapter {
|
||||
/**
|
||||
* This implementation does nothing.
|
||||
*/
|
||||
@Override
|
||||
public void endpointDeactivation(MessageEndpointFactory messageEndpointFactory, ActivationSpec activationSpec) {
|
||||
}
|
||||
|
||||
/**
|
||||
* This implementation always returns {@code null}.
|
||||
*/
|
||||
@Override
|
||||
public XAResource[] getXAResources(ActivationSpec[] activationSpecs) throws ResourceException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -123,7 +123,6 @@ public abstract class AbstractMessageEndpointFactory implements MessageEndpointF
|
||||
* @see #setTransactionManager
|
||||
* @see #setTransactionFactory
|
||||
*/
|
||||
@Override
|
||||
public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException {
|
||||
return (this.transactionFactory != null);
|
||||
}
|
||||
@@ -133,7 +132,6 @@ public abstract class AbstractMessageEndpointFactory implements MessageEndpointF
|
||||
* <p>This implementation delegates to {@link #createEndpointInternal()},
|
||||
* initializing the endpoint's XAResource before the endpoint gets invoked.
|
||||
*/
|
||||
@Override
|
||||
public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException {
|
||||
AbstractMessageEndpoint endpoint = createEndpointInternal();
|
||||
endpoint.initXAResource(xaResource);
|
||||
@@ -191,7 +189,6 @@ public abstract class AbstractMessageEndpointFactory implements MessageEndpointF
|
||||
* concrete endpoint method should call {@code beforeDelivery} and its
|
||||
* sibling {@link #afterDelivery()} explicitly, as part of its own processing.
|
||||
*/
|
||||
@Override
|
||||
public void beforeDelivery(Method method) throws ResourceException {
|
||||
this.beforeDeliveryCalled = true;
|
||||
try {
|
||||
@@ -239,7 +236,6 @@ public abstract class AbstractMessageEndpointFactory implements MessageEndpointF
|
||||
* to call this method after invoking the concrete endpoint. See the
|
||||
* explanation in {@link #beforeDelivery}'s javadoc.
|
||||
*/
|
||||
@Override
|
||||
public void afterDelivery() throws ResourceException {
|
||||
this.beforeDeliveryCalled = false;
|
||||
Thread.currentThread().setContextClassLoader(this.previousContextClassLoader);
|
||||
@@ -252,7 +248,6 @@ public abstract class AbstractMessageEndpointFactory implements MessageEndpointF
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
try {
|
||||
this.transactionDelegate.setRollbackOnly();
|
||||
|
||||
@@ -94,7 +94,6 @@ public class GenericMessageEndpointFactory extends AbstractMessageEndpointFactor
|
||||
*/
|
||||
private class GenericMessageEndpoint extends AbstractMessageEndpoint implements MethodInterceptor {
|
||||
|
||||
@Override
|
||||
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
|
||||
boolean applyDeliveryCalls = !hasBeforeDeliveryBeenCalled();
|
||||
if (applyDeliveryCalls) {
|
||||
|
||||
@@ -224,7 +224,6 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
|
||||
* Return the value for the 'autoStartup' property. If "true", this
|
||||
* endpoint manager will start upon a ContextRefreshedEvent.
|
||||
*/
|
||||
@Override
|
||||
public boolean isAutoStartup() {
|
||||
return this.autoStartup;
|
||||
}
|
||||
@@ -243,7 +242,6 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
|
||||
/**
|
||||
* Return the phase in which this endpoint manager will be started and stopped.
|
||||
*/
|
||||
@Override
|
||||
public int getPhase() {
|
||||
return this.phase;
|
||||
}
|
||||
@@ -252,7 +250,6 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
|
||||
* Prepares the message endpoint, and automatically activates it
|
||||
* if the "autoStartup" flag is set to "true".
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() throws ResourceException {
|
||||
if (getResourceAdapter() == null) {
|
||||
throw new IllegalArgumentException("Property 'resourceAdapter' is required");
|
||||
@@ -277,7 +274,6 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
|
||||
/**
|
||||
* Activates the configured message endpoint.
|
||||
*/
|
||||
@Override
|
||||
public void start() {
|
||||
synchronized (this.lifecycleMonitor) {
|
||||
if (!this.running) {
|
||||
@@ -295,7 +291,6 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
|
||||
/**
|
||||
* Deactivates the configured message endpoint.
|
||||
*/
|
||||
@Override
|
||||
public void stop() {
|
||||
synchronized (this.lifecycleMonitor) {
|
||||
if (this.running) {
|
||||
@@ -305,7 +300,6 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(Runnable callback) {
|
||||
synchronized (this.lifecycleMonitor) {
|
||||
this.stop();
|
||||
@@ -316,7 +310,6 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
|
||||
/**
|
||||
* Return whether the configured message endpoint is currently active.
|
||||
*/
|
||||
@Override
|
||||
public boolean isRunning() {
|
||||
synchronized (this.lifecycleMonitor) {
|
||||
return this.running;
|
||||
@@ -326,7 +319,6 @@ public class GenericMessageEndpointManager implements SmartLifecycle, Initializi
|
||||
/**
|
||||
* Deactivates the message endpoint, preparing it for shutdown.
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
stop();
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ public class LocalConnectionFactoryBean implements FactoryBean<Object>, Initiali
|
||||
this.connectionManager = connectionManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws ResourceException {
|
||||
if (this.managedConnectionFactory == null) {
|
||||
throw new IllegalArgumentException("Property 'managedConnectionFactory' is required");
|
||||
@@ -123,17 +122,14 @@ public class LocalConnectionFactoryBean implements FactoryBean<Object>, Initiali
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getObject() {
|
||||
return this.connectionFactory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getObjectType() {
|
||||
return (this.connectionFactory != null ? this.connectionFactory.getClass() : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,6 @@ public class ResourceAdapterFactoryBean implements FactoryBean<ResourceAdapter>,
|
||||
* Builds the BootstrapContext and starts the ResourceAdapter with it.
|
||||
* @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext)
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() throws ResourceException {
|
||||
if (this.resourceAdapter == null) {
|
||||
throw new IllegalArgumentException("'resourceAdapter' or 'resourceAdapterClass' is required");
|
||||
@@ -125,17 +124,14 @@ public class ResourceAdapterFactoryBean implements FactoryBean<ResourceAdapter>,
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResourceAdapter getObject() {
|
||||
return this.resourceAdapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends ResourceAdapter> getObjectType() {
|
||||
return (this.resourceAdapter != null ? this.resourceAdapter.getClass() : ResourceAdapter.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
@@ -145,7 +141,6 @@ public class ResourceAdapterFactoryBean implements FactoryBean<ResourceAdapter>,
|
||||
* Stops the ResourceAdapter.
|
||||
* @see javax.resource.spi.ResourceAdapter#stop()
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.resourceAdapter.stop();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ public class SimpleBootstrapContext implements BootstrapContext {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WorkManager getWorkManager() {
|
||||
if (this.workManager == null) {
|
||||
throw new IllegalStateException("No WorkManager available");
|
||||
@@ -70,12 +69,10 @@ public class SimpleBootstrapContext implements BootstrapContext {
|
||||
return this.workManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public XATerminator getXATerminator() {
|
||||
return this.xaTerminator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Timer createTimer() throws UnavailableException {
|
||||
return new Timer();
|
||||
}
|
||||
|
||||
@@ -53,7 +53,6 @@ public class DelegatingWork implements Work {
|
||||
/**
|
||||
* Delegates execution to the underlying Runnable.
|
||||
*/
|
||||
@Override
|
||||
public void run() {
|
||||
this.delegate.run();
|
||||
}
|
||||
@@ -62,7 +61,6 @@ public class DelegatingWork implements Work {
|
||||
* This implementation is empty, since we expect the Runnable
|
||||
* to terminate based on some specific shutdown signal.
|
||||
*/
|
||||
@Override
|
||||
public void release() {
|
||||
}
|
||||
|
||||
|
||||
@@ -88,12 +88,10 @@ public class SimpleTaskWorkManager implements WorkManager {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void doWork(Work work) throws WorkException {
|
||||
doWork(work, WorkManager.INDEFINITE, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWork(Work work, long startTimeout, ExecutionContext executionContext, WorkListener workListener)
|
||||
throws WorkException {
|
||||
|
||||
@@ -101,12 +99,10 @@ public class SimpleTaskWorkManager implements WorkManager {
|
||||
executeWork(this.syncTaskExecutor, work, startTimeout, false, executionContext, workListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long startWork(Work work) throws WorkException {
|
||||
return startWork(work, WorkManager.INDEFINITE, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long startWork(Work work, long startTimeout, ExecutionContext executionContext, WorkListener workListener)
|
||||
throws WorkException {
|
||||
|
||||
@@ -114,12 +110,10 @@ public class SimpleTaskWorkManager implements WorkManager {
|
||||
return executeWork(this.asyncTaskExecutor, work, startTimeout, true, executionContext, workListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleWork(Work work) throws WorkException {
|
||||
scheduleWork(work, WorkManager.INDEFINITE, null, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleWork(Work work, long startTimeout, ExecutionContext executionContext, WorkListener workListener)
|
||||
throws WorkException {
|
||||
|
||||
@@ -225,7 +219,6 @@ public class SimpleTaskWorkManager implements WorkManager {
|
||||
this.acceptOnExecution = acceptOnExecution;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (this.acceptOnExecution) {
|
||||
this.workListener.workAccepted(new WorkEvent(this, WorkEvent.WORK_ACCEPTED, work, null));
|
||||
@@ -251,7 +244,6 @@ public class SimpleTaskWorkManager implements WorkManager {
|
||||
this.workListener.workCompleted(new WorkEvent(this, WorkEvent.WORK_COMPLETED, this.work, null));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
this.work.release();
|
||||
}
|
||||
|
||||
@@ -122,7 +122,6 @@ public class WorkManagerTaskExecutor extends JndiLocatorSupport
|
||||
* Specify the JCA BootstrapContext that contains the
|
||||
* WorkManager to delegate to.
|
||||
*/
|
||||
@Override
|
||||
public void setBootstrapContext(BootstrapContext bootstrapContext) {
|
||||
Assert.notNull(bootstrapContext, "BootstrapContext must not be null");
|
||||
this.workManager = bootstrapContext.getWorkManager();
|
||||
@@ -161,7 +160,6 @@ public class WorkManagerTaskExecutor extends JndiLocatorSupport
|
||||
this.workListener = workListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws NamingException {
|
||||
if (this.workManager == null) {
|
||||
if (this.workManagerName != null) {
|
||||
@@ -188,12 +186,10 @@ public class WorkManagerTaskExecutor extends JndiLocatorSupport
|
||||
// Implementation of the Spring SchedulingTaskExecutor interface
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void execute(Runnable task) {
|
||||
execute(task, TIMEOUT_INDEFINITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(Runnable task, long startTimeout) {
|
||||
Assert.state(this.workManager != null, "No WorkManager specified");
|
||||
Work work = new DelegatingWork(task);
|
||||
@@ -236,14 +232,12 @@ public class WorkManagerTaskExecutor extends JndiLocatorSupport
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Future<?> submit(Runnable task) {
|
||||
FutureTask<Object> future = new FutureTask<Object>(task, null);
|
||||
execute(future, TIMEOUT_INDEFINITE);
|
||||
return future;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> Future<T> submit(Callable<T> task) {
|
||||
FutureTask<T> future = new FutureTask<T>(task);
|
||||
execute(future, TIMEOUT_INDEFINITE);
|
||||
@@ -253,7 +247,6 @@ public class WorkManagerTaskExecutor extends JndiLocatorSupport
|
||||
/**
|
||||
* This task executor prefers short-lived work units.
|
||||
*/
|
||||
@Override
|
||||
public boolean prefersShortLivedTasks() {
|
||||
return true;
|
||||
}
|
||||
@@ -263,36 +256,30 @@ public class WorkManagerTaskExecutor extends JndiLocatorSupport
|
||||
// Implementation of the JCA WorkManager interface
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void doWork(Work work) throws WorkException {
|
||||
this.workManager.doWork(work);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doWork(Work work, long delay, ExecutionContext executionContext, WorkListener workListener)
|
||||
throws WorkException {
|
||||
|
||||
this.workManager.doWork(work, delay, executionContext, workListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long startWork(Work work) throws WorkException {
|
||||
return this.workManager.startWork(work);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long startWork(Work work, long delay, ExecutionContext executionContext, WorkListener workListener)
|
||||
throws WorkException {
|
||||
|
||||
return this.workManager.startWork(work, delay, executionContext, workListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleWork(Work work) throws WorkException {
|
||||
this.workManager.scheduleWork(work);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void scheduleWork(Work work, long delay, ExecutionContext executionContext, WorkListener workListener)
|
||||
throws WorkException {
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ public abstract class AbstractTransactionManagementConfiguration implements Impo
|
||||
protected AnnotationAttributes enableTx;
|
||||
protected PlatformTransactionManager txManager;
|
||||
|
||||
@Override
|
||||
public void setImportMetadata(AnnotationMetadata importMetadata) {
|
||||
this.enableTx = AnnotationAttributes.fromMap(
|
||||
importMetadata.getAnnotationAttributes(EnableTransactionManagement.class.getName(), false));
|
||||
|
||||
@@ -34,7 +34,6 @@ import org.springframework.transaction.interceptor.TransactionAttribute;
|
||||
@SuppressWarnings("serial")
|
||||
public class Ejb3TransactionAnnotationParser implements TransactionAnnotationParser, Serializable {
|
||||
|
||||
@Override
|
||||
public TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae) {
|
||||
javax.ejb.TransactionAttribute ann = ae.getAnnotation(javax.ejb.TransactionAttribute.class);
|
||||
if (ann != null) {
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.springframework.transaction.interceptor.TransactionAttribute;
|
||||
@SuppressWarnings("serial")
|
||||
public class SpringTransactionAnnotationParser implements TransactionAnnotationParser, Serializable {
|
||||
|
||||
@Override
|
||||
public TransactionAttribute parseTransactionAnnotation(AnnotatedElement ae) {
|
||||
Transactional ann = AnnotationUtils.getAnnotation(ae, Transactional.class);
|
||||
if (ann != null) {
|
||||
|
||||
@@ -73,7 +73,6 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
|
||||
* {@link AopNamespaceUtils#registerAutoProxyCreatorIfNecessary register an AutoProxyCreator}
|
||||
* with the container as necessary.
|
||||
*/
|
||||
@Override
|
||||
public BeanDefinition parse(Element element, ParserContext parserContext) {
|
||||
String mode = element.getAttribute("mode");
|
||||
if ("aspectj".equals(mode)) {
|
||||
|
||||
@@ -50,7 +50,6 @@ public class TxNamespaceHandler extends NamespaceHandlerSupport {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
registerBeanDefinitionParser("advice", new TxAdviceBeanDefinitionParser());
|
||||
registerBeanDefinitionParser("annotation-driven", new AnnotationDrivenBeanDefinitionParser());
|
||||
|
||||
@@ -80,7 +80,6 @@ public abstract class AbstractFallbackTransactionAttributeSource implements Tran
|
||||
* @return TransactionAttribute for this method, or {@code null} if the method
|
||||
* is not transactional
|
||||
*/
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
// First, see if we have a cached value.
|
||||
Object cacheKey = getCacheKey(method, targetClass);
|
||||
|
||||
@@ -61,7 +61,6 @@ public class BeanFactoryTransactionAttributeSourceAdvisor extends AbstractBeanFa
|
||||
this.pointcut.setClassFilter(classFilter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this.pointcut;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,6 @@ public class CompositeTransactionAttributeSource implements TransactionAttribute
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
for (TransactionAttributeSource tas : this.transactionAttributeSources) {
|
||||
TransactionAttribute ta = tas.getTransactionAttribute(method, targetClass);
|
||||
|
||||
@@ -82,7 +82,6 @@ public class DefaultTransactionAttribute extends DefaultTransactionDefinition im
|
||||
/**
|
||||
* Return a qualifier value associated with this transaction attribute.
|
||||
*/
|
||||
@Override
|
||||
public String getQualifier() {
|
||||
return this.qualifier;
|
||||
}
|
||||
@@ -92,7 +91,6 @@ public class DefaultTransactionAttribute extends DefaultTransactionDefinition im
|
||||
* Additionally attempt to rollback on Error.
|
||||
* <p>This is consistent with TransactionTemplate's default behavior.
|
||||
*/
|
||||
@Override
|
||||
public boolean rollbackOn(Throwable ex) {
|
||||
return (ex instanceof RuntimeException || ex instanceof Error);
|
||||
}
|
||||
|
||||
@@ -46,12 +46,10 @@ public abstract class DelegatingTransactionAttribute extends DelegatingTransacti
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getQualifier() {
|
||||
return this.targetAttribute.getQualifier();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rollbackOn(Throwable ex) {
|
||||
return this.targetAttribute.rollbackOn(ex);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class MatchAlwaysTransactionAttributeSource implements TransactionAttribu
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
return this.transactionAttribute;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,6 @@ public class MethodMapTransactionAttributeSource
|
||||
this.methodMap = methodMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = beanClassLoader;
|
||||
}
|
||||
@@ -92,7 +91,6 @@ public class MethodMapTransactionAttributeSource
|
||||
* {@link #setMethodMap(java.util.Map) "methodMap"}, if any.
|
||||
* @see #initMethodMap(java.util.Map)
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
initMethodMap(this.methodMap);
|
||||
this.eagerlyInitialized = true;
|
||||
@@ -206,7 +204,6 @@ public class MethodMapTransactionAttributeSource
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
if (this.eagerlyInitialized) {
|
||||
return this.transactionAttributeMap.get(method);
|
||||
|
||||
@@ -98,7 +98,6 @@ public class NameMatchTransactionAttributeSource implements TransactionAttribute
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public TransactionAttribute getTransactionAttribute(Method method, Class<?> targetClass) {
|
||||
// look for direct name match
|
||||
String methodName = method.getName();
|
||||
|
||||
@@ -206,7 +206,6 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
|
||||
/**
|
||||
* Set the BeanFactory to use for retrieving PlatformTransactionManager beans.
|
||||
*/
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
}
|
||||
@@ -221,7 +220,6 @@ public abstract class TransactionAspectSupport implements BeanFactoryAware, Init
|
||||
/**
|
||||
* Check that required properties were set.
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (this.transactionManager == null && this.beanFactory == null) {
|
||||
throw new IllegalStateException(
|
||||
|
||||
@@ -79,12 +79,10 @@ public class TransactionAttributeSourceAdvisor extends AbstractPointcutAdvisor {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Advice getAdvice() {
|
||||
return this.transactionInterceptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pointcut getPointcut() {
|
||||
return this.pointcut;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ import org.springframework.util.ObjectUtils;
|
||||
@SuppressWarnings("serial")
|
||||
abstract class TransactionAttributeSourcePointcut extends StaticMethodMatcherPointcut implements Serializable {
|
||||
|
||||
@Override
|
||||
public boolean matches(Method method, Class targetClass) {
|
||||
TransactionAttributeSource tas = getTransactionAttributeSource();
|
||||
return (tas == null || tas.getTransactionAttribute(method, targetClass) != null);
|
||||
|
||||
@@ -88,7 +88,6 @@ public class TransactionInterceptor extends TransactionAspectSupport implements
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object invoke(final MethodInvocation invocation) throws Throwable {
|
||||
// Work out the target class: may be {@code null}.
|
||||
// The TransactionAttributeSource should be passed the target class
|
||||
@@ -127,7 +126,6 @@ public class TransactionInterceptor extends TransactionAspectSupport implements
|
||||
try {
|
||||
Object result = ((CallbackPreferringPlatformTransactionManager) tm).execute(txAttr,
|
||||
new TransactionCallback<Object>() {
|
||||
@Override
|
||||
public Object doInTransaction(TransactionStatus status) {
|
||||
TransactionInfo txInfo = prepareTransactionInfo(tm, txAttr, joinpointIdentification, status);
|
||||
try {
|
||||
|
||||
@@ -180,7 +180,6 @@ public class TransactionProxyFactoryBean extends AbstractSingletonProxyFactoryBe
|
||||
* @see org.springframework.beans.factory.BeanFactoryUtils#beanOfTypeIncludingAncestors
|
||||
* @see org.springframework.transaction.PlatformTransactionManager
|
||||
*/
|
||||
@Override
|
||||
public void setBeanFactory(BeanFactory beanFactory) {
|
||||
this.transactionInterceptor.setBeanFactory(beanFactory);
|
||||
}
|
||||
|
||||
@@ -49,11 +49,9 @@ public class JtaAfterCompletionSynchronization implements Synchronization {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void beforeCompletion() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(int status) {
|
||||
switch (status) {
|
||||
case Status.STATUS_COMMITTED:
|
||||
|
||||
@@ -410,7 +410,6 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
||||
* Initialize the UserTransaction as well as the TransactionManager handle.
|
||||
* @see #initUserTransactionAndTransactionManager()
|
||||
*/
|
||||
@Override
|
||||
public void afterPropertiesSet() throws TransactionSystemException {
|
||||
initUserTransactionAndTransactionManager();
|
||||
checkUserTransactionAndTransactionManager();
|
||||
@@ -1165,7 +1164,6 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
||||
// Implementation of TransactionFactory interface
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException {
|
||||
TransactionManager tm = getTransactionManager();
|
||||
Assert.state(tm != null, "No JTA TransactionManager available");
|
||||
@@ -1176,7 +1174,6 @@ public class JtaTransactionManager extends AbstractPlatformTransactionManager
|
||||
return new ManagedTransactionAdapter(tm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsResourceAdapterManagedTransactions() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -60,7 +60,6 @@ public class JtaTransactionObject implements SmartTransactionObject {
|
||||
/**
|
||||
* This implementation checks the UserTransaction's rollback-only flag.
|
||||
*/
|
||||
@Override
|
||||
public boolean isRollbackOnly() {
|
||||
if (this.userTransaction == null) {
|
||||
return false;
|
||||
@@ -79,7 +78,6 @@ public class JtaTransactionObject implements SmartTransactionObject {
|
||||
* assuming that they will flush all affected ORM sessions.
|
||||
* @see org.springframework.transaction.support.TransactionSynchronization#flush()
|
||||
*/
|
||||
@Override
|
||||
public void flush() {
|
||||
TransactionSynchronizationUtils.triggerFlush();
|
||||
}
|
||||
|
||||
@@ -57,38 +57,31 @@ public class ManagedTransactionAdapter implements Transaction {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
|
||||
SecurityException, SystemException {
|
||||
this.transactionManager.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rollback() throws SystemException {
|
||||
this.transactionManager.rollback();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRollbackOnly() throws SystemException {
|
||||
this.transactionManager.setRollbackOnly();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatus() throws SystemException {
|
||||
return this.transactionManager.getStatus();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean enlistResource(XAResource xaRes) throws RollbackException, SystemException {
|
||||
return this.transactionManager.getTransaction().enlistResource(xaRes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delistResource(XAResource xaRes, int flag) throws SystemException {
|
||||
return this.transactionManager.getTransaction().delistResource(xaRes, flag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSynchronization(Synchronization sync) throws RollbackException, SystemException {
|
||||
this.transactionManager.getTransaction().registerSynchronization(sync);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,6 @@ public class SimpleTransactionFactory implements TransactionFactory {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Transaction createTransaction(String name, int timeout) throws NotSupportedException, SystemException {
|
||||
if (timeout >= 0) {
|
||||
this.transactionManager.setTransactionTimeout(timeout);
|
||||
@@ -59,7 +58,6 @@ public class SimpleTransactionFactory implements TransactionFactory {
|
||||
return new ManagedTransactionAdapter(this.transactionManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsResourceAdapterManagedTransactions() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,6 @@ public class SpringJtaSynchronizationAdapter implements Synchronization {
|
||||
* <p>In case of an exception, the JTA transaction will be marked as rollback-only.
|
||||
* @see org.springframework.transaction.support.TransactionSynchronization#beforeCommit
|
||||
*/
|
||||
@Override
|
||||
public void beforeCompletion() {
|
||||
try {
|
||||
boolean readOnly = TransactionSynchronizationManager.isCurrentTransactionReadOnly();
|
||||
@@ -169,7 +168,6 @@ public class SpringJtaSynchronizationAdapter implements Synchronization {
|
||||
* @see org.springframework.transaction.support.TransactionSynchronization#beforeCompletion
|
||||
* @see org.springframework.transaction.support.TransactionSynchronization#afterCompletion
|
||||
*/
|
||||
@Override
|
||||
public void afterCompletion(int status) {
|
||||
if (!this.beforeCompletionCalled) {
|
||||
// beforeCompletion not called before (probably because of JTA rollback).
|
||||
|
||||
@@ -65,34 +65,28 @@ public class UserTransactionAdapter implements UserTransaction {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setTransactionTimeout(int timeout) throws SystemException {
|
||||
this.transactionManager.setTransactionTimeout(timeout);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void begin() throws NotSupportedException, SystemException {
|
||||
this.transactionManager.begin();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void commit()
|
||||
throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
|
||||
SecurityException, SystemException {
|
||||
this.transactionManager.commit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void rollback() throws SecurityException, SystemException {
|
||||
this.transactionManager.rollback();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRollbackOnly() throws SystemException {
|
||||
this.transactionManager.setRollbackOnly();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getStatus() throws SystemException {
|
||||
return this.transactionManager.getStatus();
|
||||
}
|
||||
|
||||
@@ -211,7 +211,6 @@ public class WebSphereUowTransactionManager extends JtaTransactionManager
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T> T execute(TransactionDefinition definition, TransactionCallback<T> callback) throws TransactionException {
|
||||
if (definition == null) {
|
||||
// Use defaults if no transaction definition given.
|
||||
@@ -331,7 +330,6 @@ public class WebSphereUowTransactionManager extends JtaTransactionManager
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
DefaultTransactionStatus status = prepareTransactionStatus(
|
||||
this.definition, (this.actualTransaction ? this : null),
|
||||
|
||||
@@ -332,7 +332,6 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
||||
* @see #isExistingTransaction
|
||||
* @see #doBegin
|
||||
*/
|
||||
@Override
|
||||
public final TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {
|
||||
Object transaction = doGetTransaction();
|
||||
|
||||
@@ -694,7 +693,6 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
||||
* @see #doCommit
|
||||
* @see #rollback
|
||||
*/
|
||||
@Override
|
||||
public final void commit(TransactionStatus status) throws TransactionException {
|
||||
if (status.isCompleted()) {
|
||||
throw new IllegalTransactionStateException(
|
||||
@@ -815,7 +813,6 @@ public abstract class AbstractPlatformTransactionManager implements PlatformTran
|
||||
* @see #doRollback
|
||||
* @see #doSetRollbackOnly
|
||||
*/
|
||||
@Override
|
||||
public final void rollback(TransactionStatus status) throws TransactionException {
|
||||
if (status.isCompleted()) {
|
||||
throw new IllegalTransactionStateException(
|
||||
|
||||
@@ -56,7 +56,6 @@ public abstract class AbstractTransactionStatus implements TransactionStatus {
|
||||
// Handling of current transaction state
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
@Override
|
||||
public void setRollbackOnly() {
|
||||
this.rollbackOnly = true;
|
||||
}
|
||||
@@ -68,7 +67,6 @@ public abstract class AbstractTransactionStatus implements TransactionStatus {
|
||||
* @see #isLocalRollbackOnly()
|
||||
* @see #isGlobalRollbackOnly()
|
||||
*/
|
||||
@Override
|
||||
public boolean isRollbackOnly() {
|
||||
return (isLocalRollbackOnly() || isGlobalRollbackOnly());
|
||||
}
|
||||
@@ -94,7 +92,6 @@ public abstract class AbstractTransactionStatus implements TransactionStatus {
|
||||
/**
|
||||
* This implementations is empty, considering flush as a no-op.
|
||||
*/
|
||||
@Override
|
||||
public void flush() {
|
||||
}
|
||||
|
||||
@@ -105,7 +102,6 @@ public abstract class AbstractTransactionStatus implements TransactionStatus {
|
||||
this.completed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCompleted() {
|
||||
return this.completed;
|
||||
}
|
||||
@@ -130,7 +126,6 @@ public abstract class AbstractTransactionStatus implements TransactionStatus {
|
||||
return this.savepoint;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSavepoint() {
|
||||
return (this.savepoint != null);
|
||||
}
|
||||
@@ -177,7 +172,6 @@ public abstract class AbstractTransactionStatus implements TransactionStatus {
|
||||
* @see #getSavepointManager()
|
||||
* @see org.springframework.transaction.SavepointManager
|
||||
*/
|
||||
@Override
|
||||
public Object createSavepoint() throws TransactionException {
|
||||
return getSavepointManager().createSavepoint();
|
||||
}
|
||||
@@ -189,7 +183,6 @@ public abstract class AbstractTransactionStatus implements TransactionStatus {
|
||||
* @see #getSavepointManager()
|
||||
* @see org.springframework.transaction.SavepointManager
|
||||
*/
|
||||
@Override
|
||||
public void rollbackToSavepoint(Object savepoint) throws TransactionException {
|
||||
getSavepointManager().rollbackToSavepoint(savepoint);
|
||||
}
|
||||
@@ -200,7 +193,6 @@ public abstract class AbstractTransactionStatus implements TransactionStatus {
|
||||
* @see #getSavepointManager()
|
||||
* @see org.springframework.transaction.SavepointManager
|
||||
*/
|
||||
@Override
|
||||
public void releaseSavepoint(Object savepoint) throws TransactionException {
|
||||
getSavepointManager().releaseSavepoint(savepoint);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,6 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
||||
this.propagationBehavior = propagationBehavior;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getPropagationBehavior() {
|
||||
return this.propagationBehavior;
|
||||
}
|
||||
@@ -169,7 +168,6 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
||||
this.isolationLevel = isolationLevel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getIsolationLevel() {
|
||||
return this.isolationLevel;
|
||||
}
|
||||
@@ -186,7 +184,6 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
||||
this.timeout = timeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getTimeout() {
|
||||
return this.timeout;
|
||||
}
|
||||
@@ -199,7 +196,6 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
||||
this.readOnly = readOnly;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isReadOnly() {
|
||||
return this.readOnly;
|
||||
}
|
||||
@@ -213,7 +209,6 @@ public class DefaultTransactionDefinition implements TransactionDefinition, Seri
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,6 @@ public class DefaultTransactionStatus extends AbstractTransactionStatus {
|
||||
return (this.transaction != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNewTransaction() {
|
||||
return (hasTransaction() && this.newTransaction);
|
||||
}
|
||||
|
||||
@@ -46,27 +46,22 @@ public abstract class DelegatingTransactionDefinition implements TransactionDefi
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPropagationBehavior() {
|
||||
return this.targetDefinition.getPropagationBehavior();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getIsolationLevel() {
|
||||
return this.targetDefinition.getIsolationLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTimeout() {
|
||||
return this.targetDefinition.getTimeout();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadOnly() {
|
||||
return this.targetDefinition.isReadOnly();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.targetDefinition.getName();
|
||||
}
|
||||
|
||||
@@ -177,18 +177,15 @@ public abstract class ResourceHolderSupport implements ResourceHolder {
|
||||
/**
|
||||
* Reset this resource holder - transactional state as well as reference count.
|
||||
*/
|
||||
@Override
|
||||
public void reset() {
|
||||
clear();
|
||||
this.referenceCount = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unbound() {
|
||||
this.isVoid = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVoid() {
|
||||
return this.isVoid;
|
||||
}
|
||||
|
||||
@@ -45,30 +45,25 @@ public abstract class ResourceHolderSynchronization<H extends ResourceHolder, K>
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void suspend() {
|
||||
if (this.holderActive) {
|
||||
TransactionSynchronizationManager.unbindResource(this.resourceKey);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume() {
|
||||
if (this.holderActive) {
|
||||
TransactionSynchronizationManager.bindResource(this.resourceKey, this.resourceHolder);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
flushResource(this.resourceHolder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeCommit(boolean readOnly) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeCompletion() {
|
||||
if (shouldUnbindAtCompletion()) {
|
||||
TransactionSynchronizationManager.unbindResource(this.resourceKey);
|
||||
@@ -79,14 +74,12 @@ public abstract class ResourceHolderSynchronization<H extends ResourceHolder, K>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCommit() {
|
||||
if (!shouldReleaseBeforeCompletion()) {
|
||||
processResourceAfterCommit(this.resourceHolder);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(int status) {
|
||||
if (shouldUnbindAtCompletion()) {
|
||||
boolean releaseNecessary = false;
|
||||
|
||||
@@ -57,7 +57,6 @@ public class SimpleTransactionStatus extends AbstractTransactionStatus {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isNewTransaction() {
|
||||
return this.newTransaction;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import org.springframework.transaction.TransactionStatus;
|
||||
*/
|
||||
public abstract class TransactionCallbackWithoutResult implements TransactionCallback<Object> {
|
||||
|
||||
@Override
|
||||
public final Object doInTransaction(TransactionStatus status) {
|
||||
doInTransactionWithoutResult(status);
|
||||
return null;
|
||||
|
||||
@@ -32,36 +32,28 @@ import org.springframework.core.Ordered;
|
||||
*/
|
||||
public abstract class TransactionSynchronizationAdapter implements TransactionSynchronization, Ordered {
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return Ordered.LOWEST_PRECEDENCE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void suspend() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resume() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeCommit(boolean readOnly) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beforeCompletion() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCommit() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(int status) {
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,6 @@ public class TransactionTemplate extends DefaultTransactionDefinition
|
||||
return this.transactionManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (this.transactionManager == null) {
|
||||
throw new IllegalArgumentException("Property 'transactionManager' is required");
|
||||
@@ -121,7 +120,6 @@ public class TransactionTemplate extends DefaultTransactionDefinition
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public <T> T execute(TransactionCallback<T> action) throws TransactionException {
|
||||
if (this.transactionManager instanceof CallbackPreferringPlatformTransactionManager) {
|
||||
return ((CallbackPreferringPlatformTransactionManager) this.transactionManager).execute(this, action);
|
||||
|
||||
Reference in New Issue
Block a user