Technologies

I will mostly write about following

Java, J2EE, GWT(Google Web Toolkit), HTML, Javascript, Linux, MacOS, Queue, Docker, Cloud hosting, Auto Scaling, Web, Ad Serving etc.

OpenID and OAuth

First of all OpenID and OAuth are two different standards don’t mix them together. OpenID is only limited to authenticate the end user i.e. getting user authenticated from the third party provider like Google, Yahoo etc. Following are the benefits End user don’t have to remember another credentials for your site. They will be able to authenticate themself with their existing registered account with any of the third party service provider. [Read More]

Intercept GWT Request Factory on client side

How to intercept GWT Request Factory on client before call is being made and after response is received? One can extend DefaultRequestTransport and intercept send call, at the same time writing a wrapper over TrasnportReceiver one can intercept response’s. Following is the example. public class LoaderRequestTransport extends DefaultRequestTransport { private Loader loader; public LoaderRequestTransport(Loader loader) { this.loader = loader; } public LoaderRequestTransport() { this(new Loader(LoaderResources.INSTANCE.communicating())); } @Override public void send(final String payload, final TransportReceiver receiver) { final TransportReceiver proxy = new TransportReceiver() { @Override public void onTransportFailure(final ServerFailure failure) { loader. [Read More]

Intercept GWT RPC Request and Response

Some times you want to do some generic things like setting some header or adding some log or may be even showing a progress bar while rpc call is in progress and hide it once you receive the response. I came across one of such requirement for showing progress bar while service call is in progress. Following is complete end to end solution I found after searching for some solutions. I got some help at following threads and another one [Read More]

Set Servlet RequestScope Guice dependencies

Set some commonly used dependencies which are dependent on some parameter of HTTP Request. The most common use case is to add logged in user context in request scope from session id inside filter. To do that you need to bind such a dependency inside your ServletModule like following. bind(User.class).annotatedWith(Names.named("user")).to(User.class).in(ServletScopes.REQUEST); You are just binding a given User.class with @Named("user") annotation inside RequestScope. Now you have to take care of setting required value when request is made. [Read More]

Access annotated dependencies through injector instance

Following sample will demonstrate how to access guice dependency annotated with some annotation through direct Guice injector instance. Bar.java import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import com.google.inject.BindingAnnotation; @Retention(RetentionPolicy.RUNTIME) @BindingAnnotation public @interface Bar { } Foo.java import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import com.google.inject.BindingAnnotation; @Retention(RetentionPolicy.RUNTIME) @BindingAnnotation public @interface Foo { } TestDepdency.java public interface TestDepdency { String getValue(); } FooTestDependencyImpl.java public class FooTestDependencyImpl implements TestDepdency { @Override public String getValue() { return "Foo"; } } BarTestDependencyImpl. [Read More]

Singleton Factory

Singleton factory for single threaded environment: It is simple to create Singleton factory for single threaded application. public class SingleThreadSingleton { private static SingleThreadSingleton instance; private SingleThreadSingleton() { // Initialise } public static SingleThreadSingleton getInstance() { if (instance == null) { instance = new SingleThreadSingleton(); } return instance; } } Singleton factory for multi threaded application: When you want to create Singleton factory for multi threaded application. In which you want single instance to be maintained across all thread. [Read More]

Free or less costly tools and services helpful for Software Startup

When you are looking to start on your own Software Start-up you need to look for what all free services, tools that can be help full to start with as saving on Money is very important for a startup. Most important for any start-up is to have email for their custom domain. And I suppose most of the people know which is the best and free option to start with Google Apps for 10 users [Read More]

Mulitple persistence Unit with Guice

If you want to use Guice with multiple persistence Unit. Then its not much difficult task to do it, Guice's official wiki document says it all refer. But I feel it has missed out most important part from it i.e. to expose dependencies, if those dependencies need to be used outside the scope of give PrivateModule. Note : I have created a complete working sample with multiple persistent unit refer - https://github. [Read More]

Benefits of using GWT

I have been exploring GWT for 4 years now. I have seen it enhancing and improving year over year. I have also used it in few of my projects. After using it for long I see following benefits of using GWT. I have added these point based on my experience after using GWT. So I might be wrong on some points please feel free to add your comments about the same. [Read More]

GWT Cell Widget sample using UiRenderer with GWT 2.5-RC1

GWT Cell Widget sample using UiRenderer. I tried this sample with GWT 2.5 RC1 release. For official documentation refer. Below sample is simple sample which will display contents of Person entity using custom cell. And such list of entities can be displayed with cell list. Person.java public class Person { private String fname; private String lname; private String emailid; private int age; /** * @return the fname */ public String getFname() { return fname; } /** * @param fname * the fname to set */ public void setFname(String fname) { this. [Read More]