statelistenerambassador.java

来自「Java游戏高级编程!!很不错的!!!Java游戏高级编程!!很不错的」· Java 代码 · 共 69 行

JAVA
69
字号
     package com.croftsoft.core.util.state;

     import java.io.Serializable;
     import java.rmi.*;

     import com.croftsoft.core.lang.ex.*;

     /*********************************************************************
     *
     * An ambassador proxy for StateListenerRemote objects.
     *
     * @author
     *   <A HREF="http://www.alumni.caltech.edu/~croft/">David W. Croft</A>
     * @version
     *   1998-12-05
     *********************************************************************/

     public class  StateListenerAmbassador
       implements StateListener, Serializable
     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     {

     private StateListenerRemote  stateListenerRemote;

     private transient ExceptionListener  exceptionListener;

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////

     public  StateListenerAmbassador (
       StateListenerRemote  stateListenerRemote,
       ExceptionListener    exceptionListener )
     //////////////////////////////////////////////////////////////////////
     {
       this.stateListenerRemote = stateListenerRemote;
       this.exceptionListener   = exceptionListener;
     }

     public  StateListenerAmbassador (
       StateListenerRemote  stateListenerRemote )
     //////////////////////////////////////////////////////////////////////
     {
       this ( stateListenerRemote, new PrintExceptionListener ( ) );
     }

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////

     public void  stateListen ( State  state )
     //////////////////////////////////////////////////////////////////////
     {
       try
       {
         stateListenerRemote.stateListen ( state );
       }
       catch ( Exception  ex )
       {
         if ( exceptionListener != null )
         {
           exceptionListener.threwException ( this, ex );
         }
       }
     }

     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     }

⌨️ 快捷键说明

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