Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * JBoss, Home of Professional Open Source
  * Copyright 2010, Red Hat, Inc., and individual contributors
  * by the @authors tag. See the copyright.txt in the distribution for a
  * full listing of individual contributors.
  * 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
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.
package org.jboss.weld.transaction.spi;
import  javax.transaction.Synchronization;
import  javax.transaction.UserTransaction;

The container must implement the services related to transactional behavior used in JSR-299, if that behavior is going to be used.

The event framework specified by CDI includes the ability to create observer methods which are activated based on the phase and status of a currently active transaction. In order to use these abilities, the container must provide these intermediary services which in turn may interact with an application server and JTA.

Required in a Java EE environment

TransactionServices is a per-deployment service.

David Allen
public interface TransactionServices extends Service {
Registers a synchronization object with the currently executing transaction.

synchronizedObserver the synchronization
See also:
    void registerSynchronization(Synchronization synchronizedObserver);

Queries the status of the current execution to see if a transaction is currently active.

true if a transaction is active
    boolean isTransactionActive();

Obtain a reference to the JTA UserTransaction

a reference to the JTA UserTransaction
    UserTransaction getUserTransaction();
New to GrepCode? Check out our FAQ X