示例#1
0
 public GrowlClient() {
   GntpApplicationInfo info = Gntp.appInfo("Stash").icon(getImage("/stash-3d.png")).build();
   pullRequestNotification = Gntp.notificationInfo(info, "Pull Request").build();
   pullRequestWithUserNotification =
       Gntp.notificationInfo(info, "Pull Request Including User").build();
   gntpClient = Gntp.client(info).forHost("localhost").build();
   gntpClient.register();
 }
示例#2
0
 private void notify(PullRequest pullRequest) {
   try {
     gntpClient.notify(
         create(
             pullRequest.user ? pullRequestWithUserNotification : pullRequestNotification,
             pullRequest),
         5,
         SECONDS);
   } catch (InterruptedException e) {
     System.err.println("Notification interrupted");
   }
 }