StateMulticasterProxy.java :  » Game » easy-game-client » com » croftsoft » core » util » state » Java Open Source

Java Open Source » Game » easy game client 
easy game client » com » croftsoft » core » util » state » StateMulticasterProxy.java
     package com.croftsoft.core.util.state;

     import java.rmi.*;
     import java.rmi.server.UnicastRemoteObject;

     /*********************************************************************
     *
     * An adapter for StateMulticasters of remote States.
     *
     * @author
     *   <a href="http://www.CroftSoft.com/">David Wallace Croft</a>
     * @version
     *   1998-12-05
     *********************************************************************/

     public class  StateMulticasterProxy
       extends UnicastRemoteObject implements StateMulticasterRemote
     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     {

     private StateMulticaster  stateMulticaster;

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

     public static void  main ( String [ ]  args )
     //////////////////////////////////////////////////////////////////////
     {
       String  name = "StateMulticasterProxy";

       if ( args.length > 0 ) name = args [ 0 ];

       try
       {
         Naming.rebind ( name, new StateMulticasterProxy (
           new QueuedStateMulticaster ( ) ) );
       }
       catch ( Exception  ex )
       {
         ex.printStackTrace ( );
       }
     }

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

     public  StateMulticasterProxy ( StateMulticaster  stateMulticaster )
       throws RemoteException
     //////////////////////////////////////////////////////////////////////
     {
       this.stateMulticaster = stateMulticaster;
     }

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

     public void  update ( State  state )
       throws RemoteException
     //////////////////////////////////////////////////////////////////////
     {
       stateMulticaster.update ( state );
     }

     public boolean  addStateListener ( StateListener  stateListener )
       throws RemoteException
     //////////////////////////////////////////////////////////////////////
     {
       return stateMulticaster.addStateListener ( stateListener );
     }

     public boolean  removeStateListener ( StateListener  stateListener )
       throws RemoteException
     //////////////////////////////////////////////////////////////////////
     {
       return stateMulticaster.removeStateListener ( stateListener );
     }


     //////////////////////////////////////////////////////////////////////
     //////////////////////////////////////////////////////////////////////
     }
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.