Search in sources :

Example 1 with ResourceAdapter

use of jakarta.resource.spi.ResourceAdapter in project spring-framework by spring-projects.

the class GenericMessageEndpointManager method stop.

/**
 * Deactivates the configured message endpoint.
 */
@Override
public void stop() {
    synchronized (this.lifecycleMonitor) {
        if (this.running) {
            ResourceAdapter resourceAdapter = getResourceAdapter();
            Assert.state(resourceAdapter != null, "No ResourceAdapter set");
            resourceAdapter.endpointDeactivation(getMessageEndpointFactory(), getActivationSpec());
            this.running = false;
        }
    }
}
Also used : ResourceAdapter(jakarta.resource.spi.ResourceAdapter)

Example 2 with ResourceAdapter

use of jakarta.resource.spi.ResourceAdapter in project spring-framework by spring-projects.

the class GenericMessageEndpointManager method start.

/**
 * Activates the configured message endpoint.
 */
@Override
public void start() {
    synchronized (this.lifecycleMonitor) {
        if (!this.running) {
            ResourceAdapter resourceAdapter = getResourceAdapter();
            Assert.state(resourceAdapter != null, "No ResourceAdapter set");
            try {
                resourceAdapter.endpointActivation(getMessageEndpointFactory(), getActivationSpec());
            } catch (ResourceException ex) {
                throw new IllegalStateException("Could not activate message endpoint", ex);
            }
            this.running = true;
        }
    }
}
Also used : ResourceAdapter(jakarta.resource.spi.ResourceAdapter) ResourceException(jakarta.resource.ResourceException)

Aggregations

ResourceAdapter (jakarta.resource.spi.ResourceAdapter)2 ResourceException (jakarta.resource.ResourceException)1