CustomerServiceDelegate.java
// license-header java merge-point
//
// Attention: Generated code! Do not modify by hand!
// Generated by ServiceDelegate.vsl in andromda-ejb3-cartridge on 08/08/2014 12:21:05.
//
package org.andromda.demo.ejb3.customer;
import java.util.Properties;
import javax.naming.NamingException;
import org.andromda.demo.ejb3.ServiceDelegateBase;
import org.andromda.demo.ejb3.ServiceLocator;
/**
* Web service delegator for {@link org.andromda.demo.ejb3.customer.CustomerServiceBean}.
*
* @see org.andromda.demo.ejb3.customer.CustomerServiceBean
*/
public class CustomerServiceDelegate
extends ServiceDelegateBase
{
/**
* Default constructor
*/
public CustomerServiceDelegate()
{
super();
}
/**
* Constructor setting the environment properties.
*
* @param properties
*/
public CustomerServiceDelegate(Properties properties)
{
super(properties);
}
/**
* Gets an instance of {@link CustomerServiceRemote}
*/
private CustomerServiceRemote getCustomerServiceRemote()
throws NamingException
{
return ServiceLocator.getInstance().get_org_andromda_demo_ejb3_customer_CustomerServiceBean_Remote(getProperties());
}
/**
* Call the session bean operation using appropriate view type
* @see org.andromda.demo.ejb3.customer.CustomerServiceBean#addCustomer(Customer)
*
* @param customer
* @throws CustomerException
*/
public void addCustomer(Customer customer)
throws CustomerException
{
try
{
getCustomerServiceRemote().addCustomer(customer);
}
catch (CustomerException ex)
{
throw ex;
}
catch (NamingException ex)
{
throw new CustomerServiceException(
"Error performing 'org.andromda.demo.ejb3.customer.CustomerService.addCustomer(Customer customer)' --> " + ex, ex);
}
}
/**
* Call the session bean operation using appropriate view type
* @see org.andromda.demo.ejb3.customer.CustomerServiceBean#getAllCustomers()
*
* @return Customer[]
* @throws CustomerException
*/
public Customer[] getAllCustomers()
throws CustomerException
{
try
{
return getCustomerServiceRemote().getAllCustomers();
}
catch (CustomerException ex)
{
throw ex;
}
catch (NamingException ex)
{
throw new CustomerServiceException(
"Error performing 'org.andromda.demo.ejb3.customer.CustomerService.getAllCustomers()' --> " + ex, ex);
}
}
}