Example usage for com.google.gwt.requestfactory.shared ServiceLocator getInstance

List of usage examples for com.google.gwt.requestfactory.shared ServiceLocator getInstance

Introduction

In this page you can find the example usage for com.google.gwt.requestfactory.shared ServiceLocator getInstance.

Prototype

Object getInstance(Class<?> clazz);

Source Link

Document

Returns an instance of the service object.

Usage

From source file:com.acme.gwt.server.InjectableServiceLayerDecorator.java

License:Apache License

@Override
public Object createServiceInstance(Method contextMethod, Method domainMethod) {
    // Check if the request needs a service locator
    Class<? extends ServiceLocator> locatorType = getTop().resolveServiceLocator(contextMethod, domainMethod);
    assert locatorType != null;

    // Inject an instance of the locator itself, and then get an instance from it
    ServiceLocator locator = injector.getInstance(locatorType);
    return locator.getInstance(domainMethod.getDeclaringClass());
}