
/**
 * @file WebFramework.js
 * @version 1.0
 * @author 
 * @date 2007-3-5
 * @copyright 2007 DHCC
 * @brief Web Remoting 架构客户端
 */

//! 远程架构对象

function Remoting(cp, timeout)
{
	if (cp != null && typeof cp == "string")
		this._contextPath = cp;
	else
		this._contextPath = "";

	if (timeout && typeof timeout == "number")
		this.timeout = timeout;
	else
		this.timeout = 5000;

	this._buffalo = null;
}

Remoting.prototype.contextPath = "";

/** 设置上下文路径。*/
Remoting.prototype.setContextPath = function (path)
{
	if (path == null || typeof path != "string")
		return;

	this._contextPath = path;
};


Remoting.prototype.init = function ()
{
	if (this._buffalo == null)
	{
		this._buffalo = new Buffalo(this._contextPath + "/bfapp", true, {}, {timeout:this.timeout});
	}
};


// 返回远程对象调用器
Remoting.prototype.getInvoker = function ()
{
	this.init();
	return this._buffalo;
};


Remoting.Form = Buffalo.Form;
Remoting.OBJECT = Buffalo.BOCLASS;
