View Poll Results: If you read it, did you find DirectJNgine User's Guide adequate?

Voters
54. You may not vote on this poll
  • Yes

    40 74.07%
  • No

    14 25.93%
  1. #21
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Pedro, one thing that I am used to from DWR, is not including a hardcoded (Even if it's generated) file to specify the API, but includnig a request to a servlet to generate it on the fly..

    Instead of having the servlet generate a named file the name of which is a mandatory config, how about we make the API file name optional, and have it only create it if the ApiConfiguration.Parameters.API_FILE is specified in the servletConfig?

    Then just serve the API directly, generating it as needed:

    Changes to DirectJNgineServlet
    Code:
      @Override
      public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
    
    //  Allow client to include <script type="text/javascript" src="/djn_test/djn/directprovider/?getApi"></script>
        if (request.getParameter("getApi") != null) {
            registry.writeApiScript(this.globalConfiguration, response.getWriter());
            return;
        }
    
        RequestType type = getFromRequestContentType(request);
        response.setContentType("text/html"); // MUST be "text/html" for uploads to work!
    
        switch( type ) {
          case FORM_SIMPLE_POST:
            this.processor.processSimpleFormPostRequest( request.getReader(), response.getWriter() );
            break;
          case FORM_UPLOAD_POST:
            processUploadFormPost(request, response);
            break;
          case JSON:
            this.processor.processJsonRequest( request.getReader(), response.getWriter() );
            break;
          case POLL:
            this.processor.processPollRequest( request.getReader(), response.getWriter(), request.getPathInfo() );
            break;
        }
      }
    Addition to Registry
    Code:
      public void writeApiScript(GlobalConfiguration globalConfiguration, Writer out) throws IOException {
          assert globalConfiguration != null;
          
          StringBuilder result = new StringBuilder();
          for( RegisteredApi api : getApis() ) {
            ApiCodeGenerator generator = new ApiCodeGenerator( globalConfiguration, api );
            generator.appendCode(result);
          }
          out.append(result);
        }
    Of course until we get a build script we can't really experiment with the code...

  2. #22
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Of course you'd probably implement a new RequestType enum member.

  3. #23
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    maxim:
    Agreed!

    That said, I think you might get what you want by subclassing from DirectJNgineServlet. Next version will provide some refactorings that might make this easier (some protected methods to override...).

    ...

    animal:
    Just so that I get a better understanding... Is there some issue I'm missing about having a generated file vs. generating the content on the fly? Can you elaborate on why you would like to have the request content generated on the fly?

    There is a nice pro about using a generated file: if it is not modified, the client will know and there will be no need to transfer the file content. The client pays for posing the "do I need to read the file again?" question, but does not pay for the data transfer unless the file has been modified. And the web server will do this without DirectJNgine having to do anything.

    BTW: we generate the file only when it is strictly needed, not every time we initialize the servlet, much less every time the file is requested. Maybe you were worried about the files being rewritten all too often?

    Those are the reasons why I had chosen the "generated file" approach.

    Now, If the mandatory file name parameter bugs users, we might make it optional by providing a default file name, such as "DirectJNgineApi.js". I think this is pretty minor, though.

    Have the feeling that maybe I am missing something, though...

    ...

    There are several api-related enhancements already finished in current development version that might be relevant to the discussion at hand:

    - Api files will be minified: for an xxx.js api file you will get xxx-debug.js (well formatted and very readable, includes comments that describe the Java parameter/return types), xx-min.js (no comments, minified) and xxx.js. If in debug mode, xxx.js will be equivalent to xxx-debug.js, else it will be equivalent to xxx-min.js.

    BTW: I would not like to have to minify files on the fly, it is relatively slow because we are using YUI Compressor, probably the best and slowest one (near 300 ms to minify the test api file...).

    - Api consolidation: several apis can be consolidated in just one api file. Why?

    1) You get get logical encapsulation: for example, in the test/demo app we have separated demo and test apis, as I feel they are different things.

    2) You get finer configuration : all methods belonging to an api belong to just one provider. You can configure different providers differently.

    3) The client receives just one file, minimizing number of client-server transfers.

    BTW: I hope I had made it more clear that "api"="provider" in the User's Guide.

  4. #24
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    DirectJNgine 1.0 RC1 is out, with several new features and improvements. You can donwload it here.

    From now on we plan to fix issues, perform some cleanup and enhance the User’s Guide a bit so that we can release DirectJNgine 1.0 final as soon as possible, without adding any more functionality or changing the API.

    Of course, that's the plan: we are open to adding new features if they turn out to be really important, and revamp existing ones if we must. While we intend to release 1.0 final as soon as possible, it is much more important that the final release is robust, has a solid api, and is feature complete.

    We look forward to receive feedback from the community in order to make 1.0 final as good as possible!

    ...

    Here is a list of new and improved things in this release...

    New: support for custom Gson configuration and serialization/deserialization
    Gson is very powerful, but there will be cases when you might need to change its configuration or customize how to handle certain Java types.
    Need to pass Java Calendars around? You can do it now!

    New: multithreaded batched request handling
    DirectJNgine supports multithreaded individual request handling for batched requests, making it possible to get much better performance in certain scenarios.

    New: minification and comment removal from generated API files
    Minimize size of API files, optimizing data transfer.
    As an example, we have found that our test api file is compressed from 14.689 to 7.103 bytes, a 52% compression.

    New: mutiple API consolidation in a single file
    Now you can group several Ext Direct APIs in a single file, minimizing the number of requests a client needs to retrieve a page.

    New: build.xml for ant users
    We provide support for compilation and demo war generation/deployment with ant, to make life easier to those interested in playing with DirectJNgine.

    New: performance data logging
    We are generating logs for performance data: how much time is spent in DirectJNgine, how much in your Java methods, the time it takes to start DirectJNgine, minify the api files, serve individual requests in a batched request, etc.

    Improved: better and faster logging
    We have enhanced logging to get better diagnostics and know what log messages are part of a given request.
    We have improved performance removed all overhead from logs, so that you only pay for debug logging if you have it activated: there is near zero overhead if you have no debug logging.

    Improved: User’s Guide
    The User’s Guide has been augmented with additional chapters explaining the new features, and has grown to 30 pages in length.

    Improved: general performance improvements
    We think DirectJNgine is very fast.
    As an example, during repeated test execution in a Core Duo running at 3.33 GHz we have found that 90% of the individual requests consumed less than 5 ms in DirectJNgine itself.

    Besides, the new api generation functionality and multithreaded execution of batched requests make it even faster.

  5. #25
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,483
    Vote Rating
    35
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    I feel sure I've replied today...

    Anyway. Thanks for the update. Especially the ANT script.

    Perhaps the API file could have a default name based on the name of the API.

    So my config could be

    Code:
        <init-param>
          <param-name>apis</param-name>
          <param-value>aspicio</param-value>
        </init-param>
        
        <init-param>
          <param-name>aspicio.apiFile</param-name>
          <param-value>aspicio-api.js</param-value>
        </init-param>
    
        <init-param>
          <param-name>aspicio.namespace</param-name>
          <param-value>com.aspicio</param-value>
        </init-param>
    
        <init-param>
          <param-name>aspicio.classes</param-name>
          <param-value>com.fcl.net.MailUtils</param-value>
        </init-param>
    And it would still create "aspicio-api.js".

    Also, that creates the api file like

    Code:
    Ext.namespace( 'com.aspicio');
    
    com.aspicio.PROVIDER_BASE_URL=window.location.protocol + '//' + window.location.host + '/' + (window.location.pathname.split('/')[1]) + '/' + 'djn/directprovider';
    
    com.aspicio.POLLING_URLS = {
    }
    
    com.aspicio.REMOTING_API = {
      url: com.aspicio.PROVIDER_BASE_URL,
      type: 'remoting',
      actions: {
        MailUtils: [
          {
            name: 'sendMail'/*(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) => java.lang.String */,
            len: 5,
            formHandler: false
          }
        ]
      }
    }
    The semicolons are missing.

    Also, it needs to tell the Provider what namespace it is in! The provider cannot "detect" that it is in com.aspicio, so it should be

    Code:
    Ext.namespace( 'com.aspicio');
    
    com.aspicio.PROVIDER_BASE_URL=window.location.protocol + '//' + window.location.host + '/' + (window.location.pathname.split('/')[1]) + '/' + 'djn/directprovider';
    
    com.aspicio.POLLING_URLS = {
    };
    
    com.aspicio.REMOTING_API = {
      namespace: com.aspicio,
      url: com.aspicio.PROVIDER_BASE_URL,
      type: 'remoting',
      actions: {
        MailUtils: [
          {
            name: 'sendMail'/*(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) => java.lang.String */,
            len: 5,
            formHandler: false
          }
        ]
      }
    };
    But why also is that Provider not instantiated? Why is the file not

    Code:
    Ext.namespace( 'com.aspicio');
    
    com.aspicio.PROVIDER_BASE_URL=window.location.protocol + '//' + window.location.host + '/' + (window.location.pathname.split('/')[1]) + '/' + 'djn/directprovider';
    
    com.aspicio.POLLING_URLS = {
    };
    
    com.aspicio.REMOTING_API = {
      namespace: com.aspicio,
      url: com.aspicio.PROVIDER_BASE_URL,
      type: 'remoting',
      actions: {
        MailUtils: [
          {
            name: 'sendMail'/*(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) => java.lang.String */,
            len: 5,
            formHandler: false
          }
        ]
      }
    };
    
    Ext.Direct.addProvider(com.aspicio.REMOTING_API);

  6. #26
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    - With respect to using a default api file name, like your idea.

    Will be there in DJN 1.0 final, probably using the naming suggestion you provide.

    Thanks!

    - The 'namespace' configuration parameter
    There is a really *little* but *very nasty* issue, which is the reason why I didn't add it as you suggest from day one.

    The direct examples in ExtJs do not use namespaces for the apis, and I really want people to be able to run them against DirectJNgine without having to change more than one line of code per example file.

    If I add the namespace configuration parameter to the demo api as you suggest, it will take as value Ext.App.
    Then the calls to the methods in ExtJs direct examples will have to be modified to something like

    Code:
    Ext.App.TestAction.doEcho(...)
    instead of the existing

    Code:
    TestAction.doEcho(...)
    Asking people to modify one line to port from PHP backend to Java backed is ok, telling them to "look for all occurrences of all methods (you check what 'all' is)" is not.

    They will think "why does that DirectJNgine thing force me to do all those changes? Must no be that good".
    And they will be right, software is as software does...

    On the other hand, I need the apiNamespace not to be empty: I don't want two global 'REMOTING_API' or 'PROVIDER_BASE_URL' occurrences if I generate two apis.
    I want them namespaced. That's what apiNamespace was for in the beginning.

    That's why namespace is not set to apiNamespace: the obvious thing to do is not good enough. I know, very picky!

    But I want to use the 'namespace' config param, it was already in the "to polish" list for 1.0 final...

    Maybe I should provide two parameters, actionNamespace and apiNamespace? But, don't like it, really.

    But, why not to use the api name much like you suggested for the default file api name?

    If apiNamespace is blank, use the api name as the namespace for REMOTING_API, etc., and ignore the namespace config param.
    Else, use apiNamespace both for the namespace config param and the REMOTING_API namespace!

    This solves the problem with the ExtJs direct examples, I just remove the apiNamespace parameter or leave it blank for them.

    Hmm. Looks better.

    No matter how the thing is solved, namespace must be supported.
    It will be there in 1.0 final, sure "as the day follows the night" .

    - Missing ";": though everything works well without them (am I right?), it is a good coding practice.

    When I have some time will run all JS files against JSLint, and will clean all JS code.
    I'm sure there are more of these, 95% of my attention is focused in the Java side of the equation...

    - Registering the provider in the generated api file
    Alpha versions did that. Why did I remove it?
    In one of my files, I have this, to test for non-batched requests:

    Code:
      DjnTestApi.REMOTING_API.enableBuffer = 0;
      var remotingProvider = Ext.Direct.addProvider( DjnTestApi.REMOTING_API);
    If we had called addProvider in the api file, this would be the second registration for the api.
    Hmm. Does not feel right.

    Think will not do into 1.0 final.

    ...

    Thanks for the feedback. I know it takes time!

    BTW: let me kow how it goes with the enclosed build.xml.
    Not completely happy with it, so if you can improve it, I will be happy to add your improvements.

  7. #27
    Ext User mct's Avatar
    Join Date
    Dec 2008
    Posts
    12
    Vote Rating
    0
    mct is on a distinguished road

      0  

    Default OpenJDK

    OpenJDK


    Hi, I deployed one application that retrieves data from PostgreSQL on Tomcat 6.0.20 with java-6-sun as the JVM, it works very good.
    But when I change the Tomcat's JVM to java-6-openjdk, the application stops retrieving data with errors. So please try to change the JVM on your test machine and see if you have the same problem.
    The OpenJDK is very important for me because we are working on Ubuntu, and on Ubuntu Server the OpenJDK is the default one.
    Excuse me for my English.



    Best Regards

  8. #28
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    Hi.

    Can you be more specific?

    - When does it stop working? At startup? Trying to satisfy some kind of request? Inside your own Java code, in DirectJNgine code, or somewhere else? Simplify your app. to the bare mimimum to isolate the problem as much as possible.
    - What messages do appear? Stack trace?
    - Turn logging to ALL for "com.softwarementors" in log4j.properties, and take a look at it.
    - And, are you sure this is DirectJNgine related?

    Regards,

    Pedro.

  9. #29
    Ext User mct's Avatar
    Join Date
    Dec 2008
    Posts
    12
    Vote Rating
    0
    mct is on a distinguished road

      0  

    Default


    Hi,
    Here is the message under eclipse console:

    Code:
    23 juil. 2009 14:51:30 org.apache.catalina.core.ApplicationContext log
    GRAVE: StandardWrapper.Throwable
    java.lang.RuntimeException
        at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber(JavaScriptCompressor.java:299)
        at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:336)
        at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
        at com.softwarementors.extjs.djn.config.Minifier.minify(Minifier.java:42)
        at com.softwarementors.extjs.djn.config.Registry.saveCode(Registry.java:366)
        at com.softwarementors.extjs.djn.config.Registry.updateJavascriptApiFiles(Registry.java:330)
        at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:119)
        at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:99)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:636)
    23 juil. 2009 14:51:30 org.apache.catalina.core.StandardWrapperValve invoke
    GRAVE: Exception lors de l'allocation pour la servlet DjnServlet
    java.lang.RuntimeException
        at com.yahoo.platform.yui.compressor.JavaScriptCompressor.printSourceNumber(JavaScriptCompressor.java:299)
        at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:336)
        at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
        at com.softwarementors.extjs.djn.config.Minifier.minify(Minifier.java:42)
        at com.softwarementors.extjs.djn.config.Registry.saveCode(Registry.java:366)
        at com.softwarementors.extjs.djn.config.Registry.updateJavascriptApiFiles(Registry.java:330)
        at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.createDirectJNgineRouter(DirectJNgineServlet.java:119)
        at com.softwarementors.extjs.djn.servlet.DirectJNgineServlet.init(DirectJNgineServlet.java:99)
        at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
        at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
        at java.lang.Thread.run(Thread.java:636)
    
    and here the log4j.properties :
    Code:
    ##############################################################
    # Loggers: per-package configuration
    ##############################################################
    
    log4j.logger.com.softwarementors.extjs.djn=ALL
    log4j.logger.com.softwarementors.extjs.djn.Timer=ALL
    Regards.

  10. #30
    Ext JS Premium Member
    Join Date
    May 2009
    Location
    Barcelona (Spain)
    Posts
    218
    Vote Rating
    19
    pagullo will become famous soon enough pagullo will become famous soon enough

      0  

    Default


    Not a DirectJNgine related problem.

    Just a known bug for some OpenJDK version + YUI Compressor library in Ubuntu...Take a look at https://bugs.launchpad.net/ubuntu/+s...-6/+bug/287035, please.

    They mention some kind of fix. Let us know how it all ends up, please.

    If you can't make it work or can't find a workaround, I will consider adding the possibility to bypass api files minification...

    Regards,

    Pedro

