@PublicApi public final class MessageRunnerKey extends Object implements Serializable, Comparable<MessageRunnerKey>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(MessageRunnerKey o) |
boolean |
equals(Object o) |
int |
hashCode() |
static MessageRunnerKey |
of(String key)
Wraps the provided string as a
MessageRunnerKey. |
String |
toString() |
public static MessageRunnerKey of(String key)
MessageRunnerKey.
Although it is not necessary for correctness, it will usually make sense to create a single instance of
the MessageRunnerKey and reuse it as a constant, as in:
private static final MessageRunnerKey <strong>POP3_SERVICE</strong> = MessageRunnerKey.of("com.example.plugin.Pop3Service");
// ...
private void registerJobRunner()
{
schedulerService.registerJobRunner(<strong>POP3_SERVICE</strong>, new Pop3JobRunner());
}
private String scheduleJobWithGeneratedId(String cronExpression)
{
JobConfig jobConfig = JobConfig.forMessageRunnerKey(<strong>POP3_SERVICE</strong>)
.withSchedule(Schedule.forCronExpression(cronExpression));
return schedulerService.scheduleJobWithGeneratedId(jobConfig);
}
key - the job runner key, as a stringpublic int compareTo(MessageRunnerKey o)
compareTo in interface Comparable<MessageRunnerKey>Copyright © 2017 Atlassian. All rights reserved.