Package org.eclipse.ecf.remoteservice

Examples of org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter


    for (int i = 0; i < containers.length; i++) {
      // Do *not* include containers with same ID as endpointID
      if (matchContainerID(containers[i], endpointID))
        continue;

      IRemoteServiceContainerAdapter adapter = hasRemoteServiceContainerAdapter(containers[i]);
      // Container must have adapter
      if (adapter != null
          // And it must match the connect namespace
          && matchConnectNamespace(containers[i], endpointID,
              connectTargetID)
View Full Code Here


    try {
      IContainer container = (properties == null) ? getContainerFactory()
          .createContainer(containerTypeDescriptionName)
          : getContainerFactory().createContainer(
              containerTypeDescriptionName, properties);
      IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) container
          .getAdapter(IRemoteServiceContainerAdapter.class);
      if (adapter == null)
        throw new SelectContainerException(
            "Container does not implement IRemoteServiceContainerAdapter", null, containerTypeDescription); //$NON-NLS-1$
      return new RemoteServiceContainer(container);
View Full Code Here

    final BundleContext proxyServiceFactoryContext = getProxyServiceFactoryContext(endpointDescription);
    if (proxyServiceFactoryContext == null)
      throw new NullPointerException(
          "getProxyServiceFactoryContext returned null.  Cannot register proxy service factory"); //$NON-NLS-1$

    final IRemoteServiceContainerAdapter containerAdapter = rsContainer
        .getContainerAdapter();
    ID rsContainerID = rsContainer.getContainer().getID();
    // First get IRemoteService for selectedRsReference
    final IRemoteService rs = containerAdapter
        .getRemoteService(selectedRsReference);
    if (rs == null)
      throw new NullPointerException(
          "getRemoteService returned null for selectedRsReference=" //$NON-NLS-1$
              + selectedRsReference + ",rsContainerID=" //$NON-NLS-1$
View Full Code Here

    // Create remote service properties
    Map remoteServiceProperties = copyNonReservedProperties(
        serviceReference, (Map<String, Object>) overridingProperties,
        new TreeMap<String, Object>(String.CASE_INSENSITIVE_ORDER));

    IRemoteServiceContainerAdapter containerAdapter = rsContainer
        .getContainerAdapter();

    // Register remote service via ECF container adapter to create
    // remote service registration
    IRemoteServiceRegistration remoteRegistration = null;
    if (containerAdapter instanceof IOSGiRemoteServiceContainerAdapter) {
      IOSGiRemoteServiceContainerAdapter osgiContainerAdapter = (IOSGiRemoteServiceContainerAdapter) containerAdapter;
      remoteRegistration = osgiContainerAdapter.registerRemoteService(
          exportedInterfaces, serviceReference, PropertiesUtil
              .createDictionaryFromMap(remoteServiceProperties));
    } else {
      Object service = AccessController
          .doPrivileged(new PrivilegedAction<Object>() {
            public Object run() {
              return getClientBundleContext().getService(
                  serviceReference);
            }
          });
      remoteRegistration = containerAdapter.registerRemoteService(
          exportedInterfaces, service, PropertiesUtil
              .createDictionaryFromMap(remoteServiceProperties));
    }
   
    endpointDescriptionProperties.put(
View Full Code Here

    // Get remote service filter
    final String rsFilter = getRemoteServiceFilter(endpointDescription);
    // IRemoteServiceReferences from query
    Collection<IRemoteServiceReference> rsRefs = new ArrayList<IRemoteServiceReference>();
    // Get IRemoteServiceContainerAdapter
    final IRemoteServiceContainerAdapter containerAdapter = rsContainer
        .getContainerAdapter();
    // rsContainerID
    ID rsContainerID = rsContainer.getContainer().getID();
    try {
      // Get first interface name for service reference
      // lookup
      final String intf = interfaces.iterator().next();
      // Get/lookup remote service references
      IRemoteServiceReference[] refs = AccessController
          .doPrivileged(new PrivilegedExceptionAction<IRemoteServiceReference[]>() {
            public IRemoteServiceReference[] run()
                throws ContainerConnectException,
                InvalidSyntaxException {
              return containerAdapter.getRemoteServiceReferences(
                  targetID, idFilter, intf, rsFilter);
            }
          });
      if (refs == null) {
        logWarning("doImportService", //$NON-NLS-1$
View Full Code Here

      return results;

    for (int i = 0; i < containers.length; i++) {
      // Check to make sure it's a rs container adapter. If it's not go
      // onto next one
      IRemoteServiceContainerAdapter adapter = hasRemoteServiceContainerAdapter(containers[i]);
      if (adapter == null)
        continue;
      // Get container type description and intents
      ContainerTypeDescription description = getContainerTypeDescription(containers[i]);
      // If it has no description go onto next
View Full Code Here

      ServiceReference serviceReference, Map<String, Object> properties,
      ContainerTypeDescription containerTypeDescription)
      throws SelectContainerException {
    IContainer container = createContainer(serviceReference, properties,
        containerTypeDescription);
    IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) container
        .getAdapter(IRemoteServiceContainerAdapter.class);
    if (adapter == null)
      throw new SelectContainerException(
          "Container does not implement IRemoteServiceContainerAdapter", null, containerTypeDescription); //$NON-NLS-1$
    return new RemoteServiceContainer(container, adapter);
View Full Code Here

  protected IRemoteServiceContainer[] getRemoteServiceContainers(
      IContainer[] containers) {
    List results = new ArrayList();
    for (int i = 0; i < containers.length; i++) {
      IRemoteServiceContainerAdapter adapter = hasRemoteServiceContainerAdapter(containers[i]);
      if (adapter != null)
        results.add(new RemoteServiceContainer(containers[i], adapter));
    }
    return (IRemoteServiceContainer[]) results
        .toArray(new IRemoteServiceContainer[] {});
View Full Code Here

   */
  public Object execute(ExecutionEvent event) throws ExecutionException {
    final String clazz = event
        .getParameter("org.eclipse.ecf.remoteservices.ui.commands.reflectiveMethodDialogParameter"); //$NON-NLS-1$

    final IRemoteServiceContainerAdapter adapter = RemoteServiceHandlerUtil
        .getActiveIRemoteServiceContainerAdapterChecked(event);
    if (adapter == null) {
      MessageDialog.openError(null, "Handler invocation failed",
          "No container found");
      return null;
    }

    final IRemoteServiceReference[] references = RemoteServiceHandlerUtil
        .getActiveIRemoteServiceReferencesChecked(event);
    if (references == null || references.length == 0) {
      MessageDialog.openError(null, "Handler invocation failed",
          "No remote service reference found");
      return null;
    }

    final IRemoteService remoteService = adapter
        .getRemoteService(references[0]);
    if (remoteService == null) {
      MessageDialog.openError(null, "Handler invocation failed",
          "No remote service found");
      return null;
View Full Code Here

    final ID activeConnectId = getActiveConnectIDChecked(event);
    final IContainer container = getContainerWithConnectID(activeConnectId);
    if (container == null) {
      return null;
    }
    final IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) container
        .getAdapter(IRemoteServiceContainerAdapter.class);
    return adapter;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter

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.