Interface design pattern / Java / Seam
- by Walter White
Hi all,
Is this possible somehow?
@Name("geolocationService")
public interface GeolocationService
{
@Query("SELECT g FROM Geolocation geolocation INNER JOIN geolocation.deployment deployment WHERE geolocation.ipStart <= INET_ATON(:ipAddress) AND deployment.active = TRUE")
Geolocation findByIpAddress(@NamedParameter("ipAddress")final String ipAddress);
}
public GeolocationAction
{
@In
private GeolocationService geolocationService;
@RequestParameter("ipAddress")
private String ipAddress;
@Out
private Geolocation geolocation;
public void find()
{
geolocation = geolocationService.findByIpAddress(ipAddress);
}
}
Is it possible to do this without implementing the interface? What is required to make that work? I want to maintain less and do more.
If I can intercept invocations of the geolocationService then I am golden, how would I do that? I don't want it to ever be instantiated, so it will always be null (I don't want the @Name and @In annotations either then).
Walter