Package org.activeio

Examples of org.activeio.Packet


        ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
        try {

            RequestChannel channel = createRequestChannel(target);
            Packet response;
            try {
                channel.start();
                Packet request = serialize(invocation);
                response = channel.request(request, Service.WAIT_FOREVER_TIMEOUT);
            } finally {
                channel.dispose();               
            }
           
View Full Code Here


                  Subject subject = Subject.getSubject(AccessController.getContext());
                  String p = subject.getPrincipals().iterator().next().toString();
                  log.info("Sending request as: "+p);

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

                  Subject subject = Subject.getSubject(AccessController.getContext());
                  String p = subject.getPrincipals().iterator().next().toString();
                  log.info("Sending request as: "+p);

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

        ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
        try {

            RequestChannel channel = createRequestChannel(target);
            Packet response;
            try {
                channel.start();
                Packet request = serialize(invocation);
                response = channel.request(request, Service.WAIT_FOREVER_TIMEOUT);
            } finally {
                channel.dispose();               
            }
           
View Full Code Here

                  Subject subject = Subject.getSubject(AccessController.getContext());
                  String p = subject.getPrincipals().iterator().next().toString();
                  log.info("Sending request as: "+p);

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

        ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
        try {

            RequestChannel channel = createRequestChannel(target);
            Packet response;
            try {
                channel.start();
                Packet request = serialize(invocation);
                response = channel.request(request, Service.WAIT_FOREVER_TIMEOUT);
            } finally {
                channel.dispose();
            }
View Full Code Here

                  Subject subject = Subject.getSubject(AccessController.getContext());
                  String p = subject.getPrincipals().iterator().next().toString();
                  log.info("Sending request as: "+p);

                    Packet request = new ByteArrayPacket("whoami".getBytes());
                    Packet response = channel.request(request, 1000*5*1000);

                    assertNotNull(response);
                    assertEquals( p, new String(response.sliceAsBytes()) );
                    return null;
              }
          });
        } finally {
            channel.dispose();
View Full Code Here

        ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();
        try {

            RequestChannel channel = createRequestChannel(target);
            Packet response;
            try {
                channel.start();
                Packet request = serialize(invocation);
                response = channel.request(request, Service.WAIT_FOREVER_TIMEOUT);
            } finally {
                channel.dispose();               
            }
           
View Full Code Here

        oos.writeByte(STORE_BYTE);
        oos.writeUTF(queue);
        oos.write(id.asByteArray());
        oos.writeObject(obj);
        oos.close();
        Packet packet = new ByteArrayPacket(baos.toByteArray());
        RecordLocation loc = journal.write(packet, false);
        synchronized (markLock) {
            marks.put(id, loc);
            pendingMarks.add(loc);
        }
View Full Code Here

     */
    public Object load(String queue, Object id) throws IOException
    {
        try {
            RecordLocation loc = (RecordLocation)marks.get(id);
            Packet packet = journal.read(loc);
            ObjectInputStream ois = new ObjectInputStream(
                    new ByteArrayInputStream(packet.sliceAsBytes()));
            ois.readByte();
            ois.readUTF();
            ois.skipBytes(UUID_LENGTH);
            Object obj = ois.readObject();
            return obj;
View Full Code Here

TOP

Related Classes of org.activeio.Packet

Copyright © 2018 www.massapicom. 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.