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

📄 rmiprovider.java

📁 jtapi for telephone
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
}
/**
 * Delegate to the remote stub
 */
public boolean isMediaTerminal(java.lang.String terminal) {
	try {
		return this.getRemote().isMediaTerminal(terminal);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Tell the remote provider to join two calls
 */
public CallId join(CallId call1, CallId call2, String address, String terminal) throws RawStateException, InvalidArgumentException, MethodNotSupportedException,
	PrivilegeViolationException, ResourceUnavailableException {
	try {
		return this.getRemote().join((SerializableCallId)call1,
				(SerializableCallId)call2,
				address,
				terminal);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Put RTCs into serializable holder and send to remote stub
 */
public void play(String terminal,
	String[] streamIds,
	int offset,
	RTC[] rtcs,
	Dictionary optArgs) throws javax.telephony.media.MediaResourceException {
	RTCHolder[] rtcHolders = new RTCHolder[rtcs.length];
	for (int i = 0; i < rtcs.length; i++) {
		rtcHolders[i] = new RTCHolder(rtcs[i]);
	}
	try {
		this.getRemote().play(terminal, streamIds, offset, rtcHolders, this.toSerializable(optArgs));
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Put RTCs into serializable holder and send to remote stub
 */
public void record(String terminal,
	String streamId,
	RTC[] rtcs,
	Dictionary optArgs) throws javax.telephony.media.MediaResourceException {
	RTCHolder[] rtcHolders = new RTCHolder[rtcs.length];
	for (int i = 0; i < rtcs.length; i++) {
		rtcHolders[i] = new RTCHolder(rtcs[i]);
	}
	try {
		this.getRemote().record(terminal, streamId, rtcHolders, this.toSerializable(optArgs));
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Tell the remote provider to release an address from a call.
 */
public void release(String address, CallId call) throws PrivilegeViolationException,
	ResourceUnavailableException, MethodNotSupportedException, RawStateException {
	try {
		this.getRemote().release(address, (SerializableCallId)call);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Release any CallId's that I have reserved.
 */
public void releaseCallId(CallId id) {
	try {
		this.getRemote().releaseCallId((SerializableCallId)id);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Forward removeListener to remote provider.
 */
public void removeListener(TelephonyListener rl) {
	try {
		this.getRemote().removeListener(new RemoteListenerImpl(rl));
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Forward to remote stub
 */
public void reportCallsOnAddress(String address, boolean flag) throws InvalidArgumentException, ResourceUnavailableException {
	try {
		this.getRemote().reportCallsOnAddress(address, flag);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Forward to remote stub
 */
public void reportCallsOnTerminal(String terminal, boolean flag) throws InvalidArgumentException, ResourceUnavailableException {
	try {
		this.getRemote().reportCallsOnTerminal(terminal, flag);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Reserve a call id on the remote server.
 */
public CallId reserveCallId(String address) throws InvalidArgumentException {
	try {
		return this.getRemote().reserveCallId(address);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * 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 {
	RTCHolder[] rtcHolders = new RTCHolder[rtcs.length];
	for (int i = 0; i < rtcs.length; i++) {
		rtcHolders[i] = new RTCHolder(rtcs[i]);
	}
	SymbolHolder[] patHolders = new SymbolHolder[patterns.length];
	for (int i = 0; i < patterns.length; i++) {
		patHolders[i] = new SymbolHolder(patterns[i]);
	}
	try {
		return this.getRemote().retrieveSignals(terminal, num, patHolders, rtcHolders, this.toSerializable(optArgs));
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * 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 this.getRemote().sendPrivateData(call, address, terminal, (Serializable)data);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	} catch (NotSerializableException 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 {
	RTCHolder[] rtcHolders = new RTCHolder[rtcs.length];
	for (int i = 0; i < rtcs.length; i++) {
		rtcHolders[i] = new RTCHolder(rtcs[i]);
	}
	SymbolHolder[] symHolders = new SymbolHolder[syms.length];
	for (int i = 0; i < syms.length; i++) {
		symHolders[i] = new SymbolHolder(syms[i]);
	}
	try {
		this.getRemote().sendSignals(terminal, symHolders, rtcHolders, this.toSerializable(optArgs));
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * setLoadControl method comment.
 */
public void setLoadControl(java.lang.String startAddr, java.lang.String endAddr, double duration, double admissionRate, double interval, int[] treatment) throws javax.telephony.MethodNotSupportedException {
	try {
		this.getRemote().setLoadControl(startAddr, endAddr, duration, admissionRate, interval, treatment);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * 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(call, address, terminal, (Serializable)data);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Insert the method's description here.
 * Creation date: (2000-02-17 14:24:48)
 * @author: 
 * @param newRemote net.sourceforge.gjtapi.raw.remote.RemoteProvider
 */
private void setRemote(RemoteProvider newRemote) {
	remote = newRemote;
}
/**
 * Tell the remote provider to shutdown.  It may choose to ignore me.
 */
public void shutdown() {
	try {
		this.getRemote().shutdown();
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Stop any media actions on the remote terminal.
 */
public void stop(String terminal) {
	try {
		this.getRemote().stop(terminal);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Forward to remote stub
 */
public boolean stopReportingCall(CallId call) {
	try {
		return this.getRemote().stopReportingCall((SerializableCallId)call);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * Replace each Symbol key or value with a SymbolHolder so that it can be send across a wire.
 * Creation date: (2000-03-13 9:34:39)
 * @author: Richard Deadman
 * @return A clone that is serializable
 * @param dict A dictionary of parameters and values that control the usage of the resource.  This should move to a Map later.
 */
private Dictionary toSerializable(Dictionary dict) {
	if (dict == null)
		return null;
	Hashtable table = new Hashtable();
	Enumeration keys = dict.keys();
	while (keys.hasMoreElements()) {
		Object k = keys.nextElement();
		Object v = dict.get(k);
		if (k instanceof Symbol)
			k = new SymbolHolder((Symbol)k);
		if (v instanceof Symbol)
			v = new SymbolHolder((Symbol)v);
		table.put(k, v);
	}
	return table;
}
/**
 * Describe myself
 * @return a string representation of the receiver
 */
public String toString() {
	return "Client proxy for a remote provider";
}
/**
 * Trigger a media runtime control (RTC) action on a remote terminal.
 */
public void triggerRTC(String terminal, javax.telephony.media.Symbol action) {
	try {
		this.getRemote().triggerRTC(terminal, new SymbolHolder(action));
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
/**
 * 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((SerializableCallId)call, address, term);
	} catch (RemoteException re) {
		throw new PlatformException(re.getMessage());
	}
}
}

⌨️ 快捷键说明

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