Package org.eclipse.ecf.core

Examples of org.eclipse.ecf.core.ContainerTypeDescription


  public void start(final BundleContext context) throws Exception {
    SafeRunner.run(new ExtensionRegistryRunnable(context) {
      @Override
      protected void runWithoutRegistry() throws Exception {
        context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(TimeServiceRestClientContainer.TIMESERVICE_CONSUMER_CONFIG_NAME, new TimeServiceRestClientContainerInstantiator(), "TimeService REST Client", false ,false), null);
      }
    });
  }
View Full Code Here


      for (int i = 0; i < args.length - 1; i++) {
        sharedObjectClassNames[i] = args[i + 1];
      }
    }
    // Setup factory descriptions since Eclipse does not do this for us
    contd = new ContainerTypeDescription(CONTAINER_FACTORY_NAME, CONTAINER_FACTORY_CLASS, null);
    ContainerFactory.getDefault().addDescription(contd);
    for (int i = 0; i < clientCount; i++) {
      sm[i] = createClient();
    }
  }
View Full Code Here

    this.context = context;
   
    SafeRunner.run(new ExtensionRegistryRunnable(context) {
      protected void runWithoutRegistry() throws Exception {
        context.registerService(Namespace.class, new DnsSdNamespace(), null);
        context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(DISCOVERY_CONTAINER_NAME_VALUE + LOCATOR,new ContainerInstantiator(),"Discovery Locator Container"), null);
        context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(DISCOVERY_CONTAINER_NAME_VALUE + ADVERTISER,new ContainerInstantiator(),"Discovery Advertiser Container"), null);
      }
    });
   
    // register a managed factory for the locator service
    final Properties locCmProps = new Properties();
View Full Code Here

  public void start(final BundleContext context) throws Exception {
    SafeRunner.run(new ExtensionRegistryRunnable(context) {
      @Override
      protected void runWithoutRegistry() throws Exception {
        context.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(TimeServiceServerContainer.TIMESERVICE_HOST_CONFIG_NAME, new TimeServiceServerContainerInstantiator(), "TimeService REST Server", true,false), null);
      }
    });
  }
View Full Code Here

  private TCPServerSOContainer createServerContainer(String id, TCPServerSOContainerGroup group, String path, int keepAlive) throws IDCreateException {
    final ID newServerID = IDFactory.getDefault().createStringID(id);
    TCPServerSOContainer container = new TCPServerSOContainer(new SOContainerConfig(newServerID), group, path, keepAlive);
    IContainerManager containerManager = Activator.getDefault().getContainerManager();
    if (containerManager != null) {
      ContainerTypeDescription ctd = containerManager.getContainerFactory().getDescriptionByName("ecf.generic.server"); //$NON-NLS-1$
      containerManager.addContainer(container, ctd);
    }
    return container;
  }
View Full Code Here

    if (path == null || path.equals("")) //$NON-NLS-1$
      throw new NullPointerException("Cannot create ID with null or empty path"); //$NON-NLS-1$
    GenericServerContainer s = new GenericServerContainer(this, createServerConfig(path), serverGroup, path, keepAlive);
    IContainerManager containerManager = Activator.getDefault().getContainerManager();
    if (containerManager != null) {
      ContainerTypeDescription ctd = containerManager.getContainerFactory().getDescriptionByName("ecf.generic.server"); //$NON-NLS-1$
      containerManager.addContainer(s, ctd);
    }
    IConnectHandlerPolicy policy = createConnectHandlerPolicy(s, path);
    if (policy != null)
      s.setConnectPolicy(policy);
View Full Code Here

    if (path == null || path.equals("")) //$NON-NLS-1$
      throw new NullPointerException("Cannot create ID with null or empty path"); //$NON-NLS-1$
    SSLGenericServerContainer s = new SSLGenericServerContainer(this, createServerConfig(path), serverGroup, path, keepAlive);
    IContainerManager containerManager = Activator.getDefault().getContainerManager();
    if (containerManager != null) {
      ContainerTypeDescription ctd = containerManager.getContainerFactory().getDescriptionByName("ecf.generic.server"); //$NON-NLS-1$
      containerManager.addContainer(s, ctd);
    }
    IConnectHandlerPolicy policy = createConnectHandlerPolicy(s, path);
    if (policy != null)
      s.setConnectPolicy(policy);
View Full Code Here

    assertNotNull(container);
    assertTrue(container instanceof RestClientContainer);
  }

  public void testCreateContainer2() throws Exception {
    ContainerTypeDescription description = getContainerFactory()
        .getDescriptionByName(RestConstants.REST_CONTAINER_TYPE);
    IContainer container = getContainerFactory().createContainer(description,
        new Object[] { new URL(RestConstants.TEST_DE_TARGET) });
    assertNotNull(container);
    assertTrue(container instanceof RestClientContainer);
View Full Code Here

    assertNotNull(container);
    assertTrue(container instanceof RestClientContainer);
  }

  public void testCreateContainer3() throws Exception {
    ContainerTypeDescription description = getContainerFactory()
        .getDescriptionByName(RestConstants.REST_CONTAINER_TYPE);
    IContainer container = getContainerFactory().createContainer(description,
        new Object[] { new URI(RestConstants.TEST_DE_TARGET) });
    assertNotNull(container);
    assertTrue(container instanceof RestClientContainer);
View Full Code Here

    context = ctxt;
   
    SafeRunner.run(new ExtensionRegistryRunnable(ctxt) {
      protected void runWithoutRegistry() throws Exception {
        ctxt.registerService(Namespace.class,new ZooDiscoveryNamespace(), null);
        ctxt.registerService(ContainerTypeDescription.class,new ContainerTypeDescription(ZooDiscoveryContainerInstantiator.NAME,new ZooDiscoveryContainerInstantiator(),"Zookeeper Discovery Container"), null);
        ctxt.registerService(ContainerTypeDescription.class,new ContainerTypeDescription(ZooDiscoveryContainerInstantiator.NAME+".advertiser",new ZooDiscoveryContainerInstantiator(),"Zookeeper Discovery Advertiser Container"), null);
        ctxt.registerService(ContainerTypeDescription.class,new ContainerTypeDescription(ZooDiscoveryContainerInstantiator.NAME+".locator",new ZooDiscoveryContainerInstantiator(),"Zookeeper Discovery Locator Container"), null);       
      }
    });
   
    final Properties props = new Properties();
    props.put(IDiscoveryLocator.CONTAINER_NAME, ZooDiscoveryContainerInstantiator.NAME);
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.core.ContainerTypeDescription

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.