-
public interface ResourceAdapter
This represents a resource adapter instance and contains operations for lifecycle management and message endpoint setup. A concrete implementation of this interface is required to be a JavaBean.- Version:
- 1.0
- Author:
- Ram Jeyaraman
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
This is called during the activation of a message endpoint.void
endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
This is called when a message endpoint is deactivated.XAResource[]
getXAResources(ActivationSpec[] specs)
This method is called by the application server during crash recovery.void
start(BootstrapContext ctx)
This is called when a resource adapter instance is bootstrapped.void
stop()
This is called when a resource adapter instance is undeployed or during application server shutdown.
-
-
-
Method Detail
-
start
void start(BootstrapContext ctx) throws ResourceAdapterInternalException
This is called when a resource adapter instance is bootstrapped. This may be during resource adapter deployment or application server startup. This is a startup notification from the application server, and this method is called by an application server thread. The application server thread executes in an unspecified context.During this method call a ResourceAdapter JavaBean is responsible for initializing the resource adapter instance. Any exception thrown during this method call causes the application server to abort the bootstrap procedure for this specific resource adapter instance.
- Parameters:
ctx
- a bootstrap context containing references to useful facilities that could be used by a resource adapter instance.- Throws:
ResourceAdapterInternalException
- indicates bootstrap failure. The resource adapter instance is unusable and must be discarded.
-
stop
void stop()
This is called when a resource adapter instance is undeployed or during application server shutdown. This is a shutdown notification from the application server, and this method is called by an application server thread. The application server thread executes in an unspecified context.During this method call, a ResourceAdapter JavaBean is responsible for performing an orderly shutdown of the resource adapter instance. Any exception thrown by this method call does not alter the processing of the application server shutdown or resource adapter undeployment that caused this method call. The application server may log the exception information for error reporting purposes.
-
endpointActivation
void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException
This is called during the activation of a message endpoint. This causes the resource adapter instance to do the necessary setup (ie., setup message delivery for the message endpoint with a message provider). Note that message delivery to the message endpoint might start even before this method returns.Endpoint activation is deemed successful only when this method completes successfully without throwing any exceptions.
- Parameters:
endpointFactory
- a message endpoint factory instance.spec
- an activation spec JavaBean instance.- Throws:
NotSupportedException
- indicates message endpoint activation rejection due to incorrect activation setup information.ResourceException
-
endpointDeactivation
void endpointDeactivation(MessageEndpointFactory endpointFactory, ActivationSpec spec)
This is called when a message endpoint is deactivated. The instances passed as arguments to this method call should be identical to those passed in for the corresponding endpointActivation call. This causes the resource adapter to stop delivering messages to the message endpoint.Any exception thrown by this method is ignored. After this method call, the endpoint is deemed inactive.
- Parameters:
endpointFactory
- a message endpoint factory instance.spec
- an activation spec JavaBean instance.
-
getXAResources
XAResource[] getXAResources(ActivationSpec[] specs) throws ResourceException
This method is called by the application server during crash recovery. This method takes in an array ofActivationSpec
JavaBeans and returns an array ofXAResource
objects each of which represents a unique resource manager. The resource adapter may return null if it does not implement theXAResource
interface. Otherwise, it must return an array ofXAResource
objects, each of which represents a unique resource manager that was used by the endpoint applications. The application server uses theXAResource
objects to query each resource manager for a list of in-doubt transactions. It then completes each pending transaction by sending the commit decision to the participating resource managers.- Parameters:
specs
- an array ofActivationSpec
JavaBeans each of which corresponds to an deployed endpoint application that was active prior to the system crash.- Returns:
- an array of
XAResource
objects each of which represents a unique resource manager. - Throws:
ResourceException
- generic exception if operation fails due to an error condition.
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/resource/spi/ResourceAdapter.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.