/** * Example license header for Java files * * http://www.andromda.org/ */ // // Attention: Generated code! Do not modify by hand! // Generated by: SpringServiceBase.vsl in andromda-spring-cartridge. // package org.andromda.test.6; /** *
* Spring Service base class for org.andromda.test.6.RentalService,
* provides access to all services and entities referenced by this service.
*
car's DAO.
*/
public void setCarDao(org.andromda.test.6.CarDao carDao)
{
this.carDao = carDao;
}
/**
* Gets the reference to car's DAO.
*/
protected org.andromda.test.6.CarDao getCarDao()
{
return this.carDao;
}
private org.andromda.test.6.PersonDao personDao;
/**
* Sets the reference to person's DAO.
*/
public void setPersonDao(org.andromda.test.6.PersonDao personDao)
{
this.personDao = personDao;
}
/**
* Gets the reference to person's DAO.
*/
protected org.andromda.test.6.PersonDao getPersonDao()
{
return this.personDao;
}
/**
* @see org.andromda.test.6.RentalService#getAllCars()
*/
public java.util.List getAllCars()
{
try
{
return this.handleGetAllCars();
}
catch (Throwable th)
{
throw new org.andromda.test.6.RentalServiceException(
"Error performing 'org.andromda.test.6.RentalService.getAllCars()' --> " + th,
th);
}
}
/**
* Performs the core logic for {@link #getAllCars()}
*/
protected abstract java.util.List handleGetAllCars()
throws java.lang.Exception;
/**
* @see org.andromda.test.6.RentalService#getCustomersByName(java.lang.String)
*/
public java.util.List getCustomersByName(final java.lang.String name)
{
if (name == null || name.trim().length() == 0)
{
throw new IllegalArgumentException(
"org.andromda.test.6.RentalService.getCustomersByName(java.lang.String name) - 'name' can not be null or empty");
}
try
{
return this.handleGetCustomersByName(name);
}
catch (Throwable th)
{
throw new org.andromda.test.6.RentalServiceException(
"Error performing 'org.andromda.test.6.RentalService.getCustomersByName(java.lang.String name)' --> " + th,
th);
}
}
/**
* Performs the core logic for {@link #getCustomersByName(java.lang.String)}
*/
protected abstract java.util.List handleGetCustomersByName(java.lang.String name)
throws java.lang.Exception;
/**
* Gets the current principal if one has been set,
* otherwise returns null.
*
* @return the current principal
*/
protected java.security.Principal getPrincipal()
{
return org.andromda.spring.PrincipalStore.get();
}
/**
* Gets the message source available to this service.
*/
protected org.springframework.context.MessageSource getMessages()
{
return (org.springframework.context.MessageSource)
org.andromda.spring.BeanLocator.instance().getBean("messageSource");
}
/**
* Gets the message having the given key in the underlying message bundle.
*
* @param key the key of the message in the messages.properties message bundle.
*/
protected String getMessage(final String key)
{
return this.getMessages().getMessage(key, null, null);
}
/**
* Gets the message having the given key and arguments in the
* underlying message bundle.
*
* @param key the key of the message in the messages.properties message bundle.
* @param arguments any arguments to substitute when resolving the message.
*/
protected String getMessage(final String key, final Object[] arguments)
{
return this.getMessages().getMessage(key, arguments, null);
}
/**
* Gets the message having the given key using the given arguments
* for the given locale.
*
* @param key the key of the message in the messages.properties message bundle.
* @param arguments any arguments to substitute when resolving the message.
* @param locale the locale of the messages to retrieve.
*/
protected String getMessage(
final java.lang.String key, final java.lang.Object[] arguments,
final java.util.Locale locale)
{
return this.getMessages().getMessage(key, arguments, locale);
}
/**
* Gets all roles belonging to the current principal.
*
* @return the names of the current principal roles.
*/
public java.lang.String[] getPrincipalRoles()
{
return org.andromda.spring.PrincipalStore.getPrincipalRoles();
}
}