[Buix-commits] r319 - trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs
Author: tchemit Date: 2008-04-03 21:50:11 +0000 (Thu, 03 Apr 2008) New Revision: 319 Added: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandlerEvent.java trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandlerEventListener.java Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandler.java Log: add VCSHandlerEvent to manage life cycle of an handler (init - open - close) Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandler.java =================================================================== --- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandler.java 2008-04-03 17:20:14 UTC (rev 318) +++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandler.java 2008-04-03 21:50:11 UTC (rev 319) @@ -315,4 +315,12 @@ void testConnection() throws VCSException; boolean hasProtocoleChanged() throws VCSException; + + void addVCSHandlerEventListener(VCSHandlerEventListener l); + + void removeVCSHandlerEventListener(VCSHandlerEventListener l); + + void open(); + + void close(); } \ No newline at end of file Added: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandlerEvent.java =================================================================== --- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandlerEvent.java (rev 0) +++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandlerEvent.java 2008-04-03 21:50:11 UTC (rev 319) @@ -0,0 +1,51 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.vcs; + +import java.util.EventObject; + +/** + * Events to be used while {@link VCSHandler} life cycle. + * + * @author chemit + * @see VCSHandlerEventListener + * @see VCSHandler + */ +public class VCSHandlerEvent extends EventObject { + + private static final long serialVersionUID = 1L; + + protected Type type; + + public enum Type { + INIT, OPEN, CLOSE + } + + /** + * Constructs a prototypical Event. + * + * @param source The object on which the Event initially occurred. + * @param type type of event + * @throws IllegalArgumentException if source is null. + */ + public VCSHandlerEvent(Object source, Type type) { + super(source); + this.type = type; + } + + public Type getType() { + return type; + } +} Added: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandlerEventListener.java =================================================================== --- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandlerEventListener.java (rev 0) +++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSHandlerEventListener.java 2008-04-03 21:50:11 UTC (rev 319) @@ -0,0 +1,47 @@ +/** + * # #% Copyright (C) 2008 Code Lutin, Tony Chemit + * This program is free software; you + * can redistribute it and/or modify it under the terms of the GNU General + * Public License as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. This program is + * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more details. You + * should have received a copy of the GNU General Public License along with this + * program; if not, write to the Free Software Foundation, Inc., 59 Temple Place + * - Suite 330, Boston, MA 02111-1307, USA. + * # #% + */ +package org.codelutin.vcs; + +import java.util.EventListener; + +/** + * A listener on {@link org.codelutin.vcs.VCSHandler} + * + * @author chemit + */ +public interface VCSHandlerEventListener extends EventListener { + + /** + * call when vcs handler was successfull init + * + * @param event current event + */ + public void init(VCSHandlerEvent event); + + /** + * call when vcs handler was successfull open + * + * @param event current event + */ + public void open(VCSHandlerEvent event); + + /** + * call when vcs handler was closed + * + * @param event current event + */ + public void close(VCSHandlerEvent event); + +} \ No newline at end of file
participants (1)
-
tchemit@users.labs.libre-entreprise.org