Package com.cburch.logisim.util

Examples of com.cburch.logisim.util.ZipClassLoader$Request


    // a custom-written class ZipClassLoader instead. The ZipClassLoader
    // is based on something downloaded off a forum, and I'm not as sure
    // that it works as well. It certainly does more file accesses.
   
    // Anyway, here's the line for this new version:
    ZipClassLoader loader = new ZipClassLoader(actual);
   
    // And here's the code that was present up until 2.1.8, and which I
    // know to work well except for the closing-files bit. If necessary, we
    // can revert by deleting the above declaration and reinstating the below.
    /*
    URL url;
    try {
      url = new URL("file", "localhost", file.getCanonicalPath());
    } catch (MalformedURLException e1) {
      throw new LoadFailedException("Internal error: Malformed URL");
    } catch (IOException e1) {
      throw new LoadFailedException(Strings.get("jarNotOpenedError"));
    }
    URLClassLoader loader = new URLClassLoader(new URL[] { url });
    */
   
    // load library class from loader
    Class<?> retClass;
    try {
      retClass = loader.loadClass(className);
    } catch (ClassNotFoundException e) {
      throw new LoadFailedException(StringUtil.format(Strings.get("jarClassNotFoundError"), className));
    }
    if (!(Library.class.isAssignableFrom(retClass))) {
      throw new LoadFailedException(StringUtil.format(Strings.get("jarClassNotLibraryError"), className));
View Full Code Here


        // a custom-written class ZipClassLoader instead. The ZipClassLoader
        // is based on something downloaded off a forum, and I'm not as sure
        // that it works as well. It certainly does more file accesses.

        // Anyway, here's the line for this new version:
        ZipClassLoader loader = new ZipClassLoader(actual);

        // And here's the code that was present up until 2.1.8, and which I
        // know to work well except for the closing-files bit. If necessary, we
        // can revert by deleting the above declaration and reinstating the below.
        /*
        URL url;
        try {
            url = new URL("file", "localhost", file.getCanonicalPath());
        } catch (MalformedURLException e1) {
            throw new LoadFailedException("Internal error: Malformed URL");
        } catch (IOException e1) {
            throw new LoadFailedException(Strings.get("jarNotOpenedError"));
        }
        URLClassLoader loader = new URLClassLoader(new URL[] { url });
        */

        // load library class from loader
        Class<?> retClass;
        try {
            retClass = loader.loadClass(className);
        } catch (ClassNotFoundException e) {
            logger.error( "Class not found" );
            throw new LoadFailedException(getFromLocale("jarClassNotFoundError", className));
        }
        if (!(Library.class.isAssignableFrom(retClass))) {
View Full Code Here

     */
    private static UnitAction convertMethodToUnitAction(final Method method,
        final Resource resource, final String path) {
        String id = method.getId();
        String methodName = method.getName();
        Request request = method.getRequest();

        List<Parameter> parameters = new ArrayList<Parameter>();
        if (request != null) {
            List<Param> params = request.getParamList();
            if (params != null) {
                for (Param param : params) {
                    Parameter parameter = convertParameter(param);
                    parameter.setStyle(Parameter.ParameterStyle.QUERY);
                    parameters.add(parameter);
View Full Code Here

  // These extension requests expect replies
  XProtocolInfo.extensionRequestExpectsReply(major_opcode, 0, 32); // QueryVersion
  XProtocolInfo.extensionRequestExpectsReply(major_opcode, 7, 32); // GetOverlayWindow

  // check version before any other operations
  Request request = new Request (display, major_opcode, 0, 3);
  request.write4 (CLIENT_MAJOR_VERSION);
  request.write4 (CLIENT_MINOR_VERSION);

  Data reply = display.read_reply (request);
  server_major_version = reply.read4 (8);
  server_minor_version = reply.read4 (12);
    }
View Full Code Here

   
    /**
     * Composite opcode 1 - redirect window
     */
    public void redirectWindow(Window window, int update) {
  Request request = new Request (display, major_opcode, 1, 3);
  request.write4 (window.id);
  request.write1 (update);
  request.write1 (0);
  request.write2 (0);
  display.send_request (request);
    }
View Full Code Here

   
    /**
     * Composite opcode 2 - redirect subwindows
     */
    public void redirectSubwindows(Window window, int update) {
  Request request = new Request (display, major_opcode, 2, 3);
  request.write4 (window.id);
  request.write1 (update);
  request.write1 (0);
  request.write2 (0);
  display.send_request (request);
    }
View Full Code Here

   
    /**
     * Composite opcode 3 - unredirect window
     */
    public void unredirectWindow(Window window, int update) {
  Request request = new Request (display, major_opcode, 3, 3);
  request.write4 (window.id);
  request.write1 (update);
  request.write1 (0);
  request.write2 (0);
  display.send_request (request);
    }
View Full Code Here

   
    /**
     * Composite opcode 4 - unredirect subwindows
     */
    public void unredirectSubwindows(Window window, int update) {
  Request request = new Request (display, major_opcode, 4, 3);
  request.write4 (window.id);
  request.write1 (update);
  request.write1 (0);
  request.write2 (0);
  display.send_request (request);
    }
View Full Code Here

    /**
     * Composite opcode 7 - GetOverlayWindow
     */
    public long getOverlayWindow (Window win) {
  Request request = new Request (display, major_opcode, 7, 2);
  request.write4 (win.id);

  Data reply = display.read_reply (request);
  if (reply == null) {
      return -1;
  }
View Full Code Here

    // These extension requests expect replies
    XProtocolInfo.extensionRequestExpectsReply(major_opcode, 0, 32); // QueryVersion

    // check version before any other operations
    Request request = new Request (display, major_opcode, 0, 3);
    request.write4 (CLIENT_MAJOR_VERSION);
    request.write4 (CLIENT_MINOR_VERSION);
 
    Data reply = display.read_reply (request);
    server_major_version = reply.read2 (8);
    server_minor_version = reply.read2 (10);
  }
View Full Code Here

TOP

Related Classes of com.cburch.logisim.util.ZipClassLoader$Request

Copyright © 2018 www.massapicom. 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.