Examples of Intrepid


Examples of com.starlight.intrepid.Intrepid

      System.out.println( "                           try_client <port>" );
      return;
    }

    if ( args[ 0 ].equalsIgnoreCase( "server" ) ) {
      Intrepid instance = Intrepid.create( new IntrepidSetup().openServer() );
      System.out.println( "Server listening on port " + instance.getServerPort() );

      ConnectionDebugPane pane = new ConnectionDebugPane( instance );
      UIKit.testComponent( pane );
    }
    else if ( args[ 0 ].equalsIgnoreCase( "try_client" ) ) {
      int port = Integer.parseInt( args[ 1 ] );

      Intrepid instance = Intrepid.create( null );

      ConnectionDebugPane pane = new ConnectionDebugPane( instance );
      UIKit.testComponent( pane );

      System.out.println( "Connecting to server..." );

      instance.tryConnect( InetAddress.getLocalHost(), port, null, null,
        10, TimeUnit.MINUTES );
    }
    else {
      int port = Integer.parseInt( args[ 1 ] );

      Intrepid instance = Intrepid.create( null );

      System.out.println( "Connecting to server..." );

      instance.connect( InetAddress.getLocalHost(), port, null, null );
    }
  }
View Full Code Here

Examples of com.starlight.intrepid.Intrepid

    if ( args.length > 0 ) {
      port = Integer.parseInt( args[ 0 ] );
    }

    System.out.print( "Initializing..." );
    Intrepid intrepid = Intrepid.create(
      new IntrepidSetup().serverPort( port ).openServer() );
    intrepid.addPerformanceListener( new PerformanceListener() {
      @Override
      public void inboundRemoteCallCompleted( VMID instance_vmid, long time,
        int call_id, Object result, boolean result_was_thrown ) {

        System.out.println( "INBOUND call completed: " + call_id );
      }

      @Override
      public void remoteCallStarted( VMID instance_vmid, long time, int call_id,
        VMID destination_vmid, int object_id, int method_id, Method method,
        Object[] args, UserContextInfo user_context, String persistent_name ) {

        System.out.println( "call started: " + call_id + " - " + method );
      }

      @Override
      public void remoteCallCompleted( VMID instance_vmid, long time, int call_id,
        Object result, boolean result_was_thrown, Long server_time ) {

        System.out.println( "call completed: " + call_id );
      }

      @Override
      public void inboundRemoteCallStarted( VMID instance_vmid, long time,
        int call_id, VMID source_vmid, int object_id, int method_id,
        Method method, Object[] args, UserContextInfo user_context,
        String persistent_name ) {

        System.out.println( "INBOUND call started: " + call_id );
      }


      @Override
      public void virtualChannelClosed( VMID instance_vmid, VMID peer_vmid,
        short channel_id ) {
        // TODO: implement
      }

      @Override
      public void virtualChannelOpened( VMID instance_vmid, VMID peer_vmid,
        short channel_id ) {
        // TODO: implement
      }

      @Override
      public void virtualChannelDataReceived( VMID instance_vmid, VMID peer_vmid,
        short channel_id, int bytes ) {
        // TODO: implement
      }

      @Override
      public void virtualChannelDataSent( VMID instance_vmid, VMID peer_vmid,
        short channel_id, int bytes ) {
        // TODO: implement
      }

      @Override
      public void messageReceived( VMID source_vmid, IMessage message ) {}

      @Override
      public void messageSent( VMID destination_vmid, IMessage message ) {}

      @Override
      public void leasedObjectRemoved( VMID vmid, int object_id ) {}

      @Override
      public void leaseInfoUpdated( VMID vmid, int object_id,
        String delegate_tostring, boolean holding_strong_reference,
        int leasing_vm_count, boolean renew, boolean release ) {}
    } );
    System.out.println( "done." );

    System.out.print( "Binding to registry..." );
    intrepid.getLocalRegistry().bind( ServerInterface.class.getName(), new TestServer() );
    System.out.println( "done." );

    System.out.println( "Server ready!" );

    new Thread() {
View Full Code Here

Examples of com.starlight.intrepid.Intrepid

      System.out.println( "                           try_client <port>" );
      return;
    }

    if ( args[ 0 ].equalsIgnoreCase( "server" ) ) {
      Intrepid instance = Intrepid.create( new IntrepidSetup().openServer() );
      System.out.println( "Server listening on port " + instance.getServerPort() );

      LeaseDebugPane pane = new LeaseDebugPane( instance );
      UIKit.testComponent( pane );
    }
    else if ( args[ 0 ].equalsIgnoreCase( "try_client" ) ) {
      int port = Integer.parseInt( args[ 1 ] );

      Intrepid instance = Intrepid.create( null );

      LeaseDebugPane pane = new LeaseDebugPane( instance );
      UIKit.testComponent( pane );

      System.out.println( "Connecting to server..." );

      instance.tryConnect( InetAddress.getLocalHost(), port, null, null,
        10, TimeUnit.MINUTES );
    }
    else {
      int port = Integer.parseInt( args[ 1 ] );

      Intrepid instance = Intrepid.create( null );

      System.out.println( "Connecting to server..." );

      instance.connect( InetAddress.getLocalHost(), port, null, null );
    }
  }
