Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.IAdapterManager


    // First, try to get the adapter manager via
    if (adapterManagerTracker == null) {
      adapterManagerTracker = new ServiceTracker(this.context, IAdapterManager.class.getName(), null);
      adapterManagerTracker.open();
    }
    IAdapterManager adapterManager = (IAdapterManager) adapterManagerTracker.getService();
    // Then, if the service isn't there, try to get from Platform class via
    // PlatformHelper class
    if (adapterManager == null)
      adapterManager = PlatformHelper.getPlatformAdapterManager();
    return adapterManager;
View Full Code Here


  public Object getAdapter(Class adapter) {
    if (adapter == null)
      return null;
    if (adapter.isInstance(this))
      return this;
    final IAdapterManager adapterManager = XmppPlugin.getDefault().getAdapterManager();
    return (adapterManager == null) ? null : adapterManager.loadAdapter(this, adapter.getName());
  }
View Full Code Here

   * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
   */
  public Object getAdapter(Class adapter) {
    if (adapter == null)
      return null;
    final IAdapterManager adapterManager = Activator.getDefault().getAdapterManager();
    if (adapterManager == null)
      return null;
    return adapterManager.loadAdapter(this, adapter.getName());
  }
View Full Code Here

  public Object getAdapter(Class adapter) {
    if (adapter == null)
      return null;
    if (adapter.isInstance(this))
      return this;
    final IAdapterManager adapterManager = XmppPlugin.getDefault()
        .getAdapterManager();
    return (adapterManager == null) ? null : adapterManager.loadAdapter(
        this, adapter.getName());
  }
View Full Code Here

  public Object getAdapter(Class adapter) {
    if (adapter == null)
      return null;
    if (adapter.isInstance(this))
      return this;
    final IAdapterManager adapterManager = XmppPlugin.getDefault()
        .getAdapterManager();
    return (adapterManager == null) ? null : adapterManager.loadAdapter(
        this, adapter.getName());
  }
View Full Code Here

    if (adapter == null)
      return null;
    if (adapter.isInstance(this)) {
      return this;
    }
    final IAdapterManager adapterManager = Activator.getDefault().getAdapterManager();
    return (adapterManager == null) ? null : adapterManager.loadAdapter(this, adapter.getName());
  }
View Full Code Here

            public Object getAdapter(Class adapter) {
              if (adapter == null)
                return null;
              if (adapter.isInstance(this))
                return this;
              final IAdapterManager adapterManager = XmppPlugin
                  .getDefault().getAdapterManager();
              return (adapterManager == null) ? null
                  : adapterManager.loadAdapter(this,
                      adapter.getName());
            }

            public long getFileSize() {
              return request.getFileSize();
View Full Code Here

  private List<IAdapterFactory> rscAdapterFactories;

  private static IAdapterManager getAdapterManager(BundleContext ctx) {
    AdapterManagerTracker t = new AdapterManagerTracker(ctx);
    t.open();
    IAdapterManager am = t.getAdapterManager();
    t.close();
    return am;
  }
View Full Code Here

      protected void runWithoutRegistry() throws Exception {
        context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(J8GenericContainerInstantiator.JAVA8_SERVER_NAME, new J8GenericContainerInstantiator(), "ECF Java8 Generic Server", true, false), null); //$NON-NLS-1$
        context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(J8GenericContainerInstantiator.JAVA8_CLIENT_NAME, new J8GenericContainerInstantiator(), "ECF Java8 Generic Client", false, false), null); //$NON-NLS-1$
        context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(J8SSLGenericContainerInstantiator.JAVA8_SSL_CLIENT_NAME, new J8SSLGenericContainerInstantiator(), "ECF Java8 SSL Generic Client", false, false), null); //$NON-NLS-1$
        context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(J8SSLGenericContainerInstantiator.JAVA8_SSL_SERVER_NAME, new J8SSLGenericContainerInstantiator(), "ECF Java8 SSL Generic Server", true, false), null); //$NON-NLS-1$
        IAdapterManager am = getAdapterManager(context);
        if (am != null) {
          rscAdapterFactories = new ArrayList<IAdapterFactory>();
          IAdapterFactory af = new J8RemoteServiceContainerAdapterFactory();
          am.registerAdapters(af, J8SSLServerSOContainer.class);
          rscAdapterFactories.add(af);
          af = new J8RemoteServiceContainerAdapterFactory();
          am.registerAdapters(af, J8TCPServerSOContainer.class);
          rscAdapterFactories.add(af);
          af = new J8RemoteServiceContainerAdapterFactory();
          am.registerAdapters(af, J8SSLClientSOContainer.class);
          rscAdapterFactories.add(af);
          af = new J8RemoteServiceContainerAdapterFactory();
          am.registerAdapters(af, J8TCPClientSOContainer.class);
          rscAdapterFactories.add(af);
        }
      }
    });
View Full Code Here

  }

  @Override
  public void stop(BundleContext context) throws Exception {
    if (rscAdapterFactories != null) {
      IAdapterManager am = getAdapterManager(context);
      if (am != null) {
        for (IAdapterFactory af : rscAdapterFactories)
          am.unregisterAdapters(af);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.runtime.IAdapterManager

Copyright © 2018 www.massapicom. 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.