Examples of register()


Examples of java.nio.channels.SelectableChannel.register()

    public void Add(Socket x)
    {
        SelectableChannel ch = x.GetChannel();
        try
        {
            SelectionKey key = ch.register( m_selector, ch.validOps(), x);
            x.SetKey(key);
            x.OnInitialOps();
            m_sockets.add(x);
            PrintSockets();
        } catch (Exception e)

Examples of java.nio.channels.ServerSocketChannel.register()

            sock_channel.socket().bind(key);

            // 3. Register the selector with all server sockets. 'Key' is attachment, so we get it again on
            //    select(). That way we can associate it with the mappings hashmap to find the corresponding
            //    value
            sock_channel.register(selector, SelectionKey.OP_ACCEPT, key);
        }

        // 4. Start main loop. won't return until CTRL-C'ed       
        loop(selector);
    }

Examples of java.nio.channels.SocketChannel.register()

            SocketChannel socketChannel = serverChannel.accept();
            if(LOG.isDebugEnabled()) {
                LOG.debug("accepted a connection from " + socketChannel.socket().getInetAddress());
            }
            socketChannel.configureBlocking(false);
            socketChannel.register(key.selector(), SelectionKey.OP_READ, nextHandler);
        }

    }

    private final class IOHandler implements Handler {

Examples of java.nio.channels.spi.AbstractSelectableChannel.register()

      for (int i = 0; i < numReqs; ++i) {
        AbstractSelectableChannel result = handlers[i].channel();
        if (!stopping) {
          try {
            result.register(selector_, SelectionKey.OP_READ, handlers[i]);
          } catch (Exception e) {
            LOG.warn("Fails to register a channel", e);
          }
        } else {
          try {

Examples of java.nio.file.Path.register()

    try {
      final WatchService watcher = FileSystems.getDefault()
          .newWatchService();
      final Path dir = Paths.get(Constants.DATA_PATH + "playlist/");
      dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY);

      System.out.println("Watch Service registered for dir: "
          + dir.getFileName());

      while (true) {

Examples of java.util.concurrent.Phaser.register()

    JArmus.register(c);
    JArmus.register(b);
    for (int _i = 1; _i <= I; _i++) {
      final int i = _i;
      c.register();
      b.register();
      new Thread() { // Spawn task i
        public void run() {
          JArmus.register(c);
          JArmus.register(b);
          for (int j = 1; j <= J; j++) {

Examples of javax.microedition.content.Registry.register()

        // Get access to the registry
        final Registry registry = Registry.getRegistry(CLASSNAME);

        try {
            // Register as a content handler
            registry.register(CLASSNAME, types, suffixes, actions,
                    actionNameMaps, ID, null);
        } catch (final ContentHandlerException che) {
            System.out.println("Registry#register() threw " + che.toString());
        } catch (final ClassNotFoundException cnfe) {
            System.out.println("Registry#register() threw " + cnfe.toString());

Examples of javax.validation.ValidatorFactory.register()

                    throw new OpenEJBException("PersistenceUnit already deployed: " + info.persistenceUnitRootUrl);
                } catch (Exception e) {
                    throw new OpenEJBException(e);
                }

                factory.register();
            }

            // Connectors
            for (ConnectorInfo connector : appInfo.connectors) {
                ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();

Examples of javax.ws.rs.client.Client.register()

   
    @Test
    public void testGetBookSpec() {
        String address = "http://localhost:" + PORT + "/bookstore/bookheaders/simple";
        Client client = ClientBuilder.newClient();
        client.register((Object)ClientFilterClientAndConfigCheck.class);
        client.property("clientproperty", "somevalue");
        Book book = client.target(address).request("application/xml").get(Book.class);
        assertEquals(124L, book.getId());
    }
   

Examples of javax.ws.rs.client.WebTarget.register()

    for(Map.Entry<String, List<Object> > entry : request.queryParams().entrySet()) {
      for (Object o : entry.getValue()) {
        target = target.queryParam(entry.getKey(), o);
      }
    }
        target.register(logger);
    Invocation.Builder invocation = target.request();

    for(Map.Entry<String, List<Object>> h : request.headers().entrySet()) {
      StringBuilder sb = new StringBuilder();
      for(Object v : h.getValue()) {
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.