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%
-
10 Sep 2009 5:26 AM #101
A new idea
For my spring integration I'm passed through the RegistryConfiguration, but override the scanner could be a (better?) solution.
It's allow ..- reuse mechanism to retrieve action and method (In my implementation I've duplicate a part of code (ActionScanner)).
- change annotation type (ex: use is own annotation with more params).To do that the Scanner instantiation should be done in a createMethod() and almost all method should be protected .
- change annotation detection (ex: spring allow to find annotation through inheritance contrary to myClass.getAnnotation() ) .
- change method name prefix.
-
15 Sep 2009 6:51 AM #102
Hi Vlagorce,
I have to say that you are making an excelent work with the integration of DirectJNgine - Spring. I am making some test with the JARS, in the previous posts. It's looks very well.
I had some problems to configure the Api File and Folder. For example, if in my ApiActionConfiguration have:
I get an IOException saying \dst\Api-debug.js' exists but is a directory...Code:<bean id="apiConfiguration" class="com.extjs.djn.spring.action.conf.impl.ActionApiConfiguration"> <property name="apiName" value="dst" /> <property name="apiNamespace" value="Ext.dst" /> <property name="apiFile" value="/dst/Api.js" /> </bean>
Do you know how to solve this problem?...
On the other hand, i watched the class SpringRegistryConfiguration. Seems that registry actions, obviating the action paramete of the annotated class. Here is my contribution:
SpringRegistryConfigurator - Line 49
Well thats all!... Thanks for your contribution!.Code:for (IDirectAction directAction : actionApiConfiguration.getListActions()) { Class<?> actionClass = directAction.getClass(); final DirectAction directActionAnnotation = (DirectAction)actionClass.getAnnotation(DirectAction.class); String actionName = actionClass.getSimpleName(); if (directActionAnnotation.action() != null && !directActionAnnotation.action().equals("")) { actionName = directActionAnnotation.action(); } RegisteredAction action = api.addAction(actionClass, actionName); ActionScanner.scanAndRegisterAllKindsOfMethods(registry, api, action); }
Bye!.
-
15 Sep 2009 11:08 PM #103
Vincent,
First of all, congratulations for the nice work
.
...
I am attaching the changes I would like to commit into DirectJNgine in the src.zip file, and some little changes needed in your files to make them work with DJN in the spring_src.zip file. Look for 'PAGULLO' in source files to find the changes.
Main changes I propose to your files are:
- SpringRegistryConfigurator.java: I have made it use Scanner, so we do not risk introducing subtle bugs. In fact, the last post by mauro_monti mentions a problem processing annotations that should dissapear if we use Scanner.
- I think the ActionScanner.java file is not needed anymore.
- SpringDirectJNgineServlet.java: little changes to avoid having to add a doBeforeDjn initialization method in the base servlet. I am trying really hard to introduce as little changes as possible -I know, I'm *really* picky
.
With respect to the global configuration, I feel uneasy too, but can't think of a better way than yours.
Now, let me confess that I haven't configured Spring to run the tests, only what's needed to compile: not too much free time nowadays. I think everything will work, but I'm looking forward for feedback from you.
...
Finally, I want to ask you to support using the default configuration, using web.xml, if only to be able to run all the automated tests to ensure we are not breaking things inadvertently. It should be as easy as writing a pair of additional lines to invoke the default processing...
Additionally, you might want to configure things in Spring so that you can run all automated tests to make sure everything works ok with your extensions. I always run all tests against the latest versions of Firefox, Chrome, IE and Safari before submitting a new release.
...
Again, congratulations
.
RegardsPedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
15 Sep 2009 11:11 PM #104
Yup!
Here are the files...Pedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
15 Sep 2009 11:48 PM #105
One question, can I separate/allocate different remoting provider for batch ajax request?
Currently we use:
Ext.app.REMOTING_API.enableBuffer = 0;
var remotingProvider = Ext.Direct.addProvider(Ext.app.REMOTING_API);
is there a way to assign more than one remotingProvider to the Ext.Direct?
-
16 Sep 2009 2:48 AM #106
Mistake in Scanner.java
Mistake in Scanner.java
Vincent,
I made a mistake in the version of Scanner.java I sent you:
The correct code is:
instead of current one:Code:private void scanAndRegisterActionClass(RegisteredAction action) { assert action != null; // ...
My apologiesCode:private void scanAndRegisterActionClass(RegisteredAction action) { assert action != null; assert !this.registry.hasAction(action.getName()); // REMOVE THIS LINE // ...Pedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
16 Sep 2009 4:45 AM #107
Jay,
Unfortunately, what you need to do is register the same Java class with two different action names, because there is no way you can use the same action name in two different providers at the same time *even* if they define different namespaces.
This is due to the low level protocol used by ExtJs Direct, not related to DJN itself.
There is a 'workaround': create different ExtJs actions for the same Java class for batched and non-batched work, as in
I think there is a way: use the new programmatic API in the 1.1 alpha 1 release to register a new DirectJNgine api that will be used to create the 'alternative' provider.Code:MyAction.myMethod(...); // Invoke MyJavaClass.myMethod MyActionBatched.myMethod( ... ); // Invoke MyJavaClass.myMethod too!
You can do this by getting the default RegisteredApi DJN will have created for you, and copying the existing actions to a new RegisteredApi, but with a different name.
Take a look at the manual/example for further info: it sounds like low level stuff, but once you take a look at the example you'll see that it is really easy.
...
As an aside, why do you need some things to be batched and others not? I'm really curious about the use casePedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
16 Sep 2009 7:53 PM #108
Thanks pagullo again,
In one of my panel, it contains several portlets (panel), each panel owns a dataview and store. That means 10 panels will make 10 AJAX requests to the server.
I'd want to separate these 10 requests into 2 groups, as a result each group has 5 requests.
Why I'm doing that?
If I make 10 requests into 1 batch (by setting the buffer size of remotingProvider), all the portlet's results will be held until all 10 requests got the response from server.
However, I don't want to set the buffersize to 0, which means 10 request will consume 10 individual AJAX requests. It waste a lot of bandwidth (the http header part).
So this is our scenario.
-
17 Sep 2009 3:25 AM #109
I think I get the point...
It would be nice if Extjs allowed us to specify the maximum batch size. Maybe you should request this feature to the ExtJs guys.
And, you might implement some "delay" feature that makes sure not too many requests are batched.
...
Now, if only DirectJNgine were capable of returning whatever individual requests it has finished handling after a "prudential time", returning a batch in several parts...
Maybe when I have more free time: it is not trivial because of multithreaded batched request handling. If somebody is willing to volunteer, I might help with this, though.
...
As an aside...
I think that sometimes batching per-se is not the problem, but mixing potentially slow methods with fast methods in the same batch is.
Being that the case, it might make a lot of sense to separate the slow methods in a different Java classes, and register it in a different api => you can use a non-batching provider for slow mehtods.
Not that this is very elegant, but it might work.
RegardsPedro Agulló, Barcelona (Spain)
Agile team building, consulting, training & development
DirectJNgine: http://code.google.com/p/directjngine - Log4js-ext: http://www.softwarementors.com/projects/p/log4js-ext/
-
17 Sep 2009 3:31 AM #110
Hi Djn people

==================
@mauro_monti
Strange exception.. The spring code just append text. It did not try to create file..
In debug mode did you find witch line of code throw it ?
Thank you
And as Pedro say it's better to reuse the scanner to register actions.
==================
@pagullo
You'r right, I have also made this modification but don't send it :p.
The only modification need in Scanner could be the retrieves of the annotation. I'm not sure it's interesting..
No no.. the less change they have the best it will for everybody
I will check it.
I have not too much time too. I must find time in my working time
May be in the middle of the next week.
I will do that as soon as possible !
ok !
==================
@ ALL
I have made some change in springConfiguration I will send it after making test for pagullo.


Reply With Quote