Examples of registerService()


Examples of muduo.rpc.RpcClient.registerService()

    }

    @SuppressWarnings("unused")
    private static void asyncConnect(InetSocketAddress addr) {
        final RpcClient client = new RpcClient();
        client.registerService(Sudoku.SudokuService.newReflectiveService(new SudokuImpl()));
        client.startConnect(addr, new NewChannelCallback() {
            @Override
            public void run(RpcChannel channel) {
                sendAsyncRequest(channel, client);
            }
View Full Code Here

Examples of muduo.rpc.RpcServer.registerService()

public class Server {

    public static void main(String[] args) {
        RpcServer server = new RpcServer();
        server.registerService(Sudoku.SudokuService.newReflectiveService(new SudokuImpl()));
        server.setNewChannelCallback(new NewChannelCallback() {

            @Override
            public void run(RpcChannel channel) {
                // TODO call client
View Full Code Here

Examples of org.apache.activemq.transport.discovery.DiscoveryAgent.registerService()

    public void start() throws Exception {
        getServer().start();
        DiscoveryAgent da = getDiscoveryAgent();
        if (da != null) {
            da.registerService(getConnectUri().toString());
            da.start();
        }
        if (enableStatusMonitor) {
            this.statusDector = new TransportStatusDetector(this);
            this.statusDector.start();
View Full Code Here

Examples of org.apache.felix.framework.ServiceRegistry.registerService()

            }
        };

        Logger logger = new Logger();
        ServiceRegistry registry = new ServiceRegistry(logger, null);
        registry.registerService(b4.getBundleContext(), new String [] {EventHook.class.getName()}, eh1, new Hashtable());
        registry.registerService(b4.getBundleContext(), new String [] {EventHook.class.getName()}, eh2, new Hashtable());

        // -- Set up event dispatcher
        EventDispatcher ed = new EventDispatcher(logger, registry);
View Full Code Here

Examples of org.apache.felix.framework.ServiceRegistry.registerService()

        };

        Logger logger = new Logger();
        ServiceRegistry registry = new ServiceRegistry(logger, null);
        registry.registerService(b4.getBundleContext(), new String [] {EventHook.class.getName()}, eh1, new Hashtable());
        registry.registerService(b4.getBundleContext(), new String [] {EventHook.class.getName()}, eh2, new Hashtable());

        // -- Set up event dispatcher
        EventDispatcher ed = new EventDispatcher(logger, registry);

        // -- Register some listeners
View Full Code Here

Examples of org.apache.felix.ipojo.context.ServiceRegistry.registerService()

     
    registry.addServiceListener(filtered, "(foo=bar)");
   
    Properties props = new Properties();
    props.put("foo", "bar");
    ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
   
    try {
      assertEquals("Check number of registred service", 1, registry.getServiceReferences(null, null).length);
    } catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
     
View Full Code Here

Examples of org.apache.felix.ipojo.context.ServiceRegistry.registerService()

   
    try {
      assertEquals("Check number of registred service", 1, registry.getServiceReferences(null, null).length);
    } catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
     
    ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
     
     try {
      assertEquals("Check number of registred service", 2, registry.getServiceReferences(null, null).length);
    } catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
       
View Full Code Here

Examples of org.apache.felix.ipojo.context.ServiceRegistry.registerService()

      assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
    } catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
   
    Properties props = new Properties();
    props.put("foo", "bar");
    ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
   
    ServiceReference ref = registry.getServiceReference(BarService.class.getName());
    assertNotNull("Check ref not null", ref);
    assertEquals("Test property", ref.getProperty("foo"), "bar");
    BarService bar = (BarService) registry.getService(im2, ref);
View Full Code Here

Examples of org.apache.felix.ipojo.context.ServiceRegistry.registerService()

      assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
    } catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
   
    Properties props = new Properties();
    props.put("foo", "bar");
    ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
    ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
   
    ServiceReference[] ref = null;
    try {
      ref = registry.getServiceReferences(BarService.class.getName(), "(foo=bar)");
View Full Code Here

Examples of org.apache.felix.ipojo.context.ServiceRegistry.registerService()

    } catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
   
    Properties props = new Properties();
    props.put("foo", "bar");
    ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
    ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
   
    ServiceReference[] ref = null;
    try {
      ref = registry.getServiceReferences(BarService.class.getName(), "(foo=bar)");
    } catch (InvalidSyntaxException e) { fail("Registry query fail : " + e.getMessage()); }
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.