Skip to content

Instantly share code, notes, and snippets.

@pmuir
Created July 25, 2010 12:07
Show Gist options
  • Save pmuir/489519 to your computer and use it in GitHub Desktop.
Save pmuir/489519 to your computer and use it in GitHub Desktop.
@GenericConfiguration
@Retention(RUNTIME)
@Target( { TYPE, METHOD, PARAMETER, FIELD })
public @interface Service {}
@Produces
@Service @S3
public BlobStoreContext getS3BlobStoreContext(BlobStoreContextFactory factory) {
return factory.openContext(...);
}
@Generic(Service.class)
public class BlobStoreContextManager {
@ApplyQualifiers @Produces
public BlobStore getBlobStore(@ApplyQualifiers BlobStoreContext context) {
return context.getBlobStore();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment