Examples of Streamable


Examples of org.apache.fop.afp.Streamable

    protected <S extends Streamable> void writeObjects(Collection<S> objects, OutputStream os)
            throws IOException {
        if (objects != null) {
            Iterator<S> it = objects.iterator();
            while (it.hasNext()) {
                Streamable s = it.next();
                s.writeToStream(os);
                it.remove(); // once written, immediately remove the object
            }
        }
    }
View Full Code Here

Examples of org.elasticsearch.common.io.stream.Streamable

        }
        handlesStream.cleanHandles();
    }

    private void handleResponse(StreamInput buffer, final TransportResponseHandler handler) {
        final Streamable streamable = handler.newInstance();
        try {
            streamable.readFrom(buffer);
        } catch (Exception e) {
            handleException(handler, new TransportSerializationException("Failed to deserialize response of type [" + streamable.getClass().getName() + "]", e));
            return;
        }
        try {
            if (handler.executor() == ThreadPool.Names.SAME) {
                //noinspection unchecked
View Full Code Here

Examples of org.elasticsearch.common.io.stream.Streamable

        try {
            final TransportRequestHandler handler = transportServiceAdapter.handler(action);
            if (handler == null) {
                throw new ActionNotFoundTransportException(action);
            }
            final Streamable streamable = handler.newInstance();
            streamable.readFrom(buffer);
            if (handler.executor() == ThreadPool.Names.SAME) {
                //noinspection unchecked
                handler.messageReceived(streamable, transportChannel);
            } else {
                threadPool.executor(handler.executor()).execute(new RequestHandler(handler, streamable, transportChannel, action));
View Full Code Here

Examples of org.elasticsearch.common.io.stream.Streamable

        try {
            final TransportRequestHandler handler = transportServiceAdapter.handler(action);
            if (handler == null) {
                throw new ActionNotFoundTransportException("Action [" + action + "] not found");
            }
            final Streamable streamable = handler.newInstance();
            streamable.readFrom(stream);
            handler.messageReceived(streamable, transportChannel);
        } catch (Exception e) {
            try {
                transportChannel.sendResponse(e);
            } catch (IOException e1) {
View Full Code Here

Examples of org.elasticsearch.common.io.stream.Streamable

        }
    }


    private void handleResponse(StreamInput buffer, final TransportResponseHandler handler) {
        final Streamable streamable = handler.newInstance();
        try {
            streamable.readFrom(buffer);
        } catch (Exception e) {
            handleException(handler, new TransportSerializationException("Failed to deserialize response of type [" + streamable.getClass().getName() + "]", e));
            return;
        }
        threadPool.executor(handler.executor()).execute(new Runnable() {
            @SuppressWarnings({"unchecked"}) @Override public void run() {
                try {
View Full Code Here

Examples of org.omg.CORBA.portable.Streamable

  }

  public void testExtract_Streamable()
                              throws BAD_INV_ORDER
  {
    Streamable expectedReturn =
      new ShortHolder((short) r.nextInt(Short.MAX_VALUE));
    any.insert_Streamable(expectedReturn);

    Streamable actualReturn = any.extract_Streamable();
    assertEquals("Streamable", expectedReturn, actualReturn);
  }
View Full Code Here

Examples of org.omg.CORBA.portable.Streamable

    {
        String testValue = "hello world";

        Any outAny = setup.getClientOrb().create_any();
        outAny.insert_Streamable(new StringHolder(testValue));
        Streamable s = outAny.extract_Streamable();
        assertEquals (testValue, ((StringHolder)s).value);

        Any inAny = server.bounce_any(outAny);
        assertTrue (outAny.equal(inAny));
    }
View Full Code Here

Examples of org.teiid.core.types.Streamable

    for (int i = 0; i < lobIndexes.length; i++) {
      Object anObj = tuple.get(lobIndexes[i]);
      if (!(anObj instanceof Streamable<?>)) {
        continue;
      }
      Streamable lob = (Streamable) anObj;
      if (lob.getReference() == null) {
        lob.setReference(getLobReference(lob.getReferenceStreamId()).getReference());
      } else {
        String id = lob.getReferenceStreamId();
        this.lobReferences.put(id, lob);
      }
    }
  }
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.