Examples of NetworkServerControlImpl


Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

     *
     * @throws             Exception on error
     */
    public NetworkServerControl() throws Exception
    {
        serverImpl = new NetworkServerControlImpl();
    }
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

     *
     * @param args  array of arguments indicating command to be executed.
     * See class comments for more information
     */
    public static void main(String args[]) {
        NetworkServerControlImpl server = null;

        //
        // The following variable lets us preserve the error printing behavior
        // seen before we started installing a security manager. Errors can be
        // raised as we figure out whether we need to install a security manager
        // and during the actual installation of the security manager. We need
        // to print out these errors. The old error printing behavior assumed
        // that all errors were generated inside NetworkServerControlImpl and
        // were reported there.
        //
        boolean                                 printErrors = true;
       
        try
        {
            server = new NetworkServerControlImpl();
           
            int     command = server.parseArgs( args );

            // Java 7 and above: file permission restriction
            if (command == NetworkServerControlImpl.COMMAND_START &&
                    JVMInfo.JDK_ID >= JVMInfo.J2SE_17) {
                try {
                    AccessController.doPrivileged(
                        new PrivilegedExceptionAction<Void>() {
                            public Void run() throws Exception {
                                System.setProperty(
                                    Property.SERVER_STARTED_FROM_CMD_LINE,
                                    "true");
                                return null;
                            }});
                } catch (Exception e) {
                    server.consoleExceptionPrintTrace(e);
                    System.exit(1);
                }
            }

            //
            // In order to run secure-by-default, we install a security manager
            // if one isn't already installed. This feature is described by DERBY-2196.
            //
            if ( needsSecurityManager( server, command ) )
            {
                verifySecurityState( server );
                installSecurityManager( server );
            }

            //
            // From this point on, NetworkServerControlImpl is responsible for
            // printing errors.
            //
            printErrors = false;
            server.executeWork( command );
        }
        catch (Exception e)
        {
            //if there was an error, exit(1)
            if ((e.getMessage() == null) ||
                !e.getMessage().equals(NetworkServerControlImpl.UNEXPECTED_ERR) ||
                printErrors
            )
            {
                if (server != null)
                    server.consoleExceptionPrint(e);
                else
                    e.printStackTrace()// default output stream is System.out
            }
            // else, we've already printed a trace, so just exit.
            System.exit(1);
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

     */
    public NetworkServerControl(InetAddress address, int portNumber,
                                String userName, String password)
            throws Exception
    {
        serverImpl = new NetworkServerControlImpl(address, portNumber,
                                                  userName, password);
    }
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

     * @throws             Exception on error
     */
    public NetworkServerControl(String userName, String password)
            throws Exception
    {
        serverImpl = new NetworkServerControlImpl(userName, password);
    }
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

     *                      
     * @throws             Exception on error
     */
    public NetworkServerControl(InetAddress address,int portNumber) throws Exception
    {
        serverImpl = new NetworkServerControlImpl(address, portNumber);
    }
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

     *
     * @throws             Exception on error
     */
    public NetworkServerControl() throws Exception
    {
        serverImpl = new NetworkServerControlImpl();
    }
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

     *
     * @param args  array of arguments indicating command to be executed.
     * See class comments for more information
     */
    public static void main(String args[]) {
        NetworkServerControlImpl server = null;

        //
        // The following variable lets us preserve the error printing behavior
        // seen before we started installing a security manager. Errors can be
        // raised as we figure out whether we need to install a security manager
        // and during the actual installation of the security manager. We need
        // to print out these errors. The old error printing behavior assumed
        // that all errors were generated inside NetworkServerControlImpl and
        // were reported there.
        //
        boolean                                 printErrors = true;
       
        try
        {
            server = new NetworkServerControlImpl();
           
            int     command = server.parseArgs( args );

            // Java 7 and above: file permission restriction
            if (command == NetworkServerControlImpl.COMMAND_START &&
                    JVMInfo.JDK_ID >= JVMInfo.J2SE_17) {
                try {
                    AccessController.doPrivileged(
                        new PrivilegedExceptionAction<Void>() {
                            public Void run() throws Exception {
                                System.setProperty(
                                    Property.SERVER_STARTED_FROM_CMD_LINE,
                                    "true");
                                return null;
                            }});
                } catch (Exception e) {
                    server.consoleExceptionPrintTrace(e);
                    System.exit(1);
                }
            }

            //
            // In order to run secure-by-default, we install a security manager
            // if one isn't already installed. This feature is described by DERBY-2196.
            //
            if ( needsSecurityManager( server, command ) )
            {
                verifySecurityState( server );
                installSecurityManager( server );
            }

            //
            // From this point on, NetworkServerControlImpl is responsible for
            // printing errors.
            //
            printErrors = false;
            server.executeWork( command );
        }
        catch (Exception e)
        {
            //if there was an error, exit(1)
            if ((e.getMessage() == null) ||
                !e.getMessage().equals(NetworkServerControlImpl.UNEXPECTED_ERR) ||
                printErrors
            )
            {
                if (server != null)
                    server.consoleExceptionPrint(e);
                else
                    e.printStackTrace()// default output stream is System.out
            }
            // else, we've already printed a trace, so just exit.
            System.exit(1);
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

   */
  public NetworkServerControl(InetAddress address, int portNumber,
                String userName, String password)
      throws Exception
  {
    serverImpl = new NetworkServerControlImpl(address, portNumber,
                          userName, password);
  }
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

   * @throws         Exception on error
   */
  public NetworkServerControl(String userName, String password)
      throws Exception
  {
    serverImpl = new NetworkServerControlImpl(userName, password);
  }
View Full Code Here

Examples of org.apache.derby.impl.drda.NetworkServerControlImpl

   *                      
   * @throws             Exception on error
   */
  public NetworkServerControl(InetAddress address,int portNumber) throws Exception
  {
    serverImpl = new NetworkServerControlImpl(address, portNumber);
  }
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.