Change speed for certain vehicle profile

but how i create trafficJamEnc?

You create e.g. a BooleanEncodedValue and add it to the EncodingManager. E.g. see CustomWeightingTest where we create an EncodedValue for lanes:

carFE = new CarFlagEncoder().setSpeedTwoDirections(true);
laneEnc = new UnsignedIntEncodedValue("lanes", 2, true);
encodingManager = new EncodingManager.Builder().add(carFE).add(laneEnc).build();

and how can I force the GH instance to use the CustomWeighting class I create?

You can use it in the custom weighting file or per request. See the profiles: graphhopper/docs/core/profiles.md at 2.0 · graphhopper/graphhopper · GitHub