📄 remotelistenerwrapper.java
字号:
package net.sourceforge.gjtapi.raw.remote;
/*
Copyright (c) 2002 8x8 Inc. (www.8x8.com)
All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, provided that the above
copyright notice(s) and this permission notice appear in all copies of
the Software and that both the above copyright notice(s) and this
permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale, use
or other dealings in this Software without prior written authorization
of the copyright holder.
*/
import java.io.Serializable;
import javax.telephony.media.Symbol;
import net.sourceforge.gjtapi.media.*;
import java.rmi.RemoteException;
import net.sourceforge.gjtapi.*;
/**
* This wraps a RemoteListener and makes it look like a RawListener again. The RawProvider can then
* deal with RawObservers as if they are local.
* Creation date: (2000-02-17 13:36:23)
* @author: Richard Deadman
*/
public class RemoteListenerWrapper implements TelephonyListener {
private RemoteListener delegate;
private CallMapper refMapper = null;
/**
* Create a wrapper RawObserver that delegates of to a RemoteObserver.
* Creation date: (2000-02-17 13:36:49)
* @author: Richard Deadman
* @param rl The wrapped RemoteListener stub
* @param mapper A map between RP call ids and serializable call ids.
*/
public RemoteListenerWrapper(RemoteListener rl, CallMapper mapper) {
super();
if (rl == null)
throw new NullPointerException();
else
this.setDelegate(rl);
this.setRefMapper(mapper);
}
/**
* addressPrivateData method comment.
*/
public void addressPrivateData(String address, Serializable data, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().addressPrivateData(address, data, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* callActive method comment.
*/
public void callActive(net.sourceforge.gjtapi.CallId id, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().callActive(this.getRefMapper().swapId(id), cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* callInvalid method comment.
*/
public void callInvalid(net.sourceforge.gjtapi.CallId id, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().callInvalid(this.getRefMapper().swapId(id), cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* callOverloadCeased method comment.
*/
public void callOverloadCeased(java.lang.String address) {
// Try to send the event to the client side
try {
this.getDelegate().callOverloadCeased(address);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* callOverloadEncountered method comment.
*/
public void callOverloadEncountered(java.lang.String address) {
// Try to send the event to the client side
try {
this.getDelegate().callOverloadEncountered(address);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* callPrivateData method comment.
*/
public void callPrivateData(CallId call, Serializable data, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().callPrivateData(this.getRefMapper().swapId(call), data, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionAddressAnalyse method comment.
*/
public void connectionAddressAnalyse(net.sourceforge.gjtapi.CallId id, java.lang.String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionAddressAnalyse(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionAddressCollect method comment.
*/
public void connectionAddressCollect(net.sourceforge.gjtapi.CallId id, java.lang.String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionAddressCollect(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionAlerting method comment.
*/
public void connectionAlerting(CallId id, String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionAlerting(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionAuthorizeCallAttempt method comment.
*/
public void connectionAuthorizeCallAttempt(net.sourceforge.gjtapi.CallId id, java.lang.String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionAuthorizeCallAttempt(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionCallDelivery method comment.
*/
public void connectionCallDelivery(net.sourceforge.gjtapi.CallId id, java.lang.String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionCallDelivery(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionConnected method comment.
*/
public void connectionConnected(CallId id, String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionConnected(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionDisconnected method comment.
*/
public void connectionDisconnected(CallId id, String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionDisconnected(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionFailed method comment.
*/
public void connectionFailed(CallId id, String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionFailed(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionInProgress method comment.
*/
public void connectionInProgress(CallId id, String address, int cause) {
// Try to send the event to the client side
try {
this.getDelegate().connectionInProgress(this.getRefMapper().swapId(id), address, cause);
} catch (RemoteException re) {
// eat
System.err.println("Error pushing events back to client: ");
re.printStackTrace(System.err);
}
}
/**
* connectionSuspended method comment.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -