/*
 * JBoss, Home of Professional Open Source
 * Copyright 2006, Red Hat Middleware LLC, and individual contributors
 * as indicated by the @author tags. 
 * See the copyright.txt in the distribution for a full listing 
 * of individual contributors.
 * This copyrighted material is made available to anyone wishing to use,
 * modify, copy, or redistribute it subject to the terms and conditions
 * of the GNU Lesser General Public License, v. 2.1.
 * This program is distributed in the hope that it will be useful, but WITHOUT A
 * 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,
 * v.2.1 along with this distribution; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA  02110-1301, USA.
 * 
 * (C) 2005-2006,
 * @author JBoss Inc.
 */
/*
 * Copyright (C) 2001, 2002,
 *
 * Hewlett-Packard Arjuna Labs,
 * Newcastle upon Tyne,
 * Tyne and Wear,
 * UK.
 *
 * $Id: TestModule.idl 2342 2006-03-30 13:06:17Z  $
 */

#include <CosTransactions.idl>

module TestModule
{
    // grid.idl

    // IDL defintion of a 2-D grid (in row major order):

    /*
     * This is only here as an example of what methods a Resource should
     * provide. Atomic objects *should not* derive from Resource, however.
     * Resource objects should drive atomic objects directly.
     */

    interface grid : CosTransactions::Resource
    {
	readonly attribute long height;  // height of the grid
	readonly attribute long width;   // width of the grid

	// IDL operations

	// set the element [n,m] of the grid, to value:
	void set (in long n, in long m, in long value, in CosTransactions::Control tran );

	// return element [n,m] of the grid:
	long get (in long n, in long m, in CosTransactions::Control tran);
    };

    /*
     * This is only here as an example of what methods a Resource should
     * provide. Atomic objects *should not* derive from Resource, however.
     * Resource objects should drive atomic objects directly.
     */

    interface tranobject : CosTransactions::Resource
    {
	void foobar ();
    };

    /*
     * Here for basic implicit interposition test.
     */

    interface SetGet : CosTransactions::SubtransactionAwareResource
    {
	void set (in short n, in CosTransactions::Control cont);
	short get (in CosTransactions::Control cont);
    };

    interface TranGrid : CosTransactions::Resource, CosTransactions::TransactionalObject
    {
	readonly attribute short height;  // height of the grid
	readonly attribute short width;   // width of the grid

	// IDL operations

	// set the element [n,m] of the grid, to value:
	void set(in short n, in short m, in short value);

	// return element [n,m] of the grid:
	short get(in short n, in short m);
    };

    interface Hammer
    {
	boolean incr (in long value, in CosTransactions::Control c);
	boolean set (in long value, in CosTransactions::Control c);
	boolean get (inout long value, in CosTransactions::Control c);
    };

    interface ExplicitStack
    {
	long push (in long val, in CosTransactions::Control action);
	long pop  (out long val, in CosTransactions::Control action);
	void printStack ();
    };

    interface stack : CosTransactions::TransactionalObject
    {
	long push (in long val);
	long pop  (out long val);
    };

};
