The best thing you can do to keep the muscle stimulated while removing as much stress from the joint as possible is to avoid free weight multi-joint movements. No dips, no bench press, etc.
You could try isolation movements, and see how they feel. If there is still pain, try different ranges of motion, to see if the pain is limited to a certain area. If so, avoid that area.
If free weight isolation movements still hurt you, then move to machines. Machines will help isolate and stimulate the goal muscle, with minimum stress of the joints. This is because machines work in a two dimensional movement, where free weights work in three dimensions of movement. Machines also stabilize and balance the weight throughout the movement, so that stabilizer activity is kept to a minimum, which will also relieve the joints.
Of course, no matter what movements you perform, avoid going heavy, as the pressure alone will compress, shift, and hurt the joints.