Weak compactness in spaces of bochner integrable functions and applications