⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 corbaprovider.java

📁 jtapi for telephone
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
 */
public void releaseCallId(CallId id) {
	this.getRemote().releaseCallId((int)((SerializableCallId)id).getId());
}
/**
 * Forward removeListener to remote provider.
 */
public synchronized void removeListener(TelephonyListener rl) {
	this.getRemote().removeListener(this.getListener());
}
/**
 * Forward to remote stub
 */
public void reportCallsOnAddress(String address, boolean flag) throws InvalidArgumentException, ResourceUnavailableException {
	try {
		this.getRemote().reportCallsOnAddress(address, flag);
	} catch (ResourceUnavailableEx rue) {
		throw new ResourceUnavailableException(rue.type, rue.reason);
	} catch (InvalidArgumentEx iae) {
		throw new InvalidArgumentException(iae.reason);
	}
}
/**
 * Forward to remote stub
 */
public void reportCallsOnTerminal(String terminal, boolean flag) throws InvalidArgumentException, ResourceUnavailableException {
	try {
		this.getRemote().reportCallsOnTerminal(terminal, flag);
	} catch (ResourceUnavailableEx rue) {
		throw new ResourceUnavailableException(rue.type, rue.reason);
	} catch (InvalidArgumentEx iae) {
		throw new InvalidArgumentException(iae.reason);
	}
}
/**
 * Reserve a call id on the remote server.
 */
public CallId reserveCallId(String address) throws InvalidArgumentException {
	try {
		return new SerializableCallId(this.getRemote().reserveCallId(address));
	} catch (InvalidArgumentEx iae) {
		throw new InvalidArgumentException(iae.reason);
	}
}
/**
 * Put RTCs into serializable holder and send to remote stub
 */
public RawSigDetectEvent retrieveSignals(String terminal,
	int num,
	Symbol[] patterns,
	RTC[] rtcs,
	Dictionary optArgs) throws javax.telephony.media.MediaResourceException {
	try {
		DetectEvent de = this.getRemote().retrieveSignals(terminal, num, CorbaProvider.toLongArray(patterns), this.toLongEntryArray(rtcs), this.toLongEntryArray(optArgs));
		return RawSigDetectEvent.create(terminal, de.event.qualifier, de.sigs, de.pattern, de.event.trigger, de.event.error);
	} catch (MediaResourceEx mre) {
		throw new MediaResourceException(mre.reason,
			this.createEvent(terminal, mre.event));
	}
}
/**
 * Trigger sendPrivateData against the remote interface.
 */
public Object sendPrivateData(CallId call, String address, String terminal, Object data) {
	if (!(data instanceof Serializable))
		throw new PlatformException("sendPrivateData data is not serializable through remote proxy");

	try {
		return CorbaProvider.convertAny(this.getRemote().sendPrivateData((int)((SerializableCallId)call).getId(), address, terminal, this.convertAny(data)));
	} catch (NotSerializableException nsx) {
		throw new PlatformException("sendPrivateData data not serializable through remote proxy" + nsx.getMessage());
	} catch (NotSerializableEx nse) {
		throw new PlatformException("sendPrivateData result not serializable through remote proxy");
	}
}
/**
 * Put RTCs and Symbols into serializable holder and send to remote stub
 */
public void sendSignals(String terminal,
	Symbol[] syms,
	RTC[] rtcs,
	Dictionary optArgs) throws javax.telephony.media.MediaResourceException {
	try {
		this.getRemote().sendSignals(terminal, CorbaProvider.toLongArray(syms), this.toLongEntryArray(rtcs), this.toLongEntryArray(optArgs));
	} catch (MediaResourceEx mre) {
		throw new MediaResourceException(mre.reason,
			this.createEvent(terminal, mre.event));
	}
}
/**
 * Insert the method's description here.
 * Creation date: (2000-08-24 12:01:45)
 * @author: Richard Deadman
 * @param newListener net.sourceforge.gjtapi.raw.remote.CorbaListener
 */
