Package ch.ethz.iks.r_osgi

Examples of ch.ethz.iks.r_osgi.RemoteOSGiService


   * @see org.eclipse.ecf.core.provider.IContainerInstantiator#createInstance(org.eclipse.ecf.core.ContainerTypeDescription,
   *      java.lang.Object[])
   */
  public IContainer createInstance(final ContainerTypeDescription description, final Object[] parameters) throws ContainerCreateException {
    try {
      final RemoteOSGiService remoteOSGiService = Activator.getDefault().getRemoteOSGiService();
      if (parameters == null) {
        //TODO factor localHost and protocol out?
        final String localHost = InetAddress.getLocalHost().getCanonicalHostName();
        final String protocol = "r-osgi"; //$NON-NLS-1$

        final int port = remoteOSGiService.getListeningPort(protocol);
        final ID containerID = new R_OSGiID(protocol + "://" + localHost + ":" + port); //$NON-NLS-1$ //$NON-NLS-2$
        return new R_OSGiRemoteServiceContainer(remoteOSGiService, containerID);
      } else if (parameters.length > 0) {
        if (parameters[0] instanceof ID) {
          return new R_OSGiRemoteServiceContainer(remoteOSGiService, (ID) parameters[0]);
View Full Code Here

TOP

Related Classes of ch.ethz.iks.r_osgi.RemoteOSGiService

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.