Class MockAdapterManagerImpl

java.lang.Object
org.apache.sling.testing.mock.sling.MockAdapterManagerImpl
All Implemented Interfaces:
org.apache.sling.api.adapter.AdapterManager

public class MockAdapterManagerImpl extends Object implements org.apache.sling.api.adapter.AdapterManager
This is a copy of org.apache.sling.adapter.internal.AdpaterManagerImpl from Sling Adapter 2.2.0, with all calls to SlingAdaptable.setAdapterManager/unsetAdapterManager disabled, because this would break the ThreadsafeMockAdapterManagerWrapper concept. Additionally the reference to PackageAdmin is disabled.
  • Field Summary

    Fields inherited from interface org.apache.sling.api.adapter.AdapterManager

    SERVICE_NAME
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    bindAdapterFactory(org.apache.sling.api.adapter.AdapterFactory factory, org.osgi.framework.ServiceReference<org.apache.sling.api.adapter.AdapterFactory> reference)
    Bind a new adapter factory.
    <AdapterType>
    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<org.apache.sling.api.adapter.AdapterFactory> reference)
    Unbind a adapter factory.
    protected void
    updatedAdapterFactory(org.apache.sling.api.adapter.AdapterFactory factory, org.osgi.framework.ServiceReference<org.apache.sling.api.adapter.AdapterFactory> reference)
    Modify a adapter factory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MockAdapterManagerImpl

      public MockAdapterManagerImpl()
  • Method Details

    • getAdapter

      public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type)
      Returns the adapted adaptable or null if the object cannot be adapted.
      Specified by:
      getAdapter in interface org.apache.sling.api.adapter.AdapterManager
      See Also:
      • AdapterManager.getAdapter(java.lang.Object, java.lang.Class)
    • bindAdapterFactory

      protected void bindAdapterFactory(org.apache.sling.api.adapter.AdapterFactory factory, org.osgi.framework.ServiceReference<org.apache.sling.api.adapter.AdapterFactory> reference)
      Bind a new adapter factory.
    • unbindAdapterFactory

      protected void unbindAdapterFactory(org.osgi.framework.ServiceReference<org.apache.sling.api.adapter.AdapterFactory> reference)
      Unbind a adapter factory.
    • updatedAdapterFactory

      protected void updatedAdapterFactory(org.apache.sling.api.adapter.AdapterFactory factory, org.osgi.framework.ServiceReference<org.apache.sling.api.adapter.AdapterFactory> reference)
      Modify a adapter factory.