Thread Participants: 86

  1. Animal (5 Posts)
  2. barton (4 Posts)
  3. Condor (1 Post)
  4. mauro_monti (6 Posts)
  5. mbarto (1 Post)
  6. aconran (1 Post)
  7. MoShAn480 (1 Post)
  8. asgillett (2 Posts)
  9. seade (4 Posts)
  10. zaqwsxqwer (3 Posts)
  11. Sesshomurai (16 Posts)
  12. ThierryC (3 Posts)
  13. maxm165 (3 Posts)
  14. techstudios (2 Posts)
  15. sayonara (2 Posts)
  16. kschlaudt (1 Post)
  17. hschaefer123 (2 Posts)
  18. omarc (2 Posts)
  19. lxbzmy (4 Posts)
  20. mct (6 Posts)
  21. mediacept (2 Posts)
  22. dionisexorcius (1 Post)
  23. alper (1 Post)
  24. steverc (2 Posts)
  25. chrizmaster (18 Posts)
  26. J@y (21 Posts)
  27. Georgioa (6 Posts)
  28. wguan (1 Post)
  29. minneyar (16 Posts)
  30. jhoweaa (1 Post)
  31. Ramez (2 Posts)
  32. malus (1 Post)
  33. dweller (8 Posts)
  34. stdunbar (1 Post)
  35. vlagorce (20 Posts)
  36. cwilliso (1 Post)
  37. Whatty (13 Posts)
  38. Ice (1 Post)
  39. clynnh (1 Post)
  40. SreevaniN (1 Post)
  41. Stsalomon90 (1 Post)
  42. GregT (9 Posts)
  43. jcalfee (6 Posts)
  44. set_ti (1 Post)
  45. maho2nd (3 Posts)
  46. dreamtaotao (3 Posts)
  47. Toxa (4 Posts)
  48. tungchau (3 Posts)
  49. wlan0 (2 Posts)
  50. jpr (2 Posts)
  51. gianmarco (5 Posts)
  52. extjslikeit (2 Posts)
  53. harmen_wessels (1 Post)
  54. Olivercomputing2 (4 Posts)
  55. vanessa_ng (2 Posts)
  56. alois.cochard (5 Posts)
  57. kyrillos52 (2 Posts)
  58. Tod (1 Post)
  59. Alinanila (1 Post)
  60. tfannon (2 Posts)
  61. Kynao (1 Post)
  62. feiq (4 Posts)
  63. dalt (1 Post)
  64. xfolch (1 Post)
  65. avijit (1 Post)
  66. marcelsnews (2 Posts)
  67. maddhippy (1 Post)
  68. sritter (1 Post)
  69. july (2 Posts)
  70. jtkeller7983 (1 Post)
  71. lfranchini (2 Posts)
  72. 7/11 (2 Posts)
  73. yAdEs (1 Post)
  74. zazz (1 Post)
  75. waqar (5 Posts)
  76. pjain11 (1 Post)
  77. alexMobimesh (2 Posts)
  78. zachHurt (4 Posts)
  79. n0n3 (5 Posts)
  80. adavis2 (1 Post)
  81. mark.peters (1 Post)
  82. lee el (4 Posts)
  83. frengo19 (3 Posts)
  84. prakashwagle (1 Post)
  85. extejnar (2 Posts)
  86. alin@sonatype.com (1 Post)

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar