Examples of Pipe


Examples of java.nio.channels.Pipe

      log.info("starting event dispatch");

      //stream the events from the source buffer without the EOW

      //comm channels between reader and writer
      Pipe pipe = Pipe.open();
      Pipe.SinkChannel writerStream = pipe.sink();
      Pipe.SourceChannel readerStream = pipe.source();
      writerStream.configureBlocking(true);
      readerStream.configureBlocking(false);

      //Event writer - Relay in the real world
      Checkpoint cp = Checkpoint.createFlexibleCheckpoint();
View Full Code Here

Examples of net.minecraft.src.buildcraft.transport.Pipe

        return true;
    }

    @Override
    public boolean isPipeConnected(TileEntity tile) {
        Pipe pipe2 = null;

        if (tile instanceof TileGenericPipe) {
            pipe2 = ((TileGenericPipe) tile).pipe;
        }
View Full Code Here

Examples of net.paoding.rose.web.portal.Pipe

    public Object after(Invocation inv, Object instruction) {

        // codes for fix this exception: "Cannot forward after response has been committed"
        // @see RoseFilter#supportsRosepipe
        // @see PortalImpl#addWindow
        Pipe pipe = PortalUtils.getPipe(inv);
        if (pipe != null && pipe.getInvocation() == inv) {
            boolean debugEnabled = logger.isDebugEnabled();
            if (debugEnabled) {
                logger.debug(pipe + " is going to wait pipe windows' ins.");
            }
            final long begin = System.currentTimeMillis();
            final long deadline;
            if (pipe.getTimeout() > 0) {
                deadline = begin + pipe.getTimeout();
            } else {
                deadline = -1;
            }

            try {
                for (Window window : pipe.getWindows()) {
                    if (window.get(RoseConstants.PIPE_WINDOW_IN) != Boolean.TRUE) {
                        synchronized (window) {
                            while (window.get(RoseConstants.PIPE_WINDOW_IN) != Boolean.TRUE) {
                                long now = System.currentTimeMillis();
                                if (deadline <= 0) {
View Full Code Here

Examples of org.fnlp.nlp.pipe.Pipe

    // 特征集合
    IFeatureAlphabet features = factory.DefaultFeatureAlphabet();

    featurePipe = new Sequence2FeatureSequence(templets, features, labels);

    Pipe pipe = new SeriesPipes(new Pipe[] { new Target2Label(labels), featurePipe });

    return pipe;
  }
View Full Code Here

Examples of org.gbcpainter.game.model.grid.Pipe

    }
  }

  @Test
  public void testPipeColoring() throws Exception {
    Pipe pipe = new PipeImpl( new ImmutableSegment2D( 0, 0, 0, 10 ) );

    assertFalse( pipe.isColored() );
    pipe.setColored( new Point( 0, 1 ), true );

    assertFalse( pipe.isColored() );
    assertTrue( pipe.isColoredAt( new Point( 0, 1 ) ) );

    for (int i = 1; i < 4; i++) {
      pipe.setColored( new Point( 0, i ), true );
    }

    try {
      pipe.setColored( new Point( 88, 55 ), true );
      fail();
    } catch ( IllegalArgumentException e ) {
    }

    try {
      pipe.setColored( new Point( 0, 0 ), true );
      fail();
    } catch ( IllegalArgumentException e ) {
    }

    try {
      pipe.setColored( new Point( 0, 10 ), true );
      fail();
    } catch ( IllegalArgumentException e ) {
    }

    assertFalse( pipe.isColored() );
    assertTrue( pipe.isColoredAt( new Point( 0, 3 ) ) );
    assertFalse( pipe.isColoredAt( new Point( 0, 4 ) ) );

    pipe.setColored( new Point( 0, 1 ), false );
    assertFalse( pipe.isColoredAt( new Point( 0, 1 ) ) );
    assertTrue( pipe.isColoredAt( new Point( 0, 2 ) ) );

    pipe.reset();
    assertFalse( pipe.isColoredAt( new Point( 0, 2 ) ) );


    for (int i = 1; i < 10; i++) {
      pipe.setColored( new Point( 0, i ), true );
    }
    assertTrue( pipe.isColored() );

    pipe.reset();
    assertFalse( pipe.isColored() );

    for (int i = 1; i < 4; i++) {
      pipe.setColored( new Point( 0, i ), true );
    }

    for (int i = 9; i > 4; i--) {
      pipe.setColored( new Point( 0, i ), true );
    }

    assertFalse( pipe.isColored() );

    pipe.setColored( new Point( 0, 4 ), true );

    assertTrue( pipe.isColored() );
  }
View Full Code Here

Examples of org.im4java.process.Pipe

    IMOperation op = new IMOperation();
    op.addImage(tiffPath);
    op.addImage("jp2:-");

    Pipe pipe = new Pipe(null, byteArrayOutputStream);

    ConvertCmd convert = new ConvertCmd();
    convert.setOutputConsumer(pipe);
    convert.run(op);
View Full Code Here

Examples of org.ops4j.io.Pipe

     *
     * @return stream handler
     */
    private Thread createShutdownHook(final Process process)
    {
        final Pipe errPipe = new Pipe(process.getErrorStream(), System.err).start("Error pipe");
        final Pipe outPipe = new Pipe(process.getInputStream(), System.out).start("Out pipe");
        final Pipe inPipe = new Pipe(process.getOutputStream(), System.in).start("In pipe");

        return new Thread(
            new Runnable()
            {
                @Override
                public void run()
                {
                    inPipe.stop();
                    outPipe.stop();
                    errPipe.stop();

                    try
                    {
View Full Code Here

Examples of smilehouse.opensyncro.pipes.Pipe

          {
              return value != null ? value.toString() : "";
          }
      }
   private Pipe getPipe(ParameterManager parameters, HttpSession session, Persister pers) {
          Pipe pipe = null;
          // Was it given as a parameters?
          if(parameters.wasGiven(PIPE_ID) && !parameters.wasIllegal(PIPE_ID)) {
              Long pipeId = new Long(parameters.getLong(PIPE_ID));
              pipe = pers.loadPipe(pipeId);
          }
          // How about the session?
          if(pipe == null) {
              Long pipeId = (Long) session.getAttribute(PIPE_ID_SESSION_KEY);
              if(pipeId != null)
                  pipe = pers.loadPipe(pipeId);
          }
          // Well... ANY PIPE will do!
          if(pipe == null) {
              pipe = pers.loadFirstPipeYouFind();
          }

          if(pipe != null)
              session.setAttribute(PIPE_ID_SESSION_KEY, pipe.getId());

          return pipe;
      }
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.