?? calleventmulticaster.java
字號:
/* * This file is part of the Java SIP library, an open source SIP library. Please see * http://collaboration.mitre.org/sip for more information * * Copyright (c) 2001 The MITRE Corporation * * * This library is free software; you can redistribute it and/or modify it * under the terms of the GNU Library General Public License as published by * the Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public * License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * *//** * Maintains listener list for CallEvents * * @author S.R.Jones * @version 1 */package org.mitre.jsip.event;import java.awt.AWTEventMulticaster;import java.util.EventListener;public class CallEventMulticaster extends AWTEventMulticaster implements CallListener{ protected CallEventMulticaster( EventListener a, EventListener b ) { super( a, b ); } public static CallListener add( CallListener a, CallListener b ) { return (CallListener) addInternal( a, b ); } public static CallListener remove( CallListener cel, CallListener cel_old ) { return (CallListener) removeInternal( cel, cel_old ); } public void responseReceived( CallEvent ce ) { if ( a != null ) ( (CallListener) a ).responseReceived(ce); if ( b != null ) ( (CallListener) b ).responseReceived(ce); } public void requestReceived( CallEvent ce ) { if ( a != null ) ( (CallListener) a ).requestReceived(ce); if ( b != null ) ( (CallListener) b ).requestReceived(ce); } protected static EventListener addInternal( EventListener a, EventListener b ) { if ( a == null ) return b; if ( b == null ) return a; return new CallEventMulticaster( a, b ); } protected EventListener remove( EventListener old_listener ) { if ( old_listener == a ) return b; if ( old_listener == b ) return a; EventListener a2 = removeInternal(a, old_listener); EventListener b2 = removeInternal(b, old_listener); if ( a2 == a && b2 == b ) return this; return addInternal( a2, b2 ); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -