Permalink
Switch branches/tags
Commits on Dec 20, 2011
  1. Updating webbitserver dependency to 0.3.0 (Which implements latest ve…

    …rsion of websocket spec)
    committed Dec 20, 2011
Commits on Sep 30, 2011
  1. support hybi-10

    mzp committed Sep 30, 2011
Commits on Jun 15, 2011
  1. change artifactID

    mzp committed Jun 15, 2011
Commits on Jun 14, 2011
  1. update xfd html (thx @mallowlabs)

    mzp committed Jun 14, 2011
  2. fix scm information

    mzp committed Jun 14, 2011
  3. add infomation for release

    mzp committed Jun 14, 2011
  4. add maintainer information

    mzp committed Jun 14, 2011
  5. add wiki page

    mzp committed Jun 14, 2011
  6. add README

    mzp committed Jun 14, 2011
Commits on Jun 12, 2011
  1. change host name

    mzp committed Jun 12, 2011
  2. add xfd html

    mzp committed Jun 12, 2011
  3. fix "mvn package"

    mzp committed Jun 12, 2011
  4. update ignore file

    mzp committed Jun 12, 2011
  5. remove extra file

    mzp committed Jun 12, 2011
  6. update plugin name

    mzp committed Jun 12, 2011
  7. support port changing

    mzp committed Jun 12, 2011
  8. update ignore file

    mzp committed Jun 12, 2011
Commits on Jun 11, 2011
  1. rm extra file

    mzp committed Jun 11, 2011
  2. [from now] 2011年 6月11日 土曜日 17時35分25秒 JST

    diff --git a/src/main/java/org/codefirst/jenkins/wsnotifier/WsNotifier.java b/src/main/java/org/codefirst/jenkins/wsnotifier/WsNotifier.java
    index 133c67f..dc55e65 100644
    --- a/src/main/java/org/codefirst/jenkins/wsnotifier/WsNotifier.java
    +++ b/src/main/java/org/codefirst/jenkins/wsnotifier/WsNotifier.java
    @@ -2,9 +2,7 @@ package org.codefirst.jenkins.wsnotifier;
     import hudson.Launcher;
     import hudson.Extension;
     import hudson.util.FormValidation;
    -import hudson.model.AbstractBuild;
    -import hudson.model.BuildListener;
    -import hudson.model.AbstractProject;
    +import hudson.model.*;
     import hudson.tasks.*;
     import net.sf.json.JSONObject;
     import org.kohsuke.stapler.DataBoundConstructor;
    @@ -52,6 +50,7 @@ public class WsNotifier extends Notifier {
             public boolean configure(StaplerRequest req, JSONObject formData) throws FormException {
                 port = formData.getInt("port");
                 save();
    +            WsServer.reset(port);
                 return super.configure(req,formData);
             }
         }
    diff --git a/src/main/java/org/codefirst/jenkins/wsnotifier/WsServer.java b/src/main/java/org/codefirst/jenkins/wsnotifier/WsServer.java
    index 55b738b..6bc5441 100644
    --- a/src/main/java/org/codefirst/jenkins/wsnotifier/WsServer.java
    +++ b/src/main/java/org/codefirst/jenkins/wsnotifier/WsServer.java
    @@ -3,18 +3,25 @@ package org.codefirst.jenkins.wsnotifier;
     import hudson.init.Initializer;
     import hudson.init.InitMilestone;
     import hudson.model.AbstractBuild;
    +import hudson.model.Descriptor;
     import java.io.IOException;
     import org.webbitserver.*;
     import java.util.concurrent.CopyOnWriteArrayList;
     import net.sf.json.JSONObject;
    -
    +import hudson.model.*;
    
     public class WsServer implements WebSocketHandler {
         private static WebServer webServer = null;
    
    -    public static void reset(int port) throws IOException {
    +    @Initializer(before=InitMilestone.COMPLETED)
    +    public static void init() throws IOException {
    +        WsNotifier.DescriptorImpl desc = Hudson.getInstance().getDescriptorByType(WsNotifier.DescriptorImpl.class);
    +        reset(desc.port());
    +    }
    +
    +    synchronized public static void reset(int port) throws IOException {
             System.out.println("start websocket server");
    -        if(webServer){
    +        if(webServer != null){
                 webServer.stop();
             }
             webServer = WebServers.createWebServer(port)
    mzp committed Jun 11, 2011
  3. [from now] 2011年 6月11日 土曜日 17時02分34秒 JST

    diff --git a/src/main/java/org/codefirst/jenkins/wsnotifier/WsServer.java b/src/main/java/org/codefirst/jenkins/wsnotifier/WsServer.java
    index 4d4ed9d..55b738b 100644
    --- a/src/main/java/org/codefirst/jenkins/wsnotifier/WsServer.java
    +++ b/src/main/java/org/codefirst/jenkins/wsnotifier/WsServer.java
    @@ -10,14 +10,22 @@ import net.sf.json.JSONObject;
    
     public class WsServer implements WebSocketHandler {
    -    @Initializer(before=InitMilestone.COMPLETED)
    -    public static void init() throws IOException {
    +    private static WebServer webServer = null;
    +
    +    public static void reset(int port) throws IOException {
             System.out.println("start websocket server");
    -        WebServer webServer = WebServers.createWebServer(8081)
    +        if(webServer){
    +            webServer.stop();
    +        }
    +        webServer = WebServers.createWebServer(port)
                 .add("/jenkins", new WsServer())
                 .start();
         }
    
    +    public static void reset() throws IOException {
    +        reset(8081);
    +    }
    +
         static private CopyOnWriteArrayList<WebSocketConnection> connections = new CopyOnWriteArrayList<WebSocketConnection>();
         static public void send(AbstractBuild build){
             String json = new JSONObject()
    mzp committed Jun 11, 2011
  4. update ignore file

    mzp committed Jun 11, 2011
  5. add configure page

    mzp committed Jun 11, 2011
  6. send notification on build complete

    mzp committed Jun 11, 2011
Commits on Jun 10, 2011
  1. init commit

    mzp committed Jun 10, 2011