I'm using the 2.1.1 RequestFactory in a Spring environment.  I would
like to use my Spring Service class to provide both my Entity Locator
and my RequestContext methods.

I can define my object's requestContext as:

@Service(value=MyObjectService.class,locator=SpringServiceLocator.class)
public interface MyObjectRequest extends RequestContext { ... }

and give it a Service Locator that retrieves the service class for the
current scope:

public class SpringServiceLocator implements ServiceLocator
{
@Override
public Object getInstance (Class<?> clazz)
{
    return
ApplicationContextProvider.getContext().getBean(clazz.getSimpleName(),clazz);
}
}

which finds a Service that looks like:
@Scope("session")
@Service("MyObjectService")
@Transactional(isolation = Isolation.DEFAULT, propagation =
Propagation.REQUIRED)
public class MyObjectServiceImpl extends Locator<MyObject, Long>
implements MyObjectService { ... }

This part works great.

Is there a way to point the Entity's Locator to this class using
something like a ServiceLocator?  What I'd like is something like
this:

@ProxyFor(value=MyObject.class,locator=MyObjectService.class,locatorLocator=SpringServiceLocator.class)
public interface MyObjectProxy extends EntityProxy { ... }

I'm trying to keep all of my object finders in my MyObjectService
layer, but I don't want GWT to construct it, I want to use a locator
to find the one Spring has already instantiated for me.

Does anyone know of a way to do this other than writing a separate
EntityLocator class that implements the Locator<> interface and passes
the requests into my Service layer?

Thanks,
Eric

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to