ServiceDelegateBase.java

// license-header java merge-point
//
// Attention: Generated code! Do not modify by hand!
// Generated by ServiceDelegateBase.vsl in andromda-ejb3-cartridge on 09/15/2014 18:39:44.
//
package org.andromda.timetracker;

import java.util.Properties;

/**
 * Service delegate base class extended by all service delegates.
 */
public abstract class ServiceDelegateBase
{
    /**
     * Define remote interface view type = 0
     */
    public static final int REMOTE_VIEW_TYPE = 0;

    /**
     * Define local interface view type = 1
     */
    public static final int LOCAL_VIEW_TYPE = 1;

    /**
     * Default remote view type selected = REMOTE_VIEW_TYPE
     */
    private int viewType = REMOTE_VIEW_TYPE;

    /**
     * Environment properties
     */
    private Properties properties = null;

    /**
     * Default empty constructor
     */
    public ServiceDelegateBase()
    {
        // empty constructor
    }

    /**
     * Constructor setting the envirinment properties.
     *
     * @param properties
     */
    public ServiceDelegateBase(Properties properties)
    {
        this.properties = properties;
    }

    /**
     * Get the view interface for invoking business operations
     * @return viewType
     */
    public int getViewType()
    {
        return this.viewType;
    }

    /**
     * Set the view interface for invoking business operations
     * @param viewType int
     */
    public void setViewType(int viewType)
    {
        this.viewType = viewType;
    }

    /**
     * Get the environment properties if set, otherwise return null
     * @return Properties
     */
    public Properties getProperties()
    {
        return this.properties;
    }

    /**
     * Set the environment properties
     * @param properties
     */
    public void setProperties(Properties properties)
    {
        this.properties = properties;
    }

    /**
     * Close down service delegate resources
     */
    public void close()
    {
        ServiceLocator.getInstance().shutdown();
    }
}