From tchemit@users.labs.libre-entreprise.org Sun Apr 6 09:31:39 2008
From: tchemit@users.labs.libre-entreprise.org
To: buix-commits@list.nuiton.org
Subject: [Buix-commits] r379 - in trunk/lutinvcs:
lutinvcs-api/src/main/java/org/codelutin/vcs
lutinvcs-api/src/main/java/org/codelutin/vcs/util
lutinvcs-api/src/main/resources/i18n
lutinvcs-core/src/main/java/org/codelutin/vcs/runner
Date: Sun, 06 Apr 2008 09:31:39 +0200
Message-ID: <20080406073139.A9303461B0B@labs.libre-entreprise.org>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="===============7073442215753824063=="
--===============7073442215753824063==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Author: tchemit
Date: 2008-04-06 07:31:39 +0000 (Sun, 06 Apr 2008)
New Revision: 379
Modified:
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.j=
ava
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/package.html
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractV=
CSHandler.java
trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/AbstractV=
CSProvider.java
trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.pro=
perties
trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.pro=
perties
trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSAct=
ionThread.java
Log:
i18n +...
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConn=
exion.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.=
java 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/VCSConnexion.=
java 2008-04-06 07:31:39 UTC (rev 379)
@@ -37,9 +37,20 @@
*/
public interface VCSConnexion {
=20
+ /** @return the provider */
VCSProvider getProvider();
=20
/**
+ * Initialize the connexion.
+ *
+ * If connexion can not be established, then the method {@link #hasFaile=
d()} will always
+ * return true.
+ *
+ * @param config config to be used to initialize the connexion.
+ */
+ void init(VCSConnexionConfig config);
+
+ /**
* @return the working copy used, can be null if no working copy exists.
* @throws IllegalStateException if {@link #init(VCSConnexionConfig)} wa=
s not invoked before.
*/
@@ -58,16 +69,6 @@
VCSConnexionMode getMode() throws IllegalStateException;
=20
/**
- * Initialize the connexion.
- *
- * If connexion can not be established, then the method {@link #hasFaile=
d()} will always
- * return true.
- *
- * @param config config to be used to initialize the connexion.
- */
- void init(VCSConnexionConfig config);
-
- /**
* @return the config of the connexion
* @throws IllegalStateException if {@link #init(VCSConnexionConfig)} wa=
s not invoked before.
*/
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/package=
.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/package.html =
2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/package.html =
2008-04-06 07:31:39 UTC (rev 379)
@@ -1,11 +1,11 @@
-Lutin vcs
+Lutin vcs api
Ensemble de l'api de base pour g=EF=BF=BDrer des Versionning Concurrent Syst=
em (aka
vcs) tel que CVS ou SVN.
-On retrouve ici des interfaces, des classes g=EF=BF=BDn=EF=BF=BDriques et le=
s objets li=EF=BF=BDs aux vcs.
+On retrouve dans ce paquetage, uniquement des d=EF=BF=BDfinitions de types.
-Auncune impl=EF=BF=BDmentation n'est fournit actuellement ici.
+Auncune impl=EF=BF=BDmentation n'est fournie dans ce paquetage.
\ No newline at end of file
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/Ab=
stractVCSHandler.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/Abstract=
VCSHandler.java 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/Abstract=
VCSHandler.java 2008-04-06 07:31:39 UTC (rev 379)
@@ -45,20 +45,15 @@
/** to use log facility, just put in your code: log.info(\"...\"); */
static protected final Log log =3D LogFactory.getLog(AbstractVCSHandler.=
class);
=20
- /**
- * FilenameFilter to detect all files in a vcs working copy all files an=
d directories that must be handled by vcs
- *
- * @see VCSHandler#getVersionnableFilenameFilter()
- */
+ public static final String LOCAL_SEP =3D File.separator;
+ public static final String LOCAL_SEP_PATTERN =3D "\\".equals(LOCAL_SEP) =
? LOCAL_SEP + LOCAL_SEP : LOCAL_SEP;
+ public static final String REMOTE_SEP =3D "/";
+ public static final String REMOTE_SEP_PATTERN =3D "/";
+
protected final FilenameFilter versionnableFilenameFilter;
protected final FileFilter versionnableFileFilter;
protected final String confLocalDirName;
protected final String confLocalEntriesFilename;
- public static final String LOCAL_SEP =3D File.separator;
- public static final String LOCAL_SEP_PATTERN =3D "\\".equals(LOCAL_SEP) ?
- LOCAL_SEP + LOCAL_SEP : LOCAL_SEP;
- public static final String REMOTE_SEP =3D "/";
- public static final String REMOTE_SEP_PATTERN =3D "/";
=20
protected AbstractVCSHandler(final String vCSConfLocalDirName, String vC=
SConfLocalEntriesFilename) {
this.confLocalDirName =3D vCSConfLocalDirName;
Modified: trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/Ab=
stractVCSProvider.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/Abstract=
VCSProvider.java 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/java/org/codelutin/vcs/util/Abstract=
VCSProvider.java 2008-04-06 07:31:39 UTC (rev 379)
@@ -14,26 +14,33 @@
*/
package org.codelutin.vcs.util;
=20
+import static org.codelutin.i18n.I18n._;
import org.codelutin.vcs.VCSConnexion;
import org.codelutin.vcs.VCSConnexionConfig;
-import org.codelutin.vcs.type.VCSConnexionMode;
import org.codelutin.vcs.VCSHandler;
import org.codelutin.vcs.VCSProvider;
+import org.codelutin.vcs.type.VCSConnexionMode;
=20
-import java.lang.reflect.InvocationTargetException;
-
/**
- * base implementation of provider with a cached handler and list of connexi=
ons
+ * base implementation of provider with a cached common handler for all conn=
exions.
*
* @author chemit
*/
public abstract class AbstractVCSProvider> implements VCSProvider {
-
+ /**
+ * shared cached instance of handler to use for this provider.
+ *
+ * The handler can be used by all connexions for this provider
+ */
protected H handler;
=20
+ /** name of ne provider */
protected final String name;
=20
+ /** implementation of handler to use */
private final Class handlerImpl;
+
+ /** implementation of connexion to use */
private final Class connexionImpl;
=20
protected AbstractVCSProvider(String name, Class handlerImpl, Class connexionImpl) {
@@ -57,14 +64,8 @@
C connexion =3D connexionImpl.getConstructor(VCSConnexionMode.cl=
ass, getClass()).newInstance(mode, this);
connexion.init(config);
return connexion;
- } catch (InstantiationException e) {
- throw new RuntimeException("could not instanciate connexion " + =
connexionImpl + " for reason " + e.getMessage());
- } catch (IllegalAccessException e) {
- throw new RuntimeException("could not instanciate connexion " + =
connexionImpl + " for reason " + e.getMessage());
- } catch (InvocationTargetException e) {
- throw new RuntimeException("could not instanciate connexion " + =
connexionImpl + " for reason " + e.getMessage());
- } catch (NoSuchMethodException e) {
- throw new RuntimeException("could not instanciate connexion " + =
connexionImpl + " for reason " + e.getMessage());
+ } catch (Exception e) {
+ throw new RuntimeException(_("lutinvcs.error.provider.init.conne=
xion", connexionImpl, this, e.getCause()));
}
}
=20
@@ -72,17 +73,15 @@
if (handler =3D=3D null) {
try {
handler =3D handlerImpl.newInstance();
- } catch (InstantiationException e) {
- throw new RuntimeException("could not instanciate the handle=
r " + handlerImpl + " for reason " + e.getMessage());
- } catch (IllegalAccessException e) {
- throw new RuntimeException("could not instanciate the handle=
r " + handlerImpl + " for reason " + e.getMessage());
+ } catch (Exception e) {
+ throw new RuntimeException(_("lutinvcs.error.provider.init.h=
andler", handlerImpl, this, e.getCause()));
}
}
}
=20
protected void checkHandlerInit() throws IllegalStateException {
if (handler =3D=3D null) {
- throw new IllegalStateException("handler was not init in " + thi=
s);
+ throw new IllegalStateException(_("lutinvcs.error.provider.noini=
t", handler, this));
}
}
=20
Modified: trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en=
_GB.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.pr=
operties 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-en_GB.pr=
operties 2008-04-06 07:31:39 UTC (rev 379)
@@ -9,6 +9,9 @@
lutinvcs.action.revert=3Drevert
lutinvcs.action.update=3Dupdate
lutinvcs.error.checkout.dir=3DCan''t checkout dir {0}
+lutinvcs.error.provider.init.connexion=3Dcould not instanciate connexion {0}=
, for provider {1}, reason\: {2}
+lutinvcs.error.provider.init.handler=3Dcould not instanciate handler {0}, fo=
r provider {1}, reason\: {2}
+lutinvcs.error.provider.noinit=3Dhandler {0} was not init for provider {1}
lutinvcs.location.all=3DAll
lutinvcs.location.local=3DLocal
lutinvcs.location.remote=3DRemote
Modified: trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr=
_FR.properties
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.pr=
operties 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-api/src/main/resources/i18n/lutinvcs-api-fr_FR.pr=
operties 2008-04-06 07:31:39 UTC (rev 379)
@@ -9,6 +9,9 @@
lutinvcs.action.revert=3DRollback
lutinvcs.action.update=3DUpdate
lutinvcs.error.checkout.dir=3DNe peut pas uploader le fichier ''{0}''
+lutinvcs.error.provider.init.connexion=3DErreur lors de l''instanciation de =
la connexion {0}, provider {1}, cause\: {2}
+lutinvcs.error.provider.init.handler=3DErreur lors de l''instanciation du ha=
ndler {0}, provider {1}, cause\: {2}
+lutinvcs.error.provider.noinit=3DLe handler {0} n''a pas \u00E9t\u00E9 initi=
alis\u00E9 pour le provider {1}
lutinvcs.location.all=3DAll
lutinvcs.location.local=3DLocal
lutinvcs.location.remote=3DRemote
Modified: trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner=
/VCSActionThread.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSAc=
tionThread.java 2008-04-06 07:04:12 UTC (rev 378)
+++ trunk/lutinvcs/lutinvcs-core/src/main/java/org/codelutin/vcs/runner/VCSAc=
tionThread.java 2008-04-06 07:31:39 UTC (rev 379)
@@ -56,9 +56,11 @@
catch (Throwable eee) {
if (log.isWarnEnabled()) {
log.warn(_("lutinvcs.error.thread.action", item), eee);
+ //TODO Deal with errors
}
+ } finally {
+ log.info("Stop " + getName() + " at " + new Date());
}
- log.info("Stop " + getName() + " at " + new Date());
}
=20
protected void doAction(VCSActionManager.QueueItem item) throws VCSExcep=
tion {
--===============7073442215753824063==--