public final class MockSling extends Object
Modifier and Type | Field and Description |
---|---|
static ResourceResolverType |
DEFAULT_RESOURCERESOLVER_TYPE
Default resource resolver type is
ResourceResolverType.RESOURCERESOLVER_MOCK . |
Modifier and Type | Method and Description |
---|---|
static void |
clearAdapterManagerBundleContext()
Clear adapter registrations..
|
static org.apache.sling.api.resource.ResourceResolver |
newResourceResolver()
Deprecated.
Please use
newResourceResolver(BundleContext)
and shutdown the bundle context after usage. |
static org.apache.sling.api.resource.ResourceResolver |
newResourceResolver(org.osgi.framework.BundleContext bundleContext)
Creates new sling resource resolver instance using
DEFAULT_RESOURCERESOLVER_TYPE . |
static org.apache.sling.api.resource.ResourceResolver |
newResourceResolver(ResourceResolverType type)
Deprecated.
Please use
newResourceResolver(ResourceResolverType, BundleContext)
and shutdown the bundle context after usage. |
static org.apache.sling.api.resource.ResourceResolver |
newResourceResolver(ResourceResolverType type,
org.osgi.framework.BundleContext bundleContext)
Creates new sling resource resolver instance.
|
static org.apache.sling.api.resource.ResourceResolverFactory |
newResourceResolverFactory()
Deprecated.
Please use
newResourceResolverFactory(BundleContext)
and shutdown the bundle context after usage. |
static org.apache.sling.api.resource.ResourceResolverFactory |
newResourceResolverFactory(org.osgi.framework.BundleContext bundleContext)
Creates new sling resource resolver factory instance.
|
static org.apache.sling.api.resource.ResourceResolverFactory |
newResourceResolverFactory(ResourceResolverType type)
Deprecated.
Please use
newResourceResolverFactory(ResourceResolverType, BundleContext)
and shutdown the bundle context after usage. |
static org.apache.sling.api.resource.ResourceResolverFactory |
newResourceResolverFactory(ResourceResolverType type,
org.osgi.framework.BundleContext bundleContext)
Creates new sling resource resolver factory instance.
|
static org.apache.sling.api.scripting.SlingScriptHelper |
newSlingScriptHelper()
Deprecated.
Please use
newSlingScriptHelper(BundleContext)
and shutdown the bundle context after usage. |
static org.apache.sling.api.scripting.SlingScriptHelper |
newSlingScriptHelper(org.osgi.framework.BundleContext bundleContext)
Creates a new sling script helper instance using
DEFAULT_RESOURCERESOLVER_TYPE for the resource resolver. |
static org.apache.sling.api.scripting.SlingScriptHelper |
newSlingScriptHelper(org.apache.sling.api.SlingHttpServletRequest request,
org.apache.sling.api.SlingHttpServletResponse response,
org.osgi.framework.BundleContext bundleContext)
Creates a new sling script helper instance.
|
static void |
setAdapterManagerBundleContext(org.osgi.framework.BundleContext bundleContext)
Set bundle context for adapter manager.
|
public static final ResourceResolverType DEFAULT_RESOURCERESOLVER_TYPE
ResourceResolverType.RESOURCERESOLVER_MOCK
.@Deprecated public static org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory(ResourceResolverType type)
newResourceResolverFactory(ResourceResolverType, BundleContext)
and shutdown the bundle context after usage.type
- Type of underlying repository.public static org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory(org.osgi.framework.BundleContext bundleContext)
bundleContext
- Bundle contextpublic static org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory(ResourceResolverType type, org.osgi.framework.BundleContext bundleContext)
type
- Type of underlying repository.bundleContext
- Bundle context@Deprecated public static org.apache.sling.api.resource.ResourceResolverFactory newResourceResolverFactory()
newResourceResolverFactory(BundleContext)
and shutdown the bundle context after usage.DEFAULT_RESOURCERESOLVER_TYPE
.@Deprecated public static org.apache.sling.api.resource.ResourceResolver newResourceResolver(ResourceResolverType type)
newResourceResolver(ResourceResolverType, BundleContext)
and shutdown the bundle context after usage.type
- Type of underlying repository.@Deprecated public static org.apache.sling.api.resource.ResourceResolver newResourceResolver()
newResourceResolver(BundleContext)
and shutdown the bundle context after usage.DEFAULT_RESOURCERESOLVER_TYPE
.public static org.apache.sling.api.resource.ResourceResolver newResourceResolver(ResourceResolverType type, org.osgi.framework.BundleContext bundleContext)
type
- Type of underlying repository.bundleContext
- Bundle contextpublic static org.apache.sling.api.resource.ResourceResolver newResourceResolver(org.osgi.framework.BundleContext bundleContext)
DEFAULT_RESOURCERESOLVER_TYPE
.bundleContext
- Bundle contextpublic static org.apache.sling.api.scripting.SlingScriptHelper newSlingScriptHelper(org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.SlingHttpServletResponse response, org.osgi.framework.BundleContext bundleContext)
request
- Requestresponse
- ResponsebundleContext
- Bundle context@Deprecated public static org.apache.sling.api.scripting.SlingScriptHelper newSlingScriptHelper()
newSlingScriptHelper(BundleContext)
and shutdown the bundle context after usage.DEFAULT_RESOURCERESOLVER_TYPE
for the resource resolver.public static org.apache.sling.api.scripting.SlingScriptHelper newSlingScriptHelper(org.osgi.framework.BundleContext bundleContext)
DEFAULT_RESOURCERESOLVER_TYPE
for the resource resolver.bundleContext
- Bundle contextpublic static void setAdapterManagerBundleContext(org.osgi.framework.BundleContext bundleContext)
bundleContext
- OSGi bundle contextpublic static void clearAdapterManagerBundleContext()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.