Well, after a pair of roundtrips we finally found a solution to our problem I want to share with in case it could help others.
First I have to mention the help of Colin Alworth, without his support this solution wouldn't be possible at all.
Also I have to mention that I'm not really proud of the final solution but it works for us and for the moment is the best we have.
What we finally did was, as Colin remarks on last post was replacing the GWT.create of each of our service interfaces to create instead the GenericBigService interface.
So our first patch goes like this:
1) Create GenericBigService interface which extends all Service interfaces we have (at the moment 52 interfaces), and also create its Async brother. we done this thru a phytom script.
So our GenericBigInterface looks like this:
package com.arballon.gwt.core.client;
import com.google.gwt.user.client.rpc.RemoteService;
public interface GenericBigService extends RemoteService,
AccountingService,
ActionClassifierService,
AFIPWebService,
AnalyticalService,
AuthorizationService,
BudgetService,
BusinessUnitService,
CatalogPartService,
CategoryService,
ClientDepositService,
.....
.....
{ }
2) We have an Util inner static class in each Service interface to instanciate the Async instance, in there we replace the GWT.create to create the GenericBigInterface.
One of our Service interfaces so looks like this:
public interface FinancialPeriodBalanceCategoryService extends RemoteService {
/**
* Utility class for simplifying access to the instance of async service.
*/
public static class Util {
private static FinancialPeriodBalanceCategoryServiceAsync instance;
public static FinancialPeriodBalanceCategoryServiceAsync getInstance() {
if (instance == null) {
instance = GWT.create(GenericBigService.class);
((ServiceDefTarget)instance).setServiceEntryPoint(GWT.getModuleBaseURL()+"FinancialPeriodBalanceCategoryService");
}
return instance;
}
}
we have to do the serServiceEntyPoint call in order to maintain our web.xml unmodified.
When we first compiles this it compiles ok, but it doesn't work because at runtime the server call throws an Exception:
IncompatibleRemoteServiceException Blocked attempt to access interface GenericBigService
, which is not implemented by FinancialPeriodBalanceCategoryService
Well that was absolutelly right we are calling the service with an interface it doesn't implement, and here is when the ugly part cames in.
We couldn't found a the moment a better solution we can code, that the one we decided to implement that is:
We replace RPC.java with our own copy and we replace the code like this:
in the decodeRequest method we did:
if (type != null) {
/*if (!implementsInterface(type, serviceIntfName)) {
// The service does not implement the requested interface
throw new IncompatibleRemoteServiceException(
"Blocked attempt to access interface '" + serviceIntfName
+ "', which is not implemented by '" + printTypeName(type)
+ "'; this is either misconfiguration or a hack attempt");
}*/
if (!implementsInterface(type, serviceIntfName)) {
if(!serviceIntfName.contains("GenericBigService")){
throw new IncompatibleRemoteServiceException(
"Blocked attempt to access interface '" + serviceIntfName
+ "', which is not implemented by '" + printTypeName(type)
+ "'; this is either misconfiguration or a hack attempt");
}
}
The benefit of doing this was :
1) we went to take an 1 hour and 20 minutes to compite to take only 20 minutes for 6 permutarions.
2) In devMode all starts to run more quickly. Startup remains more or less the same but execution once it starts goes really well.
3) Reduction in the size of compilation was other not minor interesting result, we reduce the left over segment from 6Mb to 1.2Mb, we reduce the whole compilation of JS size in aprox. 50% to 60%.
We are really happy with GWT-RPC and we don't want to leave it, but typeSerializers was really a problem basically because of the size of the JS that results.
With this solution, I know is not very elegant but it works, and it works grate.
Thanks again Colin for your help!
Regards
Daniel