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

📄 corbaserver.java

📁 jtapi for telephone
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
		this.getReal().reportCallsOnAddress(address, flag);
	} catch (javax.telephony.ResourceUnavailableException rue) {
		throw this.createResourceUnavailableEx(rue);
	} catch (InvalidArgumentException iae) {
		throw createInvalidArgumentEx(iae);
	}
}
/**
 * reportCallsOnTerminal method comment.
 */
public void reportCallsOnTerminal(String terminal, boolean flag) throws net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx, net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx {
	try {
		this.getReal().reportCallsOnTerminal(terminal, flag);
	} catch (javax.telephony.ResourceUnavailableException rue) {
		throw this.createResourceUnavailableEx(rue);
	} catch (InvalidArgumentException iae) {
		throw createInvalidArgumentEx(iae);
	}
}
/**
 * reserveCallId method comment.
 */
public int reserveCallId(String address) throws net.sourceforge.gjtapi.raw.remote.corba.InvalidArgumentEx {
	try {
		return this.getRefMapper().callToInt(this.getReal().reserveCallId(address));
	} catch (InvalidArgumentException iae) {
		throw this.createInvalidArgumentEx(iae);
	}
}
/**
 * retrieveSignals method comment.
 */
public net.sourceforge.gjtapi.raw.remote.corba.DetectEvent retrieveSignals(String terminal, int num, int[] patterns, net.sourceforge.gjtapi.raw.remote.corba.LongEntry[] rtcs, net.sourceforge.gjtapi.raw.remote.corba.LongEntry[] optArgs) throws net.sourceforge.gjtapi.raw.remote.corba.MediaResourceEx {
	try {
		RawSigDetectEvent de = this.getReal().retrieveSignals(terminal, num, CorbaProvider.toSymbolArray(patterns), this.toRTCArray(rtcs), this.toSymbolDictionary(optArgs));
		ResourceUnion ru = new ResourceUnion();
		int[] buf = CorbaProvider.toLongArray(SymbolHolder.decode(de.getSigs()));
		ru.sdEv(new SigDetectorEvent(de.getPatternIndex(), buf));
		ResourceEvent re = new ResourceEvent((int)de.getErr().getSymbol().hashCode(),
			(int)javax.telephony.media.SignalDetector.ev_RetrieveSignals.hashCode(),
			de.getTerminal(),
			(int)de.getQualifier().getSymbol().hashCode(),
			(int)de.getTrigger().getSymbol().hashCode(),
			ru);
		return new DetectEvent(de.getPatternIndex(), buf, de.getTerminal(), re);
	} catch (MediaResourceException mre) {
		throw new MediaResourceEx(mre.getMessage(),
			this.createEvent(mre.getResourceEvent()));
	}
}
/**
 * sendPrivateData method comment.
 */
public org.omg.CORBA.Any sendPrivateData(int callId, String address, String terminal, org.omg.CORBA.Any data) throws net.sourceforge.gjtapi.raw.remote.corba.NotSerializableEx {
	try {
		return CorbaProvider.convertToAny(this.getOrb(), this.getReal().sendPrivateData(this.getRefMapper().intToCall(callId), address, terminal, CorbaProvider.convertAny(data)));
	} catch (java.io.NotSerializableException nsx) {
		throw new PlatformException("sendPrivateData data not serializable through remote proxy" + nsx.getMessage());
	}
}
/**
 * sendSignals method comment.
 */
public void sendSignals(String terminal, int[] syms, net.sourceforge.gjtapi.raw.remote.corba.LongEntry[] rtcs, net.sourceforge.gjtapi.raw.remote.corba.LongEntry[] optArgs) throws net.sourceforge.gjtapi.raw.remote.corba.MediaResourceEx {
	try {
		this.getReal().sendSignals(terminal, CorbaProvider.toSymbolArray(syms), this.toRTCArray(rtcs), this.toSymbolDictionary(optArgs));
	} catch (MediaResourceException mre) {
		throw new MediaResourceEx(mre.getMessage(),
			this.createEvent(mre.getResourceEvent()));
	}
}
/**
 * Insert the method's description here.
 * Creation date: (2000-08-24 15:33:55)
 * @author: Richard Deadman
 * @param newCallbackMux net.sourceforge.gjtapi.raw.RawListenerMux
 */
