Package org.apache.sling.api.resource

Examples of org.apache.sling.api.resource.ResourceResolver.revert()


                            resourceResolver,
                            config.getClusterInstancesPath()
                                    + "/" + slingId + "/properties");
            // SLING-2879 - revert/refresh resourceResolver here to work
            // around a potential issue with jackrabbit in a clustered environment
            resourceResolver.revert();
            resourceResolver.refresh();

            final ModifiableValueMap myInstanceMap = myInstance.adaptTo(ModifiableValueMap.class);
            final Set<String> keys = new HashSet<String>(myInstanceMap.keySet());
            for(final String key : keys) {
View Full Code Here


            logger.error(
                    "deleteAnnouncementsOf: got PersistenceException when deleting "
                    + "announcements of instanceId="+instanceId+": " + e, e);
        } finally {
            if (resourceResolver!=null) {
                resourceResolver.revert();
                resourceResolver.close();
                resourceResolver = null;
            }
        }
    }
View Full Code Here

                    newResource = resolver.create(reqResource, name, properties);

                    resolver.commit();
                    break;
                } catch ( final PersistenceException pe) {
                    resolver.revert();
                    resolver.refresh();
                    exception = pe;
                }
            }
            if ( exception != null ) {
View Full Code Here

                                                resolver.delete(rsrc);
                                                resolver.commit();
                                            } catch ( final PersistenceException pe ) {
                                                logger.warn("Unable to move stale job from " + rsrc.getPath() + " to " + newPath, pe);
                                                resolver.refresh();
                                                resolver.revert();
                                            }
                                        }
                                    } catch (final InstantiationException ie) {
                                        // something happened with the resource in the meantime
                                        logger.warn("Unable to move stale job from " + rsrc.getPath(), ie);
View Full Code Here

                                        }
                                    } catch (final InstantiationException ie) {
                                        // something happened with the resource in the meantime
                                        logger.warn("Unable to move stale job from " + rsrc.getPath(), ie);
                                        resolver.refresh();
                                        resolver.revert();
                                    }
                                    return caps.isActive();
                                }
                            });
View Full Code Here

                                    resolver.delete(rsrc);
                                    resolver.commit();
                                } catch ( final PersistenceException pe ) {
                                    logger.warn("Unable to move unassigned job from " + rsrc.getPath() + " to " + newPath, pe);
                                    resolver.refresh();
                                    resolver.revert();
                                }
                            }
                        } catch (final InstantiationException ie) {
                            // something happened with the resource in the meantime
                            logger.warn("Unable to move unassigned job from " + rsrc.getPath(), ie);
View Full Code Here

                            }
                        } catch (final InstantiationException ie) {
                            // something happened with the resource in the meantime
                            logger.warn("Unable to move unassigned job from " + rsrc.getPath(), ie);
                            resolver.refresh();
                            resolver.revert();
                        }
                        return caps.isActive();
                    }
                });
            }
View Full Code Here

                                resolver.delete(rsrc);
                                resolver.commit();
                            } catch ( final PersistenceException pe ) {
                                logger.warn("Unable to unassigned job from " + rsrc.getPath() + " to " + newPath, pe);
                                resolver.refresh();
                                resolver.revert();
                            }
                        } catch (final InstantiationException ie) {
                            // something happened with the resource in the meantime
                            logger.warn("Unable to unassigned job from " + rsrc.getPath(), ie);
                            resolver.refresh();
View Full Code Here

                            }
                        } catch (final InstantiationException ie) {
                            // something happened with the resource in the meantime
                            logger.warn("Unable to unassigned job from " + rsrc.getPath(), ie);
                            resolver.refresh();
                            resolver.revert();
                        }
                        return caps.isActive();
                    }
                });
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.