Examples of registerService()


Examples of org.eclipse.e4.xwt.internal.core.Core.registerService()

  private void initialize() {
    cores = new Stack<Core>();
    Core core = new Core(new ResourceLoaderFactory(), this);
    cores.push(core);

    core.registerService(ValueConvertorRegister.class,
        new ValueConvertorRegister());

    core.registerMetaclassManager(IConstants.XWT_NAMESPACE,
        new MetaclassManager(null, null, this));
    core.registerMetaclass(new BindingMetaclass(this),
View Full Code Here

Examples of org.eclipse.ecf.provider.dnssd.DnsSdDiscoveryAdvertiser.registerService()

  public void testRegisterServiceWithoutHostKey() throws ContainerConnectException {
    final DnsSdDiscoveryAdvertiser advertiser = new DnsSdDiscoveryAdvertiser();
    advertiser.connect(null, null);
   
    try {
      advertiser.registerService(serviceInfo);
    } catch(ECFRuntimeException e) {
      advertiser.disconnect();
      return;
    }
    fail("Register should have failed without a host key given.");
View Full Code Here

Examples of org.javabluetooth.stack.sdp.SDPServer.registerService()

     * short, byte[])
     */
    public void registerL2CAPService(L2CAPChannel channel, short serviceUUID, short browseUUID, byte[] serviceRecord) {
        SDPServer sdpServer = SDPServer.getSDPServer();
        BluetoothTCPChannelFactory channelFactory = new BluetoothTCPChannelFactory(channel);
        sdpServer.registerService(channelFactory, serviceUUID, browseUUID, serviceRecord);
    }
}

View Full Code Here

Examples of org.jboss.gravia.runtime.ModuleContext.registerService()

        Runtime runtime = RuntimeLocator.getRequiredRuntime();
        ModuleContext syscontext = runtime.getModuleContext();

        Dictionary<String, Object> props = new Hashtable<>();
        props.put(Constants.URL_HANDLER_PROTOCOL, "foo");
        ServiceRegistration<URLStreamHandler> sreg = syscontext.registerService(URLStreamHandler.class, new MyHandler(), props);

        try {
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            IOUtils.copyStream(new URL("foo://somehost").openStream(), baos);
            Assert.assertEquals("somehost", new String(baos.toByteArray()));
View Full Code Here

Examples of org.osgi.framework.BundleContext.registerService()

        System.out.println(" " + names[i]);
       
      }
      */
      BundleContext regBC = sr.getBundle().getBundleContext();
      reg = regBC.registerService(Object.class.getName(), dispatcher, props);
    } else {
      // System.out.println("no names in " + cg);
    }
  }

View Full Code Here

Examples of org.osgi.framework.BundleContext.registerService()

        properties.put(Constants.SERVICE_VENDOR, "Apache Software Foundation");
        properties.put(Constants.SERVICE_DESCRIPTION, "Sling Models OSGi Service Disposal Job");
        properties.put("scheduler.concurrent", false);
        properties.put("scheduler.period", Long.valueOf(30));

        this.jobRegistration = bundleContext.registerService(Runnable.class.getName(), this, properties);

        this.listener = new ModelPackageBundleListener(ctx.getBundleContext(), this, this.adapterImplementations);

        Hashtable<Object, Object> printerProps = new Hashtable<Object, Object>();
        printerProps.put(Constants.SERVICE_VENDOR, "Apache Software Foundation");
View Full Code Here

Examples of org.osgi.framework.BundleContext.registerService()

        printerProps.put(Constants.SERVICE_DESCRIPTION, "Sling Models Configuration Printer");
        printerProps.put("felix.webconsole.label", "slingmodels");
        printerProps.put("felix.webconsole.title", "Sling Models");
        printerProps.put("felix.webconsole.configprinter.modes", "always");

        this.configPrinterRegistration = bundleContext.registerService(Object.class.getName(),
                new ModelConfigurationPrinter(this), printerProps);
    }

    @Deactivate
    protected void deactivate() {
View Full Code Here

Examples of org.osgi.framework.BundleContext.registerService()

        assertNull(sampleObject.adaptTo(String.class));

        BundleContext bundleContext = MockOsgi.newBundleContext();
        MockSling.setAdapterManagerBundleContext(bundleContext);

        bundleContext.registerService(AdapterFactory.class.getName(), new AdapterFactory() {
            @SuppressWarnings("unchecked")
            @Override
            public <AdapterType> AdapterType getAdapter(final Object adaptable, final Class<AdapterType> type) {
                if (adaptable instanceof AdaptableTest && type.isAssignableFrom(String.class)) {
                    return (AdapterType) ((AdaptableTest) adaptable).toString();
View Full Code Here

Examples of org.osgi.framework.BundleContext.registerService()

        final SlingPostOperation service = (SlingPostOperation) this.bundleContext.getService(serviceReference);
        final PostOperationProxy proxy = new PostOperationProxy(service);

        final BundleContext bundleContext = serviceReference.getBundle().getBundleContext();
        final Dictionary<String, Object> props = copyServiceProperties(serviceReference);
        final ServiceRegistration reg = bundleContext.registerService(
            PostOperation.SERVICE_NAME, proxy, props);

        log.debug("Registering {}", proxy);
        synchronized (this.proxies) {
            this.proxies.put(serviceReference, reg);
View Full Code Here

Examples of org.osgi.framework.BundleContext.registerService()

    @SuppressWarnings("unchecked")
    @Before
    public void setup() throws Exception {
        final BundleContext bc = Mockito.mock(BundleContext.class);
        Mockito.when(bc.registerService(Mockito.any(String[].class),
                Mockito.any(),
                Mockito.any(Dictionary.class))).thenReturn(null);

        final SlingSettingsService otherSettings = Mockito.mock(SlingSettingsService.class);
        Mockito.when(otherSettings.getSlingId()).thenReturn(OTHER_APP_ID);
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.