View Full Code Here

Examples of com.starlight.intrepid.Intrepid

/**
*
*/
public class MINAIntrepidSPITest extends TestCase {
  public void testAnonymousPortServer() {
    Intrepid instance = null;
    try {
      MINAIntrepidSPI spi = new MINAIntrepidSPI();
      instance = Intrepid.create( new IntrepidSetup().openServer().spi( spi ) );

      System.out.println( "Server address: " + spi.getServerAddress() );
      assertNotNull( spi.getServerAddress() );
    }
    catch( Exception ex ) {
      ex.printStackTrace();
      fail( "Unexpected error received: " + ex );
    }
    finally {
      if ( instance != null ) instance.close();
    }
  }
View Full Code Here

Examples of com.starlight.intrepid.Intrepid

      if ( instance != null ) instance.close();
    }
  }

  public void testSpecificPortServer() {
    Intrepid instance = null;
    try {
      MINAIntrepidSPI spi = new MINAIntrepidSPI();
      instance = Intrepid.create(
        new IntrepidSetup().openServer().spi( spi ).serverPort( 11751 ) );

      System.out.println( "Server address: " + spi.getServerAddress() );
      assertNotNull( spi.getServerAddress() );
      assertEquals( 11751, spi.getServerAddress().getPort() );
    }
    catch( Exception ex ) {
      ex.printStackTrace();
      fail( "Unexpected error received: " + ex );
    }
    finally {
      if ( instance != null ) instance.close();
    }
  }
View Full Code Here

Examples of com.starlight.intrepid.Intrepid

  public static <T> void dropToCaller( ID<T> id, T object, boolean compress )
    throws ChannelRejectedException, IOException {

    VMID vmid = IntrepidContext.getCallingVMID();
    Intrepid instance = IntrepidContext.getActiveInstance();

    if ( vmid != null && instance == null ) {
      throw new IllegalStateException(
        Resources.ERROR_DROP_WITH_VMID_BUT_NO_INSTANCE.getValue() );
    }
View Full Code Here

Examples of com.starlight.intrepid.Intrepid

      IntrepidTestProxyAccess.getHostVMID( listener );
  }


  public static void main( String[] args ) throws Exception {
    Intrepid instance = Intrepid.create( new IntrepidSetup().openServer() );

    final LeaseServer server = new LeaseServer();
    instance.getLocalRegistry().bind( "server", server );

    instance.addPerformanceListener( new LeaseListener() );


    System.out.println(
      "Server listening on port " + instance.getServerPort() + "..." );


    SharedThreadPool.INSTANCE.scheduleAtFixedRate( new GarbageCreator(),
      250, 250, TimeUnit.MILLISECONDS );
View Full Code Here

Examples of com.starlight.intrepid.Intrepid

    System.out.println( new Date() + ": run()" );
  }


  public static void main( String[] args ) throws Exception {
    Intrepid intrepid = Intrepid.create( null );
    VMID server_vmid = intrepid.connect( InetAddress.getLocalHost(),
      Integer.parseInt( args[ 0 ] ), null, null );

    intrepid.addPerformanceListener( new LeaseListener() );

    Registry registry = intrepid.getRemoteRegistry( server_vmid );

    ServerIfc server = ( ServerIfc ) registry.lookup( "server" );
    server.addListener( new ListenerClient() );

    SharedThreadPool.INSTANCE.scheduleAtFixedRate( new GarbageCreator(),
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.