Search in sources :

Example 1 with HelperData

use of org.apache.sling.jcr.resource.internal.HelperData in project sling by apache.

the class JcrItemResourceFactoryTest method compareGetItemOrNull.

private void compareGetItemOrNull(String path, String expectedPath) throws RepositoryException {
    HelperData helper = new HelperData(new AtomicReference<DynamicClassLoaderManager>());
    Item item1 = new JcrItemResourceFactory(session, helper).getItemOrNull(path);
    Item item2 = new JcrItemResourceFactory(nonJackrabbitSession, helper).getItemOrNull(path);
    if (expectedPath == null) {
        assertNull(item1);
        assertNull(item2);
    } else {
        assertNotNull(item1);
        assertEquals(expectedPath, item1.getPath());
        assertNotNull(item2);
        assertEquals(expectedPath, item2.getPath());
    }
}
Also used : Item(javax.jcr.Item) HelperData(org.apache.sling.jcr.resource.internal.HelperData) DynamicClassLoaderManager(org.apache.sling.commons.classloader.DynamicClassLoaderManager)

Example 2 with HelperData

use of org.apache.sling.jcr.resource.internal.HelperData in project sling by apache.

the class JcrProviderStateFactory method createJcrProviderState.

private JcrProviderState createJcrProviderState(@Nonnull final Session s, final boolean logoutSession, @Nonnull final Map<String, Object> authenticationInfo, @Nullable final BundleContext ctx) throws LoginException {
    final Session session = handleImpersonation(s, authenticationInfo, logoutSession);
    final HelperData data = new HelperData(this.dynamicClassLoaderManagerReference);
    return new JcrProviderState(session, data, logoutSession, ctx, ctx == null ? null : repositoryReference);
}
Also used : HelperData(org.apache.sling.jcr.resource.internal.HelperData) Session(javax.jcr.Session)

Aggregations

HelperData (org.apache.sling.jcr.resource.internal.HelperData)2 Item (javax.jcr.Item)1 Session (javax.jcr.Session)1 DynamicClassLoaderManager (org.apache.sling.commons.classloader.DynamicClassLoaderManager)1