Consider this example
@Stateless
public class UniqueIdGenerator {
private static final String COLON = ":";
private String serverPrivateKey;
@SuppressWarnings("UnusedDeclaration")
public UniqueIdGenerator() {
}
@Inject
public UniqueIdGenerator(@Nonnull final String serverPrivateKey) {
this.serverPrivateKey = serverPrivateKey;
}
...
}
I would like a @Injectvalue serverPrivateKeybased on an environment variable available in different environments.
What is the best way to enter it here?
source
share