Package org.apache.sling.api.resource

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


            if (logErrorOnFailure) {
                logger.error("remove: Could not remove node: " + pe, pe);
            } else {
                logger.info("remove: Could not remove node: "+pe);
            }
            resourceResolver.refresh();
        }
    }

}
View Full Code Here


                            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) {
                if (newProps.containsKey(key)) {
View Full Code Here

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

                            sendEvent = false;
                            logger.debug("resource resolver is null");
                        } else {
                            final Resource rsrc = resolver.getResource(changePath);
                            if ( rsrc == null ) {
                                resolver.refresh();
                                sendEvent = false;
                                logger.debug("not able to get resource for changes path {}", changePath);
                            } else {
                                // check if this is a JCR backed resource, otherwise it is not visible!
                                final Node node = rsrc.adaptTo(Node.class);
View Full Code Here

                                                ResourceHelper.getOrCreateResource(resolver, newPath, props);
                                                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
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

                                    ResourceHelper.getOrCreateResource(resolver, newPath, props);
                                    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
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

                                ResourceHelper.getOrCreateResource(resolver, newPath, props);
                                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);
View Full Code Here

                                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();
                            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.