class XMPPPPacketReaderFactory extends BasePooledObjectFactory<XMPPPacketReader> {

    private static Logger Log = LoggerFactory.getLogger( XMPPPPacketReaderFactory.class );

    private static XmlPullParserFactory xppFactory = null;
    static {
        try {
            xppFactory = XmlPullParserFactory.newInstance(MXParser.class.getName(), null);
            xppFactory.setNamespaceAware(true);
        }
        catch (XmlPullParserException e) {
            Log.error("Error creating a parser factory", e);
        }
    }

    //-- BasePooledObjectFactory implementation 
    
    @Override
    public XMPPPacketReader create() throws Exception {<FILL_FUNCTION_BODY>}

    @Override
    public PooledObject<XMPPPacketReader> wrap(XMPPPacketReader reader) {
        return new DefaultPooledObject<XMPPPacketReader>(reader);
    }

    @Override
    public boolean validateObject(PooledObject<XMPPPacketReader> po) {
        // reset the input for the pooled parser
        try {
            po.getObject().getXPPParser().resetInput();
            return true;
        } catch (XmlPullParserException xppe) {
            Log.error("Failed to reset pooled parser; evicting from pool", xppe);
            return false;
        }
    }


}

        XMPPPacketReader parser = new XMPPPacketReader();
        parser.setXPPFactory( xppFactory );
        return parser;
    
<no_super_class>