Examples of NetworkServerControl


Examples of org.apache.derby.drda.NetworkServerControl

    /**
     * Stop the network server
     */
    private void stopNetworkServer() {
        try {
            NetworkServerControl networkServer = new NetworkServerControl();
            networkServer.shutdown();
            if (serverOutput != null) {
                serverOutput.close();
            }
        } catch(Exception e) {
            System.out.println("INFO: Network server shutdown returned: " + e);
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

        try {
            String fileName = System.getProperty( "derby.system.home", "")
                    + "serverConsoleOutput.log";
            serverOutput = new FileOutputStream(fileName);

            NetworkServerControl networkServer =
                     new NetworkServerControl(InetAddress.getByName(serverName),
                                              serverPort);
            networkServer.start(new PrintWriter(serverOutput));

            // Wait for the network server to start
            boolean started = false;
            int retries = 10;         // Max retries = max seconds to wait
            while (!started && retries > 0) {
                try {
                    // Sleep 1 second and then ping the network server
          Thread.sleep(1000);
                    networkServer.ping();

                    // If ping does not throw an exception the server has started
                    started = true;
                } catch(Exception e) {
                    System.out.println("INFO: ping returned: " + e);
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

   * </p>
   */
  private  void  ping( boolean shouldBeUp )
    throws Exception
  {
    NetworkServerControl  controller = new NetworkServerControl();
    Exception        finalException = null;
    boolean          isUp = false;
   
    for ( int i = 0; i < PING_COUNT; i++ )
    {
      try {
        controller.ping();
        isUp = true;
        println( "Network server came up!" );
       
        break;
      }
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

   * </p>
   */
  private  void  bringDownServer()
    throws Exception
  {
    NetworkServerControl  controller = new NetworkServerControl();

    controller.shutdown();
  }
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

        // Start the NetworkServer on another thread, unless it's a remote host
        if (hostName.equals("localhost"))
        {
            try
            {
                networkServer = new NetworkServerControl(InetAddress.getByName(hostName),NETWORKSERVER_PORT);
                networkServer.start(new PrintWriter(serverOutput));
            }catch(Exception e)
            {
                if ( derby_drda_securityMechanism[i].equals("INVALID_VALUE")||
                        derby_drda_securityMechanism[i].equals(""))
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

                    }
                    return fos;
                }
            });

            networkServerController = new NetworkServerControl
                (InetAddress.getByName(config.getHostName()), config.getPort());
           
            networkServerController.start(new PrintWriter(serverOutput));
           
            final long startTime = System.currentTimeMillis();
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

   * </p>
   */
  public  void  ping( int iterations )
    throws Exception
  {
    ping( new NetworkServerControl(), iterations );
  }
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

      e.printStackTrace();
  }
 
 
  networkServer =
      new NetworkServerControl(InetAddress.getByName("localhost"),
             1527);
  networkServer.start( null );
     
  if(! isServerStarted( networkServer,
            60 ) )
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

           
      ij.getPropertyArg(args);

            ByteArrayOutputStream bos = new ByteArrayOutputStream();

            testServer(new NetworkServerControl(), bos, "non-null PrintWriter");
            testServer(new NetworkServerControl(), null, "null PrintWriter");
        }
        catch( Exception e)
        {
            e.printStackTrace();
            passed = false;
View Full Code Here

Examples of org.apache.derby.drda.NetworkServerControl

  private static void waitForStart(String portString, int timeToWait) throws Exception
  {
    int waitTime = 0;
    int port = Integer.parseInt(portString);
   
    NetworkServerControl derbyServer = new NetworkServerControl( InetAddress.getByName("localhost"),
                          port);
   
   

        while (waitTime < timeToWait) {
            try {
                derbyServer.ping();
                return;
            } catch (Exception e) {
        Thread currentThread = Thread.currentThread();
        synchronized (currentThread) {
                    try {
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.