// Filename   :	SrvMain.cpp
// Written By : Stephen Cerniglia	cernigls@cs.rpi.edu

#include "front.h"
#include "omnithread.h"
#include <iostream.h>

#include "front_impl.cpp"

int main(int argc, char *argv[]) {
	// These initialize the ORB required stuff

	CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB2");
	CORBA::BOA_ptr boa = orb->BOA_init(argc,argv,"omniORB2_BOA");

	cout << "Server initializing." << endl;

	// Front office as seen on page 31.
	FrontOffice_impl myFrontOffice("Royal", 25, 40, 'G', 5.00, 3.00);

	myFrontOffice._obj_is_ready(boa);

	{
        FrontOffice_var myobjRef = myFrontOffice._this();
		CORBA::String_var p = orb->object_to_string(myobjRef);
		cerr << "'" << (char*)p << "'" << endl;
	}

	// Tell the BOA we are ready. The BOA's default behaviour is to block
	// on this call indefinitely.
	boa->impl_is_ready ();

	return 0;
}