private void setCallbackMux(net.sourceforge.gjtapi.raw.RawListenerMux newCallbackMux) {
	callbackMux = newCallbackMux;
}
/**
 * setLoadControl method comment.
 */
public void setLoadControl(String startAddr, String endAddr, double duration, double admissionRate, double interval, int[] treatment) throws MethodNotSupportedEx {
	try {
		this.getReal().setLoadControl(startAddr, endAddr, duration, admissionRate, interval, treatment);
	} catch (MethodNotSupportedException mnse) {
		throw createMethodNotSupportedEx(mnse);
	}
}
/**
 * Insert the method's description here.
 * Creation date: (2000-08-24 15:54:40)
 * @author: Richard Deadman
 * @param newOrb org.omg.CORBA.ORB
 */
private void setOrb(org.omg.CORBA.ORB newOrb) {
	orb = newOrb;
}
/**
 * setPrivateData method comment.
 */
public void setPrivateData(int callId, String address, String terminal, org.omg.CORBA.Any data) {
	this.getReal().setPrivateData(this.getRefMapper().intToCall(callId), address, terminal, CorbaProvider.convertAny(data));
}
/**
 * Insert the method's description here.
 * Creation date: (2000-08-24 15:33:56)
 * @author: Richard Deadman
 * @param newReal net.sourceforge.gjtapi.TelephonyProvider
 */
private void setReal(net.sourceforge.gjtapi.TelephonyProvider newReal) {
	real = newReal;
}
/**
 * Insert the method's description here.
 * Creation date: (2000-08-24 15:33:56)
 * @author: Richard Deadman
 * @param newRefMapper net.sourceforge.gjtapi.raw.remote.CallMapper
 */
private void setRefMapper(CallMapper newRefMapper) {
	refMapper = newRefMapper;
}
/**
 * Eat remote shutdown message -- since more than one client may be connected.
 * The provider should handle shutdown from finalize or Unreferenced.
 */
public void shutdown() {}
/**
 * stop method comment.
 */
public void stop(String terminal) {
	this.getReal().stop(terminal);
}
/**
 * stopReportingCall method comment.
 */
public boolean stopReportingCall(int callId) {
	return this.getReal().stopReportingCall(this.getRefMapper().intToCall(callId));
}
/**
 * Translate a JTAPI CallData CallData holder to a Generic CORBA holder.
 * Creation date: (2000-08-23 15:55:52)
 * @author: Richard Deadman
 * @return net.sourceforge.gjtapi.raw.remote.corba.CallData
 * @param cd net.sourceforge.gjtapi.CallData
 */
private net.sourceforge.gjtapi.raw.remote.corba.CallData toCallData(net.sourceforge.gjtapi.CallData cd) {
	return new net.sourceforge.gjtapi.raw.remote.corba.CallData(this.getRefMapper().callToInt(cd.id), cd.callState,
		this.toConnectionData(cd.connections));
}
/**
 * Convert Generic JTAPI ConnectionData holder to CORBA holder
 * Creation date: (2000-08-23 16:00:40)
 * @author: Richard Deadman
 * @return net.sourceforge.gjtapi.raw.remote.corba.ConnectionData[]
 * @param connData net.sourceforge.gjtapi.ConnectionData[]
 */
