BioServiceDelegate.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.bio;

import java.util.Collection;
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.bio.BioServiceBean}.
 *
 * @see org.andromda.demo.ejb3.bio.BioServiceBean
 */
public class BioServiceDelegate
    extends ServiceDelegateBase
{
    /**
     * Default constructor
     */
    public BioServiceDelegate()
    {
        super();
    }

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

    /**
     * Gets an instance of {@link BioServiceRemote}
     */
    private BioServiceRemote getBioServiceRemote()
        throws NamingException
    {
        return ServiceLocator.getInstance().get_org_andromda_demo_ejb3_bio_BioServiceBean_Remote(getProperties());
    }

    /**
     * Call the session bean operation using appropriate view type
     * @see org.andromda.demo.ejb3.bio.BioServiceBean#addBio(Bio)
     *
     * @param bio
     * @throws BioException
     */
    public void addBio(Bio bio)
        throws BioException
    {
        try
        {
            getBioServiceRemote().addBio(bio);
        }
        catch (BioException ex)
        {
            throw ex;
        }
        catch (NamingException ex)
        {
            throw new BioServiceException(
                "Error performing 'org.andromda.demo.ejb3.bio.BioService.addBio(Bio bio)' --> " + ex, ex);
        }
    }

    /**
     * Call the session bean operation using appropriate view type
     * @see org.andromda.demo.ejb3.bio.BioServiceBean#getBio(Long)
     *
     * @param id
     * @return Bio
     * @throws BioException
     */
    public Bio getBio(Long id)
        throws BioException
    {
        try
        {
            return getBioServiceRemote().getBio(id);
        }
        catch (BioException ex)
        {
            throw ex;
        }
        catch (NamingException ex)
        {
            throw new BioServiceException(
                "Error performing 'org.andromda.demo.ejb3.bio.BioService.getBio(Long id)' --> " + ex, ex);
        }
    }

    /**
     * Call the session bean operation using appropriate view type
     * @see org.andromda.demo.ejb3.bio.BioServiceBean#getAllBios()
     *
     * @return Collection
     * @throws BioException
     */
    public Collection getAllBios()
        throws BioException
    {
        try
        {
            return getBioServiceRemote().getAllBios();
        }
        catch (BioException ex)
        {
            throw ex;
        }
        catch (NamingException ex)
        {
            throw new BioServiceException(
                "Error performing 'org.andromda.demo.ejb3.bio.BioService.getAllBios()' --> " + ex, ex);
        }
    }

}