org.apache.sling.adapter.internal
Class AdapterManagerImpl

java.lang.Object
  extended by org.apache.sling.adapter.internal.AdapterManagerImpl
All Implemented Interfaces:
org.apache.sling.api.adapter.AdapterManager

@Service
@Properties(value={@Property(name="service.description",value="Sling Adapter Manager"),@Property(name="service.vendor",value="The Apache Software Foundation")})
@Reference(name="AdapterFactory",
           referenceInterface=org.apache.sling.api.adapter.AdapterFactory.class,
           cardinality=OPTIONAL_MULTIPLE,
           policy=DYNAMIC)
public class AdapterManagerImpl
extends java.lang.Object
implements org.apache.sling.api.adapter.AdapterManager

The AdapterManagerImpl class implements the AdapterManager interface and is registered as a service for that interface to be used by any clients.


Constructor Summary
AdapterManagerImpl()
           
 
Method Summary
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>
AdapterType
getAdapter(java.lang.Object adaptable, java.lang.Class<AdapterType> type)
          Returns the adapted adaptable or null if the object cannot be adapted.
protected  void unbindAdapterFactory(org.osgi.framework.ServiceReference reference)
          Unbind a adapter factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdapterManagerImpl

public AdapterManagerImpl()
Method Detail

getAdapter

public <AdapterType> AdapterType getAdapter(java.lang.Object adaptable,
                                            java.lang.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)

activate

protected void activate(org.osgi.service.component.ComponentContext context)
Activate the manager. Bind all already registered factories

Parameters:
context - Component context

deactivate

protected void deactivate(org.osgi.service.component.ComponentContext context)
Deactivate

Parameters:
context - Not used

bindAdapterFactory

protected void bindAdapterFactory(org.osgi.framework.ServiceReference reference)
Bind a new adapter factory.


unbindAdapterFactory

protected void unbindAdapterFactory(org.osgi.framework.ServiceReference reference)
Unbind a adapter factory.



Copyright © 2007-2012 The Apache Software Foundation. All Rights Reserved.