// **********************************************************************
//
// Copyright (c) 2002
// IONA Technologies, Inc.
// Waltham, MA, USA
//
// All Rights Reserved
//
// **********************************************************************

#ifndef OB_OAD_PROCESS_ENDPOINT_IDL
#define OB_OAD_PROCESS_ENDPOINT_IDL

#pragma prefix "ooc.com"

#include <OB/IMRTypes.idl>

module OAD
{

//
// Forward declaration
//
interface ProcessEndpoint;

/**
 *
 * This exception is raised if a link already exists between a Process
 * and the ProcessManager
 *
 **/
exception AlreadyLinked
{
};

/**
 *
 * The ProcessEndpointManager. This endpoint tracks links
 * between the ProcessManager and spawned processes
 *
 **/
interface ProcessEndpointManager
{
    /**
     *
     * Called by the Process to establish a link between the Process
     * and the ProcessManager
     *
     * @param server The server name
     * @param instance The Server Instance ID
     * @param pid The Server Process ID
     * @param endpoint The ProcessEndpoint
     *
     * @exception AlreadyLinked Thrown if the process is already linked
     *
     **/
    void establish_link(in string server, in string id, in IMR::ProcessID pid,
			in ProcessEndpoint endpoint)
    raises(AlreadyLinked);
};

/**
 *
 * The ProcessEndpoint. This is used to reestablish a link between
 * the ProcessManager and the Process
 *
 **/
interface ProcessEndpoint
{
    /**
     *
     * Called by the ProcessManager to establish a link between the
     * Process and the ProcessManager
     *
     * @param endpoint The ProcessEndpointManager with which to establish
     *                  a link
     **/
    oneway void reestablish_link(in ProcessEndpointManager endpoint);

    /**
     *
     * Called by the ProcessManager to inform the Process to shutdown.
     *
     **/
    void stop();
};

}; // End module OAD

#endif