private void setListener(CorbaListener newListener) {
	listener = newListener;
}
/**
 * setLoadControl method comment.
 */
public void setLoadControl(String startAddr, String endAddr, double duration, double admissionRate, double interval, int[] treatment) throws MethodNotSupportedException {
	try {
		this.getRemote().setLoadControl(startAddr, endAddr, duration, admissionRate, interval, treatment);
	} catch (MethodNotSupportedEx mnse) {
		throw new MethodNotSupportedException(mnse.reason);
	}
}
/**
 * Insert the method's description here.
 * Creation date: (2000-08-24 11:09:53)
 * @author: Richard Deadman
 * @param newOrb org.omg.CORBA.ORB
 */
private void setOrb(org.omg.CORBA.ORB newOrb) {
	orb = newOrb;
}
/**
 * Send setPrivateData through remote proxy.
 */
public void setPrivateData(CallId call, String address, String terminal, Object data) {
	if (!(data instanceof Serializable))
		throw new PlatformException("setPrivateData data is not serializable through remote proxy");

	try {
		this.getRemote().setPrivateData((int)((SerializableCallId)call).getId(), address, terminal, this.convertAny(data));
	} catch (NotSerializableException nse) {
		throw new PlatformException("sendPrivateData data not serializable through remote proxy" + nse.getMessage());
	}
}
/**
 * Assign the remote proxy.
 * Creation date: (2000-02-17 14:24:48)
 * @author: Richard Deadman
 * @param newRemote net.sourceforge.gjtapi.raw.remote.corba.CorbaProvider
 */
private void setRemote(net.sourceforge.gjtapi.raw.remote.corba.CorbaProvider newRemote) {
	remote = newRemote;
}
/**
 * Tell the remote provider to shutdown.  It may choose to ignore me.
 */
public void shutdown() {
	this.getRemote().shutdown();
}
/**
 * Stop any media actions on the remote terminal.
 */
public void stop(String terminal) {
	this.getRemote().stop(terminal);
}
/**
 * Forward to remote stub
 */
public boolean stopReportingCall(CallId call) {
	return this.getRemote().stopReportingCall((int)((SerializableCallId)call).getId());
}
/**
 * Translate a CORBA CallData holder to a Generic JTAPI CallData holder.
 * Creation date: (2000-08-23 15:55:52)
 * @author: Richard Deadman
 * @return net.sourceforge.gjtapi.CallData
 * @param cd net.sourceforge.gjtapi.raw.remote.corba.CallData
 */
private net.sourceforge.gjtapi.CallData toCallData(net.sourceforge.gjtapi.raw.remote.corba.CallData cd) {
	return new net.sourceforge.gjtapi.CallData(new SerializableCallId(cd.callId), cd.state,
		this.toConnectionData(cd.connections));
}
/**
 * Convert CORBA ConnectionData holder to Generic JTAPI holder
 * Creation date: (2000-08-23 16:00:40)
 * @author: Richard Deadman
 * @return net.sourceforge.gjtapi.ConnectionData[]
 * @param connData net.sourceforge.gjtapi.raw.remote.corba.ConnectionData[]
 */
private net.sourceforge.gjtapi.ConnectionData[] toConnectionData(net.sourceforge.gjtapi.raw.remote.corba.ConnectionData[] connData) {
	int size = connData.length;
	net.sourceforge.gjtapi.ConnectionData[] cd = new net.sourceforge.gjtapi.ConnectionData[size];
	for (int i = 0; i < size; i++) {
		cd[i] = new net.sourceforge.gjtapi.ConnectionData(connData[i].state,
			connData[i].address, connData[i].isLocal, this.toTCData(connData[i].tcs));
	}
	return cd;
}
/**
 * Convert a Symbol array to an int array
 */
static int[] toLongArray(Symbol[] syms) {
	int size = syms.length;
	int[] ia = new int[size];
	for (int i = 0; i < size; i++) {
		ia[i] = (int)syms[i].hashCode();
	}
	return ia;
}
/**
 * Convert a Symbol dictionary to a LongEntry array
 */
