PaymentServiceBase.java
// license-header java merge-point
//
// Attention: Generated code! Do not modify by hand!
// Generated by SessionBeanBase.vsl in andromda-ejb3-cartridge on 08/08/2014 12:21:04.
//
package org.andromda.demo.ejb3.rental;
import javax.annotation.Resource;
import javax.ejb.SessionContext;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
* Autogenerated EJB3 session bean base class PaymentServiceBean which contains
* method level annotations for the session bean. All method level annotations
* are inherited by the extending session bean class.
* <p>
* TODO: Model Documentation for PaymentService
* </p>
*/
public abstract class PaymentServiceBase
implements PaymentService
{
// ------ Session Context Injection ------
/**
* SessionContext Injection
*/
@Resource
protected SessionContext context;
// ------ Persistence Context Definitions --------
/**
* Inject persistence context demo-ejb3
*/
@PersistenceContext(unitName = "demo-ejb3")
protected EntityManager emanager;
// --------------- Constructors ---------------
/**
* Default constructor method with no arguments.
*/
public PaymentServiceBase()
{
super();
}
// -------- Business Methods --------------
/**
* <p>
* TODO: Model Documentation for register
* </p>
* @param car
* @param leasePeriod
*/
public void register(RentalCar car, int leasePeriod)
{
if (car == null)
{
throw new IllegalArgumentException(
"org.andromda.demo.ejb3.rental.PaymentServiceBean.register(RentalCar car, int leasePeriod) - 'car' can not be null");
}
try
{
this.handleRegister(car, leasePeriod);
}
catch (Throwable th)
{
throw new PaymentServiceException(
"Error performing 'PaymentService.register(RentalCar car, int leasePeriod)' --> " + th,
th);
}
}
/**
* Performs the core logic for {@link #register(RentalCar, int)}
* @param car
* @param leasePeriod
* @throws Exception
*/
protected abstract void handleRegister(RentalCar car, int leasePeriod)
throws Exception;
// -------- Lifecycle Callbacks --------------
}