JAVA toolbox profile swap on AS400

We need to use the profile swap method - ProfileTokenCredential - in the JAVA toolbox on the AS400. Where do I put the call to the method and how do I utilize this JAVA feature? We are using wm 6.0 and connecting to the AS400 via sockets.