@Service @Reference(name="AdapterFactory", referenceInterface=org.apache.sling.api.adapter.AdapterFactory.class, cardinality=OPTIONAL_MULTIPLE, policy=DYNAMIC) public class MockAdapterManagerImpl extends Object implements org.apache.sling.api.adapter.AdapterManager
ThreadsafeMockAdapterManagerWrapper
concept.Constructor and Description |
---|
MockAdapterManagerImpl() |
Modifier and Type | Method and Description |
---|---|
protected void |
activate(org.osgi.service.component.ComponentContext context)
Activate the manager.
|
protected void |
bindAdapterFactory(org.osgi.framework.ServiceReference reference)
Bind a new adapter factory.
|
protected void |
deactivate(org.osgi.service.component.ComponentContext context)
Deactivate
|
<AdapterType> |
getAdapter(Object adaptable,
Class<AdapterType> type)
Returns the adapted
adaptable or null if
the object cannot be adapted. |
protected void |
unbindAdapterFactory(org.osgi.framework.ServiceReference reference)
Unbind an adapter factory.
|
public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type)
adaptable
or null
if
the object cannot be adapted.getAdapter
in interface org.apache.sling.api.adapter.AdapterManager
AdapterManager.getAdapter(java.lang.Object, java.lang.Class)
protected void activate(org.osgi.service.component.ComponentContext context)
context
- Component contextprotected void deactivate(org.osgi.service.component.ComponentContext context)
context
- Not usedprotected void bindAdapterFactory(org.osgi.framework.ServiceReference reference)
reference
- Service referenceprotected void unbindAdapterFactory(org.osgi.framework.ServiceReference reference)
reference
- Service referenceCopyright © 2007–2018 The Apache Software Foundation. All rights reserved.