VehicleManagerDelegate.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.vehicle;

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.vehicle.VehicleManagerBean}.
 *
 * @see org.andromda.demo.ejb3.vehicle.VehicleManagerBean
 */
public class VehicleManagerDelegate
    extends ServiceDelegateBase
{
    /**
     * Default constructor
     */
    public VehicleManagerDelegate()
    {
        super();
    }

    /**
     * Constructor setting the environment properties.
     *
     * @param properties
     */
    public VehicleManagerDelegate(Properties properties)
    {
        super(properties);
    }

    /**
     * Gets an instance of {@link VehicleManagerRemote}
     */
    private VehicleManagerRemote getVehicleManagerRemote()
        throws NamingException
    {
        return ServiceLocator.getInstance().get_org_andromda_demo_ejb3_vehicle_VehicleManagerBean_Remote(getProperties());
    }

    /**
     * Call the session bean operation using appropriate view type
     * @see org.andromda.demo.ejb3.vehicle.VehicleManagerBean#addMotorcycle(Motocycle)
     *
     * @param mc
     * @throws VehicleException
     */
    public void addMotorcycle(Motocycle mc)
        throws VehicleException
    {
        try
        {
            getVehicleManagerRemote().addMotorcycle(mc);
        }
        catch (VehicleException ex)
        {
            throw ex;
        }
        catch (NamingException ex)
        {
            throw new VehicleManagerException(
                "Error performing 'org.andromda.demo.ejb3.vehicle.VehicleManager.addMotorcycle(Motocycle mc)' --> " + ex, ex);
        }
    }

    /**
     * Call the session bean operation using appropriate view type
     * @see org.andromda.demo.ejb3.vehicle.VehicleManagerBean#addCar(Car)
     *
     * @param car
     * @throws VehicleException
     */
    public void addCar(Car car)
        throws VehicleException
    {
        try
        {
            getVehicleManagerRemote().addCar(car);
        }
        catch (VehicleException ex)
        {
            throw ex;
        }
        catch (NamingException ex)
        {
            throw new VehicleManagerException(
                "Error performing 'org.andromda.demo.ejb3.vehicle.VehicleManager.addCar(Car car)' --> " + ex, ex);
        }
    }

    /**
     * Call the session bean operation using appropriate view type
     * @see org.andromda.demo.ejb3.vehicle.VehicleManagerBean#addVehicle(Vehicle)
     *
     * @param vehicle
     * @throws VehicleException
     */
    public void addVehicle(Vehicle vehicle)
        throws VehicleException
    {
        try
        {
            getVehicleManagerRemote().addVehicle(vehicle);
        }
        catch (VehicleException ex)
        {
            throw ex;
        }
        catch (NamingException ex)
        {
            throw new VehicleManagerException(
                "Error performing 'org.andromda.demo.ejb3.vehicle.VehicleManager.addVehicle(Vehicle vehicle)' --> " + ex, ex);
        }
    }

}