Examples of ServiceRegistration


Examples of com.spotify.helios.serviceregistration.ServiceRegistration

    } catch (Exception e) {
      log.error("Unable to start server, shutting down", e);
      server.stop();
    }

    final ServiceRegistration serviceRegistration = ServiceRegistration.newBuilder()
        .endpoint("helios", "http", config.getHttpEndpoint().getPort(),
            config.getDomain(), config.getName())
        .build();
    registrar.register(serviceRegistration);
  }
View Full Code Here

Examples of demo.org.powermock.examples.tutorial.staticmocking.osgi.ServiceRegistration

  /**
   * {@inheritDoc}
   */
  public long registerService(String name, Object serviceImplementation) {
    ServiceRegistration registerService = bundleContext.registerService(name, serviceImplementation, null);
    final long id = IdGenerator.generateNewId();
    serviceRegistrations.put(id, registerService);
    return id;
  }
View Full Code Here

Examples of net.jini.core.lookup.ServiceRegistration

                    e.printStackTrace();
                    throw new RuntimeException(e.toString());
                }
                logger.log(Level.FINE, "registering test service "
                                              +i+" with lookup service "+loc);
                ServiceRegistration srvcReg =
                 lookupProxy.register(new ServiceItem(srvcID,testService,null),
                                      Long.MAX_VALUE);
    Lease srvcLease = null;
    try {
        srvcReg = (ServiceRegistration) getConfig().prepare(
           "test.reggieServiceRegistrationPreparer",
           srvcReg);
        srvcLease = (Lease) getConfig().prepare(
           "test.reggieServiceRegistrationPreparer",
           srvcReg.getLease());
    } catch (TestException e) {
        throw new RemoteException("Configuration error", e);
    }
                regInfo.srvcID      = srvcID;
                regInfo.srvcReg     = srvcReg;
                regInfo.srvcLease   = srvcLease;
                regInfo.lookupProxy = lookupProxy;
                /* Renew the service's lease until the test is complete */
                leaseRenewalMgr.renewUntil(srvcLease,
                                           Lease.FOREVER, //expiration
                                           leaseListener);//listener
                if(reRegister) {
                    /* Remove old lease from local leaseList and from LRM */
                    leaseRenewalMgr.remove( (Lease)(leaseList.remove(0)) );
                }//endif
                /* Store the new lease for clean up at the end of the test */
                leaseList.add(srvcLease); //add the new lease
                /* Create and set attribute(s) for service just registered */
                if(nAttrs > 0) {
                    regInfo.srvcAttrs = new Entry[nAttrs];
                    Entry[] attrs = new Entry[nAttrs];
                    for(int k=0;k<nAttrs;k++) {
                        logger.log(Level.FINE, "registering attribute "+k
                                          +" with test service "+i);
                        if(k==0) {
                            attrs[k] = new TestServiceIntAttr(attrVal);
                        } else { // placeholder for future attributes
                            attrs[k] = new TestServiceIntAttr(attrVal);
                        }//endif
                        regInfo.srvcAttrs[k] = attrs[k];
                    }//end loop
                    srvcReg.setAttributes(attrs);
                }//endif
                regInfoList.add(regInfo);
            }//end loop (j) - service registration loop
            synchronized(regInfoMap) {
                if(reRegister) {
View Full Code Here

Examples of org.apache.felix.httplite.osgi.ServiceRegistration

     */
    public String getServletPath()
    {
        if ( m_servletPath == null )
        {
            ServiceRegistration element = m_resolver.getServiceRegistration( m_uri );

            if ( element == null )
            {
                throw new IllegalStateException( "Unable to get ServletElement for HttpRequest." );
            }

            m_servletPath = element.getAlias();
        }

        return m_servletPath;
    }
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

      return;
    }
    Hashtable registrationProperties = objName.getKeyPropertyList();
    registrationProperties.put("domain", objName.getDomain());
    if (registeredServices.containsKey(objName)) {
      ServiceRegistration registration = (ServiceRegistration) registeredServices.get(objName);
      registration.setProperties(registrationProperties);
      return;
    }
   
    Set serviceNames = new HashSet();
    computeOSGiServiceNames(obj.getClass(), obj, serviceNames);
    ServiceRegistration registration = Activator.context.registerService((String[]) serviceNames.toArray(new String[serviceNames.size()]), obj, registrationProperties);
    registeredServices.put(objName, registration);
  }
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

      return;
    ObjectName objName = ObjectName.getInstance(fullName);
    mxserver.unregisterMBean(objName);

    if (registerAsService) {
      ServiceRegistration registration = (ServiceRegistration) registeredServices.remove(objName);
      if (registration != null) {
        registration.unregister();
      }
    }
  }
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

  }

  public void start(BundleContext context)
    throws Exception
  {
    final ServiceRegistration registration
      = context.registerService(FooService.class.getName(), this, null);

    System.out.println("bar: Registered " + registration);
  }
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

  }

  public void start(BundleContext context)
    throws Exception
  {
    final ServiceRegistration registration
      = context.registerService(FooService.class.getName(), this, null);

    System.out.println("bundleSL4: Registered " + registration);
  }
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

        prop.put(JiniDriver.SERVICE_ID, item.serviceID.toString());
        Debug.printDebugInfo(10,
            "Registering Jini Service in OSGi Framework " +
            item.serviceID.toString());

        ServiceRegistration reg = Activator.bc.registerService(toStrings(),
                service, prop);
        services.put(service, reg);
        Debug.printDebugInfo(10,
            "Registering Jini Service in OSGi Framework Completed " +
            item.serviceID.toString());
View Full Code Here

Examples of org.osgi.framework.ServiceRegistration

        prop.put(JiniDriver.SERVICE_ID, item.serviceID.toString());
        Debug.printDebugInfo(10,
            "Changing Jini Service properties in OSGi Framework " +
            item.serviceID.toString());

        ServiceRegistration reg = (ServiceRegistration) services.get(service);

        if (reg != null) {
            reg.setProperties(prop);
        } else {
            Debug.printDebugInfo(10, "Service is no longer in OSGi Framework");
        }

        Debug.printDebugInfo(10,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.