private LongEntry[] toLongEntryArray(RTC[] rtcs) {
	int size = rtcs.length;
	LongEntry[] le = new LongEntry[size];
	for (int i = 0; i < size; i++) {
		le[i].key = (int)rtcs[i].getTrigger().hashCode();
		le[i].value = (int)rtcs[i].getAction().hashCode();
	}
	return le;
}
/**
 * Convert a Symbol dictionary to a LongEntry array
 */
private LongEntry[] toLongEntryArray(Dictionary params) {
	Set longEntrySet = new HashSet();
	int size = 0;
	Enumeration e = params.keys();
	while (e.hasMoreElements()) {
		Object key = e.nextElement();
		if (key instanceof Symbol) {
			Symbol skey = (Symbol)key;
			Object value = params.get(key);
			if (value instanceof Symbol) {
				longEntrySet.add(new LongEntry(skey.hashCode(), value.hashCode()));
				size++;
			}
		}
	}
	return (LongEntry[])longEntrySet.toArray(new LongEntry[size]);
}
/**
 * Describe myself
 * @return a string representation of the receiver
 */
public String toString() {
	return "Client proxy for a remote provider";
}
/**
 * Convert an integer array to a Symbol array
 */
static Symbol[] toSymbolArray(int[] ids) {
	int size = ids.length;
	Symbol[] sa = new Symbol[size];
	for (int i = 0; i < size; i++) {
		sa[i] = Symbol.getSymbol(ids[i]);
	}
	return sa;
}
/**
 * Convert CORBA TCData holder to Generic JTAPI holder
 * Creation date: (2000-08-23 16:00:40)
 * @author: Richard Deadman
 * @return net.sourceforge.gjtapi.TCData[]
 * @param connData net.sourceforge.gjtapi.raw.remote.corba.TCData[]
 */
 private net.sourceforge.gjtapi.TCData[] toTCData(net.sourceforge.gjtapi.raw.remote.corba.TCData[] tcData) {
	int size = tcData.length;
	net.sourceforge.gjtapi.TCData[] tcd = new net.sourceforge.gjtapi.TCData[size];
	for (int i = 0; i < size; i++) {
		tcd[i] = new net.sourceforge.gjtapi.TCData(tcData[i].state,
			this.toTermData(tcData[i].terminal));
	}
	return tcd;
}
/**
 * Translate a CORBA TermData holder to a Generic JTAPI TermData holder.
 * Creation date: (2000-08-23 15:55:52)
 * @author: Richard Deadman
 * @return net.sourceforge.gjtapi.TermData
 * @param cd net.sourceforge.gjtapi.raw.remote.corba.TermData
 */
private net.sourceforge.gjtapi.TermData toTermData(net.sourceforge.gjtapi.raw.remote.corba.TermData td) {
	return new net.sourceforge.gjtapi.TermData(td.terminal, td.isMedia);
}
/**
 * Trigger a media runtime control (RTC) action on a remote terminal.
 */
public void triggerRTC(String terminal, javax.telephony.media.Symbol action) {
	this.getRemote().triggerRTC(terminal, (int)action.hashCode());
}
/**
 * Tell the remote provider to unhold a terminal from a call
 */
public void unHold(CallId call, String address, String term) throws RawStateException, MethodNotSupportedException,
	PrivilegeViolationException, ResourceUnavailableException {
	try {
		this.getRemote().unHold((int)((SerializableCallId)call).getId(), address, term);
	} catch (PrivilegeViolationEx pve) {
		throw new PrivilegeViolationException(pve.type, pve.reason);
	} catch (ResourceUnavailableEx rue) {
		throw new ResourceUnavailableException(rue.type, rue.reason);
	} catch (MethodNotSupportedEx mnse) {
		throw new MethodNotSupportedException(mnse.reason);
	} catch (RawStateEx rse) {
		throw new RawStateException(new SerializableCallId(rse.callId), rse.address, rse.terminal,
			rse.type, rse.state, rse.info);
	}
}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -