/*====================================================================
Tnis file was produced by the OpenCCM ir3_jimpl generator.
OpenCCM: The Open CORBA Component Model Platform
Copyright (C) 2000-2002 USTL - LIFL - GOAL
Contact: openccm-team@objectweb.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
USA
Initial developer(s): Philippe Merle, Mathieu Vadet.
Contributor(s): Sylvain Leblanc_______________________.
====================================================================*/
package cadena.modalsp;
import cadena.common.*;
/**
 **  Implementation skeleton class for the ::modalsp::BMModalTwoOrCorrelation component.
 **  Business operations MUST be completed !!!
 **/
public class BMModalTwoOrCorrelationMonolithicImpl
       extends org.omg.CORBA.LocalObject
       implements CCM_BMModalTwoOrCorrelation,  
                  cadena.common.CCM_ChangeMode,  
                  cadena.common.CCM_ReadData,  
                  cadena.common.CCM_ReadWriteData, 
		  cadena.common.CCM_DataAvailableConsumer,
                  org.omg.Components.SessionComponent
{
    // ==================================================================
    //
    // Internal State.
    //
    // ===================================================================
    private String data;
    private String name;
    private OnOffMode mode;
    /**
     **  Context reference.
     **/
    private CCM_BMModalTwoOrCorrelation_Context the_context_;
    // ==================================================================
    //
    // Constructor.
    //
    // ===================================================================
    /**
     **  The default constructor.
     **/
    public
    BMModalTwoOrCorrelationMonolithicImpl()
    {
	this(OnOffMode.disabled);
        the_context_ = null;
    }
    public
    BMModalTwoOrCorrelationMonolithicImpl(OnOffMode m)
    {
	mode = m;
        the_context_ = null;
	data = "";
    } 
    // ==================================================================
    //
    // Internal methods.
    //
    // ===================================================================
    // ==================================================================
    //
    // Public methods.
    //
    // ===================================================================
    /**
     **  To obtain the context.
     **
     **  @return The context that has been previously set by
     **          the set_session_context operation.
     **/
    public CCM_BMModalTwoOrCorrelation_Context
    getContext()
    {
        return the_context_;
    }
    // ==================================================================
    //
    // Methods for the OMG IDL Components::EnterpriseComponent local interface.
    //
    // ==================================================================
    //
    //  IDL:omg.org/Components/EnterpriseComponent/configuration_complete:1.0
    //
    /**
     **  Completes the component configuration.
     **
     **  @throws org.omg.Components.InvalidConfiguration
     **          Thrown if the configuration is invalid.
     **/
    public void
    configuration_complete()
    throws org.omg.Components.InvalidConfiguration
    {
        //
        //  TODO : implement !!!
        //
    }
    // ==================================================================
    //
    // Methods for the OMG IDL Components::SessionComponent local interface.
    //
    // ==================================================================
    //
    //  IDL:omg.org/Components/SessionComponent/set_session_context:1.0
    //
    /**
     *  Called by the container when the component session context will be fixed.
     *
     *  @param context The session context.
     *
     *  @throws org.omg.Components.CCMException
     *          Thrown if a system level error occured.
     */
    public void
    set_session_context(org.omg.Components.SessionContext context)
    throws org.omg.Components.CCMException
    {
        the_context_ = (CCM_BMModalTwoOrCorrelation_Context)context;
    }
    //
    //  IDL:omg.org/Components/SessionComponent/ccm_activate:1.0
    //
    /**
     *
     * Called by the container when the component will be activated.
     *
     *  @throws org.omg.Components.CCMException
     *          Thrown if a system level error occured.
     */
    public void 
    ccm_activate()
    throws org.omg.Components.CCMException
    {
        //
        // Unused by actual OpenCCM containers
        //
    }
    //
    //  IDL:omg.org/Components/SessionComponent/ccm_passivate:1.0
    //
    /**
     *
     * Called by the container when the component will be passivated.
     *
     *  @throws org.omg.Components.CCMException
     *          Thrown if a system level error occured.
     */
    public void 
    ccm_passivate()
    throws org.omg.Components.CCMException
    {
        //
        // Unused by actual OpenCCM containers
        //
    }
    //
    //  IDL:omg.org/Components/SessionComponent/ccm_remove:1.0
    //
    /**
     *
     * Called by the container when the component will be removed.
     *
     *  @throws org.omg.Components.CCMException
     *          Thrown if a system level error occured.
     */
    public void 
    ccm_remove()
    throws org.omg.Components.CCMException
    {
        //
        // TO DO: implement !!!
        //
    }
    // ==================================================================
    //
    // Public methods for the CCM_BMModalTwoOrCorrelation local interface.
    //
    // ==================================================================
    //
    //  IDL:cadena/modalsp/CCM_BMModalTwoOrCorrelation/get_modeChange:1.0
    //
    /**
     **  Implementation of the ::modalsp::CCM_BMModalTwoOrCorrelation::get_modeChange operation.
     **/
    public cadena.common.CCM_ChangeMode
    get_modeChange()
    {
        return this;
    }
    //
    //  IDL:cadena/modalsp/CCM_BMModalTwoOrCorrelation/get_dataOut:1.0
    //
    /**
     **  Implementation of the ::modalsp::CCM_BMModalTwoOrCorrelation::get_dataOut operation.
     **/
    public cadena.common.CCM_ReadData
    get_dataOut()
    {
        return this;
    }
    //
    //  IDL:cadena/modalsp/CCM_BMModalTwoOrCorrelation/get_dataWriteOut:1.0
    //
    /**
     **  Implementation of the ::modalsp::CCM_BMModalTwoOrCorrelation::get_dataWriteOut operation.
     **/
    public cadena.common.CCM_ReadWriteData
    get_dataWriteOut()
    {
        return this;
    }
    //
    //  IDL:cadena/modalsp/CCM_BMModalTwoOrCorrelation/push_inDataAvailableAirFrame:1.0
    //
    /**
     **  Implementation of the ::modalsp::CCM_BMModalTwoOrCorrelation::push_inDataAvailableAirFrame operation.
     **/
    public void
    push_inDataAvailableAirFrame(cadena.common.DataAvailable event)
    {
	push(event);
    }
    //
    //  IDL:cadena/modalsp/CCM_BMModalTwoOrCorrelation/push_inDataAvailableNavSteeringPoints:1.0
    //
    /**
     **  Implementation of the ::modalsp::CCM_BMModalTwoOrCorrelation::push_inDataAvailableNavSteeringPoints operation.
     **/
    public void
    push_inDataAvailableNavSteeringPoints(cadena.common.DataAvailable event)
    {
	push(event);
    }
    public void push(cadena.common.DataAvailable event) {
	ReadData dataIn1 = the_context_.get_connection_dataIn1();
        if(dataIn1 == null) {
            System.err.println("The modalsp::BMModalTwoCorrelation "+name+" ::dataIn1 receptacle is not set!");
            return;
        }
        String data1=dataIn1.data();

        ReadData dataIn2 = the_context_.get_connection_dataIn2();
        if(dataIn2 == null) {
            System.err.println("The modalsp::BMModalTwoCorrelation "+name+" ::dataIn2 receptacle is not set!");
            return;
        }
        String data2=dataIn2.data();
        data = data1+data2;
        the_context_.push_outDataAvailable(new DataAvailableImpl( ));
    }

    //
    //  IDL:cadena/common/CCM_NamedComponent_Executor/name:1.0
    //
    /**
     **  Implementation of the ::common::CCM_NamedComponent_Executor::name attribute as accessor operation.
     **/
    public java.lang.String
    name()
    {
        return name;
    }
     
    /**
     **  Implementation of the ::common::CCM_NamedComponent_Executor::name attribute as mutator operation.
     **/
    public void
    name(java.lang.String val)
    {
	name = val;
    }
    // ==================================================================
    //
    // Public methods for the ::common::CCM_ChangeMode local interface.
    //
    // ==================================================================
    //
    //  IDL:cadena/common/ChangeMode/modeVar:1.0
    //
    /**
     **  Implementation of the ::common::ChangeMode::modeVar attribute as accessor operation.
     **/
    public cadena.common.OnOffMode
    modeVar()
    {
        return mode;
    }
     
    /**
     **  Implementation of the ::common::ChangeMode::modeVar attribute as mutator operation.
     **/
    public void
    modeVar(cadena.common.OnOffMode val)
    {
	mode = val;
    }
    // ==================================================================
    //
    // Public methods for the ::common::CCM_ReadData local interface.
    //
    // ==================================================================
    //
    //  IDL:cadena/common/ReadData/data:1.0
    //
    /**
     **  Implementation of the ::common::ReadData::data attribute as accessor operation.
     **/
    public java.lang.String
    data()
    {
        return data;
    }
    // ==================================================================
    //
    // Public methods for the ::common::CCM_ReadWriteData local interface.
    //
    // ==================================================================
    //
    //  IDL:cadena/common/ReadWriteData/data:1.0
    //
    /**
     **  Implementation of the ::common::ReadWriteData::data attribute as accessor operation.
     **/
//     public java.lang.String
//     data()
//     {
//         //
//         //  TODO : implement
//         //
//         return "";
//     }
     
    /**
     **  Implementation of the ::common::ReadWriteData::data attribute as mutator operation.
     **/
    public void
    data(java.lang.String val)
    {
	data = val;
    }
}


syntax highlighted by Code2HTML, v. 0.9.1