X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.jcr%2Fsrc%2Forg%2Fargeo%2Fjcr%2FJcr.java;fp=org.argeo.jcr%2Fsrc%2Forg%2Fargeo%2Fjcr%2FJcr.java;h=0f6059c7f36d09dee42d6c0f85feeb55d622512e;hb=b5644c1dac96afe8b9bdcd68068c054a9f780926;hp=c3db4b604c71b1e8a955b45b2b5019de7a13dd14;hpb=10f1603677f125c014c06cfd3ab956b5589d6e55;p=lgpl%2Fargeo-commons.git diff --git a/org.argeo.jcr/src/org/argeo/jcr/Jcr.java b/org.argeo.jcr/src/org/argeo/jcr/Jcr.java index c3db4b604..0f6059c7f 100644 --- a/org.argeo.jcr/src/org/argeo/jcr/Jcr.java +++ b/org.argeo.jcr/src/org/argeo/jcr/Jcr.java @@ -366,8 +366,18 @@ public class Jcr { } } - /** Retrieves the {@link Session} related to this node. */ + /** + * Retrieves the {@link Session} related to this node. + * + * @deprecated Use {@link #getSession(Node)} instead. + */ + @Deprecated public static Session session(Node node) { + return getSession(node); + } + + /** Retrieves the {@link Session} related to this node. */ + public static Session getSession(Node node) { try { return node.getSession(); } catch (RepositoryException e) { @@ -414,6 +424,11 @@ public class Jcr { } } + /** Safely and silently logs out the underlying session. */ + public static void logout(Node node) { + Jcr.logout(session(node)); + } + /* * SECURITY */