private net.sourceforge.gjtapi.raw.remote.corba.ConnectionData[] toConnectionData(net.sourceforge.gjtapi.ConnectionData[] connData) {
	int size = connData.length;
	net.sourceforge.gjtapi.raw.remote.corba.ConnectionData[] cd = new net.sourceforge.gjtapi.raw.remote.corba.ConnectionData[size];
	for (int i = 0; i < size; i++) {
		cd[i] = new net.sourceforge.gjtapi.raw.remote.corba.ConnectionData(connData[i].connState,
			connData[i].address, connData[i].isLocal, this.toTCData(connData[i].terminalConnections));
	}
	return cd;
}
/**
 * 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]);
}
/**
 * Convert a LongEntry array to an RTC array
 */
private RTC[] toRTCArray(LongEntry[] rtcs) {
	int size = rtcs.length;
	RTC[] array = new RTC[size];
	for (int i = 0; i < size; i++) {
		array[i] = new RTC(Symbol.getSymbol(rtcs[i].key), Symbol.getSymbol(rtcs[i].value));
	}
	return array;
}
/**
 * Returns a String that represents the value of this object.
 * @return a string representation of the receiver
 */
public String toString() {
	return "Remote Skeleton for: " + this.getReal().toString();
}
/**
 * Convert a LongEntry array to an Symbol Dictionary
 */
private Dictionary toSymbolDictionary(LongEntry[] rtcs) {
	int size = rtcs.length;
	Dictionary dict = new Hashtable();
	for (int i = 0; i < size; i++) {
		dict.put(Symbol.getSymbol(rtcs[i].key), Symbol.getSymbol(rtcs[i].value));
	}
	return dict;
}
/**
 * Convert Generic JTAPI TCData holder to CORBA holder
 * Creation date: (2000-08-23 16:00:40)
 * @author: Richard Deadman
 * @return net.sourceforge.gjtapi.raw.remote.corba.TCData[]
 * @param connData net.sourceforge.gjtapi.TCData[]
 */
 private net.sourceforge.gjtapi.raw.remote.corba.TCData[] toTCData(net.sourceforge.gjtapi.TCData[] tcData) {
	int size = tcData.length;
	net.sourceforge.gjtapi.raw.remote.corba.TCData[] tcd = new net.sourceforge.gjtapi.raw.remote.corba.TCData[size];
	for (int i = 0; i < size; i++) {
		tcd[i] = new net.sourceforge.gjtapi.raw.remote.corba.TCData(tcData[i].tcState,
			this.toTermData(tcData[i].terminal));
	}
	return tcd;
}
/**
 * Translate a Generic JTAPI TermData holder to a CORBA TermData holder.
 * Creation date: (2000-08-23 15:55:52)
 * @author: Richard Deadman
 * @return net.sourceforge.gjtapi.raw.remote.corba.TermData
 * @param cd net.sourceforge.gjtapi.TermData
 */
private net.sourceforge.gjtapi.raw.remote.corba.TermData toTermData(net.sourceforge.gjtapi.TermData td) {
	return new net.sourceforge.gjtapi.raw.remote.corba.TermData(td.terminal, td.isMedia);
}
/**
 * triggerRTC method comment.
 */
public void triggerRTC(String terminal, int action) {
	this.getReal().triggerRTC(terminal, Symbol.getSymbol(action));
}
/**
 * unHold method comment.
 */
public void unHold(int callId, String address, String term) throws net.sourceforge.gjtapi.raw.remote.corba.ResourceUnavailableEx, net.sourceforge.gjtapi.raw.remote.corba.PrivilegeViolationEx, net.sourceforge.gjtapi.raw.remote.corba.RawStateEx, net.sourceforge.gjtapi.raw.remote.corba.MethodNotSupportedEx {
	try {
		this.getReal().unHold(this.getRefMapper().intToCall(callId), address, term);
	} catch (javax.telephony.ResourceUnavailableException rue) {
		throw this.createResourceUnavailableEx(rue);
	} catch (PrivilegeViolationException pve) {
		throw createPrivilegeViolationEx(pve);
	} catch (RawStateException rse) {
		throw createRawStateEx(rse);
	} catch (MethodNotSupportedException nse) {
		throw createMethodNotSupportedEx(nse);
	}
}
}

⌨️ 快捷键说明

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