Logo Search packages:      
Sourcecode: libjgroups-java version File versions

final Object org::jgroups::Message::getObject (  )  [inline]

Uses Java serialization to create an object from the buffer of the message. Note that this is dangerous when using your own classloader, e.g. inside of an application server ! Most likely, JGroups will use the system classloader to deserialize the buffer into an object, whereas (for example) a web application will want to use the webapp's classloader, resulting in a ClassCastException. The recommended way is for the application to use their own serialization and only pass byte[] buffer to JGroups.

Returns:

Definition at line 293 of file Message.java.

References buf, length, and offset.

Referenced by org::jgroups::blocks::RpcDispatcher::handle(), org::jgroups::util::Util::printMessage(), org::jgroups::util::Util::printMethodCall(), org::jgroups::tests::LargeState::receive(), org::jgroups::tests::UnicastLoopbackTest::MyReceiver::receive(), org::jgroups::blocks::ReplicatedTree::receive(), org::jgroups::blocks::ReplicatedHashtable::receive(), org::jgroups::blocks::NotificationBus::receive(), org::jgroups::tests::ConnectTest::testDisconnectConnectSendTwo(), org::jgroups::tests::DisconnectTest::testDisconnectConnectSendTwo_Default(), org::jgroups::tests::DisconnectTest::testDisconnectConnectSendTwo_TUNNEL(), org::jgroups::tests::EncryptMessageOrderTestCase::testLoad(), org::jgroups::tests::MultiplexerConcurrentTest::testTwoMessagesFromSameSenderToSameService(), toStringAsObject(), org::jgroups::protocols::DISCARD_PAYLOAD::up(), and org::jgroups::protocols::FC::up().

                                    {
        try {
            return Util.objectFromByteBuffer(buf, offset, length);
        }
        catch(Exception ex) {
            throw new IllegalArgumentException(ex);
        }
    }


Generated by  Doxygen 1.6.0   Back to index