Skip to content

Instantly share code, notes, and snippets.

@etluchs
Created December 19, 2012 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etluchs/4340310 to your computer and use it in GitHub Desktop.
Save etluchs/4340310 to your computer and use it in GitHub Desktop.
CDI profile enum
public enum DbProfile {
IN_MEMORY_DB, JEE_DATASOURCE;
public AnnotationLiteral<InProfile> literal(){
return new InProfileLiteral();
}
class InProfileLiteral extends AnnotationLiteral<InProfile> implements InProfile {
@Override
public DbProfile value() {
return DbProfile.this;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment