Package org.eclipse.ecf.core

Examples of org.eclipse.ecf.core.IContainerFactory


  protected IContainer createContainer(ServiceReference serviceReference,
      Map<String, Object> properties,
      ContainerTypeDescription containerTypeDescription)
      throws SelectContainerException {

    IContainerFactory containerFactory = getContainerFactory();

    final Object containerFactoryArguments = getContainerFactoryArguments(
        serviceReference, properties, containerTypeDescription);

    try {
      if (containerFactoryArguments instanceof String) {
        return containerFactory.createContainer(
            containerTypeDescription,
            (String) containerFactoryArguments);
      } else if (containerFactoryArguments instanceof ID) {
        return containerFactory.createContainer(
            containerTypeDescription,
            (ID) containerFactoryArguments);
      } else if (containerFactoryArguments instanceof Object[]) {
        return containerFactory.createContainer(
            containerTypeDescription,
            (Object[]) containerFactoryArguments);
      } else if (containerFactoryArguments instanceof Map) {
        return containerFactory.createContainer(
            containerTypeDescription,
            (Map) containerFactoryArguments);
      }
      return containerFactory.createContainer(containerTypeDescription);
    } catch (ContainerCreateException e) {
      throw new SelectContainerException(
          "Exception creating or configuring container", e, //$NON-NLS-1$
          containerTypeDescription);
    }
View Full Code Here


      throws SelectContainerException {
    if (remoteSupportedConfigs == null
        || remoteSupportedConfigs.length == 0)
      return null;
    // Get container factory
    IContainerFactory containerFactory = getContainerFactory();
    if (containerFactory == null)
      return null;
    // Get all container type descriptions from factory
    List containerTypeDescriptions = containerFactory.getDescriptions();
    if (containerTypeDescriptions == null)
      return null;

    // Go through all containerTypeDescriptions
    for (Iterator i = containerTypeDescriptions.iterator(); i.hasNext();) {
View Full Code Here

    }
    this.context = null;
  }

  private IContainer createContainer(CommandInterpreter interpreter, String containerTypeDescriptionName, String[] args) {
    IContainerFactory containerFactory = getContainerFactory();
    try {
      if (containerTypeDescriptionName == null) return containerFactory.createContainer();
      else if (args == null) return containerFactory.createContainer(containerTypeDescriptionName);
      else return containerFactory.createContainer(containerTypeDescriptionName,args);
    } catch (Exception e) {
      printException(interpreter,"Could not create container with type="+containerTypeDescriptionName,e);
      return null;
    }
  }
View Full Code Here

    super.tearDown();
    if (r != null) r.unregister();
  }
 
  public void testCreateContainer() throws Exception {
    IContainerFactory f = Activator.getDefault().getContainerFactory();
    IContainer c = f.createContainer(getClass().getName());
    assertNotNull(c);
  }
View Full Code Here

  protected IContainer createContainer() throws ContainerCreateException {
    if (containerId == null)
      return super.createBasicContainer();

    IContainerFactory containerFactory = getContainerFactory();
    String containerType = getContainerType();
    return containerFactory.createContainer(containerType, containerId);
  }
View Full Code Here

  protected void createConfigureAndConnectContainer()
      throws ContainerCreateException, SharedObjectAddException,
      ContainerConnectException {
    // get container factory and create container
    IContainerFactory containerFactory = getContainerManager()
        .getContainerFactory();
    container = (containerId == null) ? containerFactory
        .createContainer(containerType) : containerFactory
        .createContainer(containerType, new Object[] { containerId });

    // Get socontainer
    ISharedObjectContainer soContainer = (ISharedObjectContainer) container
        .getAdapter(ISharedObjectContainer.class);
View Full Code Here

        null);
  }

  protected void createContainer() throws ECFException {
    // get container factory and create container
    IContainerFactory containerFactory = getContainerManager()
        .getContainerFactory();
    // If the containerId is null, the id is *not* passed to the container
    // factory
    // If it is non-null (i.e. the server), then it's passed to the factory
    container = (containerId == null) ? containerFactory
        .createContainer(containerType) : containerFactory
        .createContainer(containerType, new Object[] { containerId });

  }
View Full Code Here

TOP

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

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.