
javax.resource.spi.ResourceAdapter Maven / Gradle / Ivy
The newest version!
/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package javax.resource.spi;
import javax.resource.ResourceException;
import javax.resource.spi.endpoint.MessageEndpointFactory;
import javax.transaction.xa.XAResource;
/**
* Operations for lifecycle management and message endpoint configuration.
* Implementations of this interface must be javabeans
*/
public interface ResourceAdapter
{
/**
* Used to bootstrap the resource adapter
*
* @param ctx the bootstrap context
* @throws ResourceAdapterInternalException for a bootstrap failure
*/
void start(BootstrapContext ctx) throws ResourceAdapterInternalException;
/**
* Used to stop the resource adapter
*/
void stop();
/**
* Activates the endpoint factory
*
* @param endpointFactory the endpoint factory
* @param spec the activation spec
* @throws ResourceException for a generic error
* @throws NotSupportedException for incorrect activation
*/
void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException;
/**
* Deactivates the endpoint
*
* @param endpointFactory the endpoint factory
* @param spec the activation spec
*/
void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec);
/**
* Called by the application server during recovery
*
* @param specs the activation specs
* @return the XAResources used to perform the recovery
* @throws ResourceException for a generic error
*/
XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy