Examples of AdapterManager


Examples of org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager

    public void addCollectionToHistory(final String idString) {
        history.addCollection(idString);
    }

    public void init() {
        final AdapterManager adapterManager = IsisContext.getPersistenceSession().getAdapterManager();
        final List<Object> services = getUserProfile().getPerspective().getServices();
        for (final Object service : services) {
            final ObjectAdapter serviceAdapter = adapterManager.adapterFor(service);
            if (serviceAdapter == null) {
                LOG.warn("unable to find service: " + service + "; skipping");
                continue;
            }
            mapObject(serviceAdapter);
View Full Code Here

Examples of org.apache.isis.runtimes.dflt.runtime.system.persistence.AdapterManager

        }
        return elements;
    }

    protected ObjectAdapter getAdapter(final ObjectSpecification specification, final Oid oid) {
        final AdapterManager objectLoader = IsisContext.getPersistenceSession().getAdapterManager();
        final ObjectAdapter adapter = objectLoader.getAdapterFor(oid);
        if (adapter != null) {
            return adapter;
        } else {
            return IsisContext.getPersistenceSession().recreateAdapter(oid, specification);
        }
View Full Code Here

Examples of org.apache.sling.api.adapter.AdapterManager

    public String getMimeType(String name) {
        return slingHttpContext.getMimeType(name);
    }

    public <Type> Type adaptTo(Object object, Class<Type> type) {
        AdapterManager adapterManager = this.adapterManager;
        if (adapterManager != null) {
            return adapterManager.getAdapter(object, type);
        }

        // no adapter manager, nothing to adapt to
        return null;
    }
View Full Code Here

Examples of org.apache.sling.api.adapter.AdapterManager

    /**
     * Make sure adaptions are inherited from source resource, but can be overridden by superimposing resource instance.
     */
    @Test
    public void testAdaptTo() {
        SlingAdaptable.setAdapterManager(new AdapterManager() {
            @SuppressWarnings("unchecked")
            public <AdapterType> AdapterType getAdapter(Object adaptable, Class<AdapterType> type) {
                if (adaptable instanceof SuperimposingResource && type==String.class) {
                    return (AdapterType)"mystring";
                }
View Full Code Here

Examples of org.eclipse.core.internal.runtime.AdapterManager

    // Register the PHPDebugElementAdapterFactory.
    // To make sure we are the first adapter factory for the IVariable
    // class, we insert the
    // factory before any other factory.
    AdapterManager manager = (AdapterManager) Platform.getAdapterManager();
    List list = (List) manager.getFactories()
        .get(IVariable.class.getName());
    PHPDebugElementAdapterFactory propertiesFactory = new PHPDebugElementAdapterFactory();
    manager.registerAdapters(propertiesFactory, IVariable.class);
    // In case the list had some factories, make sure our factory is the
    // first in the list.
    if (list != null && list.size() > 1) {
      list.remove(propertiesFactory);
      list.add(0, propertiesFactory);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.