Package org.eclipse.ecf.core.identity

Examples of org.eclipse.ecf.core.identity.ID


  public static IContainer getActiveIRemoteServiceContainerChecked(
      ExecutionEvent event) throws ExecutionException {
    final IServiceInfo serviceInfo = DiscoveryHandlerUtil
        .getActiveIServiceInfoChecked(event);
    final ID createConnectId = getActiveConnectIDChecked(event);
    final IContainer container = getContainerWithConnectID(createConnectId);
    if (container != null) {
      return container;
    }
    // TODO remove parameters once
View Full Code Here


    final IContainer[] containers = containerManager.getAllContainers();
    if (containers == null) {
      return null;
    }
    for (int i = 0; i < containers.length; i++) {
      ID connectedId = containers[i].getConnectedID();
      if (connectedId != null && connectedId.equals(aConnectedID)) {
        return containers[i];
      }
    }
    return null;
  }
View Full Code Here

  }

  private static IRemoteServiceReference[] getRemoteServiceReferencesForRemoteServiceAdapter(
      IRemoteServiceContainerAdapter adapter, IServiceInfo serviceInfo)
      throws InvalidSyntaxException, IDCreateException {
    ID serviceID = null;
    final String serviceNamespace = getServiceNamespace(serviceInfo);
    final String serviceid = getServiceID(serviceInfo);
    if (serviceNamespace != null && serviceid != null) {
      serviceID = IDFactory.getDefault().createID(serviceNamespace,
          serviceid);
View Full Code Here

  public void run(IAction action) {
    try {
      IRemoteServiceContainerAdapter adapter = getContainerAdapter();
      // Create target ID
      String target = TARGET;
      ID targetID = createTargetID(container,target);
      // Get and resolve remote service reference
      IRemoteServiceReference[] ref = adapter.getRemoteServiceReferences(targetID, org.eclipse.ecf.examples.remoteservices.common.IRemoteEnvironmentInfo.class.getName(), null);
      IRemoteService svc = adapter.getRemoteService(ref[0]);
      // get proxy
      IRemoteEnvironmentInfo proxy = (IRemoteEnvironmentInfo) svc.getProxy();
View Full Code Here

  protected void createChannel() throws ECFException {
    // Get IChannelContainerAdapter adapter
    IChannelContainerAdapter channelContainer = (IChannelContainerAdapter) container
        .getAdapter(IChannelContainerAdapter.class);
    // Create channel ID with fixed name 'channel2'
    final ID channelID = IDFactory.getDefault().createID(
        channelContainer.getChannelNamespace(), CHANNEL_ID);
    // Setup listener so then when channelmessageevents are received that
    // they present in UI
    final IChannelListener channelListener = new IChannelListener() {
      public void handleChannelEvent(final IChannelEvent event) {
View Full Code Here

 
  protected IChannel createChannel(IContainer container) throws ECFException {
    IChannelContainerAdapter channelContainer = (IChannelContainerAdapter) container.getAdapter(IChannelContainerAdapter.class);
    if (channelContainer == null) throw new NullPointerException("cannot get channel container adapter");
   
    ID channelID = IDFactory.getDefault().createID(channelContainer.getChannelNamespace(), "channel1");
    IChannelListener channelListener = new IChannelListener() {
      public void handleChannelEvent(IChannelEvent event) {
        System.out.println("handleChannelEvent("+event+")");
      }};
    return channelContainer.createChannel(channelID, channelListener, new HashMap());
View Full Code Here

    // create container instance from ECF ContainerFactory
    container = ContainerFactory.getDefault().createContainer(CONTAINER_TYPE);
    // create channel
    channel = createChannel(container);
    // create target ID
    ID targetID = IDFactory.getDefault().createID(container.getConnectNamespace(),TARGET_SERVER);
    // connect container to target
    container.connect(targetID, null);
  }
View Full Code Here

    // Check it's valid, throw if not
    if (channelContainer == null)
      throw new NullPointerException(
          "cannot get channel container adapter");
    // Create channel ID with fixed name 'channel2'
    final ID channelID = IDFactory.getDefault().createID(
        channelContainer.getChannelNamespace(), "channel2");
    // Setup listener so then when channelmessageevents are received that
    // they present in UI
    final IChannelListener channelListener = new IChannelListener() {
      public void handleChannelEvent(final IChannelEvent event) {
View Full Code Here

      newSet = (TreeSet) mySet.clone();
      newSet.remove(new Member(exclude));
    } else {
      newSet = mySet;
    }
    final ID ids[] = new ID[newSet.size()];
    final Iterator iter = newSet.iterator();
    int j = 0;
    while (iter.hasNext()) {
      ids[j++] = ((Member) iter.next()).getID();
    }
View Full Code Here

    }
    fireContainerEvent(new ContainerConnectedEvent(containerID, targetID));
  }

  public void disconnect() {
    ID oldId = connectedID;
    fireContainerEvent(new ContainerDisconnectingEvent(containerID, oldId));
    synchronized (connectLock) {
      connectedID = null;
      connectContext = null;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.core.identity.ID

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.