Refactor JCR exceptions.
[lgpl/argeo-commons.git] / org.argeo.jcr / src / org / argeo / jcr / DefaultJcrListener.java
index 5ef8edd56214b1896cd3e32423b3a877fbf405f5..fc6888851f31b3f39cb4c42a0ee6b90337154f76 100644 (file)
@@ -1,18 +1,3 @@
-/*
- * Copyright (C) 2007-2012 Argeo GmbH
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *         http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
 package org.argeo.jcr;
 
 import javax.jcr.RepositoryException;
@@ -37,8 +22,8 @@ public class DefaultJcrListener implements EventListener {
                        addEventListener(session().getWorkspace().getObservationManager());
                        if (log.isDebugEnabled())
                                log.debug("Registered JCR event listener on " + path);
-               } catch (Exception e) {
-                       throw new ArgeoJcrException("Cannot register event listener", e);
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot register event listener", e);
                }
        }
 
@@ -48,8 +33,8 @@ public class DefaultJcrListener implements EventListener {
                                        .removeEventListener(this);
                        if (log.isDebugEnabled())
                                log.debug("Unregistered JCR event listener on " + path);
-               } catch (Exception e) {
-                       throw new ArgeoJcrException("Cannot unregister event listener", e);
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot unregister event listener", e);
                }
        }