users@jersey.java.net

[Jersey] ResourceFilterFactory and resource method

From: DaHoopster <hwang_at_myvest.com>
Date: Wed, 15 Dec 2010 12:00:56 -0800 (PST)

Hi,

In order to implement seamless encryption and decryption, I created a
resource filter that unmarshal the incoming XML stream into java objects,
call the getter method to get the encrypted value, decrypt the value and
pass it onto the resource method. In this manner, developers of individual
resources can work with integers or unencrypted strings directly.

Currently my implementation is inefficient that after decrypting the values,
I am marshaling the java objects into XML again and forward the request onto
the resource methods. Is there a way to skip the marshaling?

Thanks,

Here is some sudo code:

in the resource filter:

[code]
    MyObject javaObject =
unmarshal(containerRequest.getEntityInputStream());
    decrypt(javaObject);
    InputStream is = marshal(javaObject);
    containerRequest.setEntityInputStream(is);
    
    return containerRequest;
[code]


In the resource method:

[code]
    public void getInventoryItem(MyObject myObject)
    {
        ...
        ...
    }
[code]
-- 
View this message in context: http://jersey.576304.n2.nabble.com/ResourceFilterFactory-and-resource-method-tp5838360p5838360.html
Sent from the Jersey mailing list archive at Nabble.com.